1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-12 11:15:00 +02:00
lazygit/pkg/gui/filtering.go
Jesse Duffield 37bb89dac3 type i18n
2020-10-10 00:23:01 +11:00

22 lines
456 B
Go

package gui
func (gui *Gui) validateNotInFilterMode() (bool, error) {
if gui.State.Modes.Filtering.Active() {
err := gui.ask(askOpts{
title: gui.Tr.MustExitFilterModeTitle,
prompt: gui.Tr.MustExitFilterModePrompt,
handleConfirm: func() error {
return gui.exitFilterMode()
},
})
return false, err
}
return true, nil
}
func (gui *Gui) exitFilterMode() error {
gui.State.Modes.Filtering.Path = ""
return gui.Errors.ErrRestart
}