Skip to content

Commit 2d0c7cb

Browse files
authored
Switch to Files panel after popping a stash (#3888)
#### PR Description I find myself always switching to the Files panel after popping a stash, 100% of the time, so it makes sense that lazygit does this for me. Do it for apply as well, for consistency. #### Please check if the PR fulfills these requirements * [x] Cheatsheets are up-to-date (run `go generate ./...`) * [x] Code has been formatted (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting)) * [x] Tests have been added/updated (see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md) for the integration test guide) * [ ] Text is internationalised (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation)) * [ ] If a new UserConfig entry was added, make sure it can be hot-reloaded (see [here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig)) * [ ] Docs have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc
2 parents 4c6c915 + f5b8619 commit 2d0c7cb

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

pkg/gui/controllers/stash_controller.go

+2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ func (self *StashController) handleStashApply(stashEntry *models.StashEntry) err
111111
if err != nil {
112112
return err
113113
}
114+
self.c.Context().Push(self.c.Contexts().Files)
114115
return nil
115116
}
116117

@@ -137,6 +138,7 @@ func (self *StashController) handleStashPop(stashEntry *models.StashEntry) error
137138
if err != nil {
138139
return err
139140
}
141+
self.c.Context().Push(self.c.Contexts().Files)
140142
return nil
141143
}
142144

pkg/integration/tests/stash/apply.go

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ var Apply = NewIntegrationTest(NewIntegrationTestArgs{
3636
)
3737

3838
t.Views().Files().
39+
IsFocused().
3940
Lines(
4041
Contains("file"),
4142
)

pkg/integration/tests/stash/pop.go

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ var Pop = NewIntegrationTest(NewIntegrationTestArgs{
3434
IsEmpty()
3535

3636
t.Views().Files().
37+
IsFocused().
3738
Lines(
3839
Contains("file"),
3940
)

0 commit comments

Comments
 (0)