mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 20:36:03 +02:00
prevent interrupting confirmation panel
This commit is contained in:
parent
46e9946854
commit
952a4f3f23
2 changed files with 25 additions and 7 deletions
|
@ -197,6 +197,8 @@ type GuiRepoState struct {
|
|||
savedCommitMessage string
|
||||
|
||||
ScreenMode WindowMaximisation
|
||||
|
||||
CurrentPopupOpts *types.CreatePopupPanelOpts
|
||||
}
|
||||
|
||||
type Controllers struct {
|
||||
|
@ -280,6 +282,7 @@ type guiMutexes struct {
|
|||
LocalCommitsMutex *sync.Mutex
|
||||
LineByLinePanelMutex *sync.Mutex
|
||||
SubprocessMutex *sync.Mutex
|
||||
PopupMutex *sync.Mutex
|
||||
}
|
||||
|
||||
func (gui *Gui) onNewRepo(filterPath string, reuseState bool) error {
|
||||
|
@ -322,6 +325,13 @@ func (gui *Gui) resetState(filterPath string, reuseState bool) {
|
|||
if state := gui.RepoStateMap[Repo(currentDir)]; state != nil {
|
||||
gui.State = state
|
||||
gui.State.ViewsSetup = false
|
||||
|
||||
// setting this to nil so we don't get stuck based on a popup that was
|
||||
// previously opened
|
||||
gui.Mutexes.PopupMutex.Lock()
|
||||
gui.State.CurrentPopupOpts = nil
|
||||
gui.Mutexes.PopupMutex.Unlock()
|
||||
|
||||
gui.syncViewContexts()
|
||||
return
|
||||
}
|
||||
|
@ -441,6 +451,7 @@ func NewGui(
|
|||
LocalCommitsMutex: &sync.Mutex{},
|
||||
LineByLinePanelMutex: &sync.Mutex{},
|
||||
SubprocessMutex: &sync.Mutex{},
|
||||
PopupMutex: &sync.Mutex{},
|
||||
},
|
||||
InitialDir: initialDir,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue