Skip to content

Commit

Permalink
Focus command bar if active on startup (#2179)
Browse files Browse the repository at this point in the history
If the command bar was activated with `:` before or during the splash
delay, the main page would steal focus from it, breaking the UI.

This patch re-focuses the command bar if its active after switching
focus to the main page.

Fixes issue #2178
  • Loading branch information
YarekTyshchenko authored Aug 5, 2023
1 parent 6f74374 commit c670938
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/view/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,10 @@ func (a *App) Run() error {
<-time.After(splashDelay)
a.QueueUpdateDraw(func() {
a.Main.SwitchToPage("main")
// if command bar is already active, focus it
if a.CmdBuff().IsActive() {
a.SetFocus(a.Prompt())
}
})
}()

Expand Down

0 comments on commit c670938

Please sign in to comment.