summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-03-17 18:42:44 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-03-17 19:01:28 +1100
commitfa8571e1f4c349e401542285ea238acdbd9d17ec (patch)
tree1af1e025963592d2fdd0a547b0f93ee55c05cf6a /pkg/gui/gui.go
parentd8d0d4686d15700e67a1ecbcec310ee55f3a16c5 (diff)
rename field
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r--pkg/gui/gui.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index 416a2faf7..981a81987 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -125,7 +125,13 @@ type Gui struct {
IsNewRepo bool
- InitialRepoDir string
+ // this is the initial dir we are in upon opening lazygit. We hold onto this
+ // in case we want to restore it before quitting for users who have set up
+ // the feature for changing directory upon quit.
+ // The reason we don't just wait until quit time to handle changing directories
+ // is because some users want to keep track of the current lazygit directory in an outside
+ // process
+ InitialDir string
}
type listPanelState struct {
@@ -449,7 +455,7 @@ func NewGui(
updater *updates.Updater,
filterPath string,
showRecentRepos bool,
- initialRepoDir string,
+ initialDir string,
) (*Gui, error) {
gui := &Gui{
Common: cmn,
@@ -468,7 +474,7 @@ func NewGui(
// sake of backwards compatibility. We're making use of short circuiting here
ShowExtrasWindow: cmn.UserConfig.Gui.ShowCommandLog && !config.GetAppState().HideCommandLog,
- InitialRepoDir: initialRepoDir,
+ InitialDir: initialDir,
}
guiIO := oscommands.NewGuiIO(
@@ -596,7 +602,7 @@ func (gui *Gui) RunAndHandleError() error {
switch err {
case gocui.ErrQuit:
if gui.State.RetainOriginalDir {
- if err := gui.recordDirectory(gui.InitialRepoDir); err != nil {
+ if err := gui.recordDirectory(gui.InitialDir); err != nil {
return err
}
} else {