Focus command bar if active on startup (#2179)

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
mine
Yarek T 2023-08-05 15:43:27 +01:00 committed by GitHub
parent 6f74374291
commit c67093807b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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())
}
})
}()