Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions internal/application/dinky.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,13 +670,14 @@ func Main() {
ShowOkDialog("Error loading file", errorMessage, showLoadingError)
}
}
showLoadingError()

if len(fileBuffers) == 0 {
newFile("", "")
}
selectTab(fileBuffers[0].uuid)

// Shown after the tabs are set up so the dialog keeps focus.
showLoadingError()

// Track the mouse position (used by the GPM cursor renderer) and turn
// horizontal wheel events into horizontal scrolling of the editor. The
// capture is always called from the main loop, so mouseX/mouseY are safe to
Expand Down
3 changes: 3 additions & 0 deletions internal/application/messagedialog.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ func ShowMessageDialog(title string, message string, buttons []string, OnClose f
messageDialog.OnButtonClick = OnButtonClick
messageDialog.Open(title, message, buttons, width, height)
style.StyleMessageDialog(messageDialog)
// AddPage focuses the dialog before Open() has created the buttons, so focus
// the first button explicitly now that they exist.
app.SetFocus(messageDialog)

return messageDialog
}
Expand Down