mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-12-02 09:21:40 +02:00
Refresh when the terminal window gets the focus
This commit is contained in:
parent
c5acbb6c7c
commit
8ce60662f2
@ -288,6 +288,15 @@ func (gui *Gui) onNewRepo(startArgs appTypes.StartArgs, contextKey types.Context
|
||||
return err
|
||||
}
|
||||
|
||||
gui.g.SetFocusHandler(func(Focused bool) error {
|
||||
if Focused {
|
||||
gui.c.Log.Info("Receiving focus - refreshing")
|
||||
return gui.helpers.Refresh.Refresh(types.RefreshOptions{Mode: types.ASYNC})
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
// if a context key has been given, push that instead, and set its index to 0
|
||||
if contextKey != context.NO_CONTEXT {
|
||||
contextToPush = gui.c.ContextForKey(contextKey)
|
||||
|
Loading…
Reference in New Issue
Block a user