mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Re-render focused main view on refresh if needed
This commit is contained in:
parent
98e4cb733f
commit
4e21a096b9
1 changed files with 13 additions and 0 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/jesseduffield/gocui"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/context"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
||||
"github.com/jesseduffield/lazygit/pkg/tasks"
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
|
@ -143,5 +144,17 @@ func (gui *Gui) postRefreshUpdate(c types.Context) {
|
|||
// correctly, and that integration tests see the up to date selection
|
||||
// state.
|
||||
c.FocusLine()
|
||||
|
||||
currentCtx := gui.State.ContextMgr.Current()
|
||||
if currentCtx.GetKey() == context.NORMAL_MAIN_CONTEXT_KEY || currentCtx.GetKey() == context.NORMAL_SECONDARY_CONTEXT_KEY {
|
||||
// Searching can't cope well with the view being updated while it is being searched.
|
||||
// We might be able to fix the problems with this, but it doesn't seem easy, so for now
|
||||
// just don't rerender the view while searching, on the assumption that users will probably
|
||||
// either search or change their data, but not both at the same time.
|
||||
if !currentCtx.GetView().IsSearching() {
|
||||
parentCtx := currentCtx.GetParentContext()
|
||||
parentCtx.HandleRenderToMain()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue