File tree Expand file tree Collapse file tree 2 files changed +18
-21
lines changed Expand file tree Collapse file tree 2 files changed +18
-21
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,8 @@ package gui
2
2
3
3
import (
4
4
"github.com/jesseduffield/gocui"
5
- "github.com/jesseduffield/lazygit/pkg/gui/context"
6
5
"github.com/jesseduffield/lazygit/pkg/gui/types"
7
6
"github.com/samber/lo"
8
- "golang.org/x/exp/slices"
9
7
)
10
8
11
9
// layout is called for every screen re-render e.g. when the screen is resized
@@ -244,25 +242,6 @@ func (gui *Gui) onRepoViewReset() error {
244
242
}
245
243
}
246
244
247
- gui .g .Mutexes .ViewsMutex .Lock ()
248
- // add tabs to views
249
- for _ , view := range gui .g .Views () {
250
- // if the view is in our mapping, we'll set the tabs and the tab index
251
- for _ , values := range gui .viewTabMap () {
252
- index := slices .IndexFunc (values , func (tabContext context.TabView ) bool {
253
- return tabContext .ViewName == view .Name ()
254
- })
255
-
256
- if index != - 1 {
257
- view .Tabs = lo .Map (values , func (tabContext context.TabView , _ int ) string {
258
- return tabContext .Tab
259
- })
260
- view .TabIndex = index
261
- }
262
- }
263
- }
264
- gui .g .Mutexes .ViewsMutex .Unlock ()
265
-
266
245
return nil
267
246
}
268
247
Original file line number Diff line number Diff line change @@ -4,8 +4,10 @@ import (
4
4
"fmt"
5
5
6
6
"github.com/jesseduffield/gocui"
7
+ "github.com/jesseduffield/lazygit/pkg/gui/context"
7
8
"github.com/jesseduffield/lazygit/pkg/theme"
8
9
"github.com/samber/lo"
10
+ "golang.org/x/exp/slices"
9
11
)
10
12
11
13
type viewNameMapping struct {
@@ -234,4 +236,20 @@ func (gui *Gui) configureViewProperties() {
234
236
235
237
gui .Views .Stash .TitlePrefix = ""
236
238
}
239
+
240
+ for _ , view := range gui .g .Views () {
241
+ // if the view is in our mapping, we'll set the tabs and the tab index
242
+ for _ , values := range gui .viewTabMap () {
243
+ index := slices .IndexFunc (values , func (tabContext context.TabView ) bool {
244
+ return tabContext .ViewName == view .Name ()
245
+ })
246
+
247
+ if index != - 1 {
248
+ view .Tabs = lo .Map (values , func (tabContext context.TabView , _ int ) string {
249
+ return tabContext .Tab
250
+ })
251
+ view .TabIndex = index
252
+ }
253
+ }
254
+ }
237
255
}
You can’t perform that action at this time.
0 commit comments