1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-02-03 13:21:56 +02:00

Fix bug where worktree view would take over window upon switching branches

When switching worktrees (which we can now do via the branch view) we re-layout the windows and their views.
We had the worktree view ahead of the file view based on the Flatten() method in context.go, because it used
to be associated with the branches panel.
This commit is contained in:
Jesse Duffield 2023-07-29 13:31:12 +10:00
parent b16bb409fc
commit a1fae41051
2 changed files with 7 additions and 2 deletions

View File

@ -124,10 +124,10 @@ func (self *ContextTree) Flatten() []types.Context {
self.Status,
self.Snake,
self.Submodules,
self.Worktrees,
self.Files,
self.SubCommits,
self.Remotes,
self.Worktrees,
self.RemoteBranches,
self.Tags,
self.Branches,

View File

@ -55,6 +55,11 @@ var AddFromBranch = NewIntegrationTest(NewIntegrationTestArgs{
Lines(
Contains("mybranch").IsSelected(),
Contains("newbranch (worktree)"),
)
).
// Confirm the files view is still showing in the files window
Press(keys.Universal.PrevBlock)
t.Views().Files().
IsFocused()
},
})