summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-03-26 15:38:18 +1100
committerJesse Duffield <jessedduffield@gmail.com>2023-04-30 13:19:53 +1000
commit037cd9913881d5d39c5a9ed1ceb1c8368c5ccd0c (patch)
treeb98095936add9e887c1ab67d8fa47d459375a2a7 /pkg/gui/gui.go
parent6388885699c7ea105db731d21efe16222bc0b675 (diff)
move quit actions to controller
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r--pkg/gui/gui.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index 45c3ff44e..22f0c748a 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -178,6 +178,14 @@ func (self *StateAccessor) SetShowExtrasWindow(value bool) {
self.gui.ShowExtrasWindow = value
}
+func (self *StateAccessor) GetRetainOriginalDir() bool {
+ return self.gui.RetainOriginalDir
+}
+
+func (self *StateAccessor) SetRetainOriginalDir(value bool) {
+ self.gui.RetainOriginalDir = value
+}
+
// we keep track of some stuff from one render to the next to see if certain
// things have changed
type PrevLayout struct {
@@ -632,7 +640,7 @@ func (gui *Gui) RunAndHandleError(startArgs appTypes.StartArgs) error {
switch err {
case gocui.ErrQuit:
- if gui.RetainOriginalDir {
+ if gui.c.State().GetRetainOriginalDir() {
if err := gui.helpers.RecordDirectory.RecordDirectory(gui.InitialDir); err != nil {
return err
}