mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-05 00:59:19 +02:00
Update gocui
This commit is contained in:
8
vendor/github.com/jesseduffield/gocui/gui.go
generated
vendored
8
vendor/github.com/jesseduffield/gocui/gui.go
generated
vendored
@ -1158,9 +1158,11 @@ func (g *Gui) onKey(ev *GocuiEvent) error {
|
||||
if len(v.Tabs) > 0 {
|
||||
tabIndex := v.GetClickedTabIndex(mx - v.x0)
|
||||
|
||||
for _, binding := range g.tabClickBindings {
|
||||
if binding.viewName == v.Name() {
|
||||
return binding.handler(tabIndex)
|
||||
if tabIndex >= 0 {
|
||||
for _, binding := range g.tabClickBindings {
|
||||
if binding.viewName == v.Name() {
|
||||
return binding.handler(tabIndex)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
15
vendor/github.com/jesseduffield/gocui/view.go
generated
vendored
15
vendor/github.com/jesseduffield/gocui/view.go
generated
vendored
@ -1214,15 +1214,22 @@ func (v *View) GetClickedTabIndex(x int) int {
|
||||
return 0
|
||||
}
|
||||
|
||||
charIndex := 0
|
||||
charX := 1
|
||||
if x <= charX {
|
||||
return -1
|
||||
}
|
||||
for i, tab := range v.Tabs {
|
||||
charIndex += len(tab + " - ")
|
||||
if x < charIndex {
|
||||
charX += runewidth.StringWidth(tab)
|
||||
if x <= charX {
|
||||
return i
|
||||
}
|
||||
charX += runewidth.StringWidth(" - ")
|
||||
if x <= charX {
|
||||
return -1
|
||||
}
|
||||
}
|
||||
|
||||
return 0
|
||||
return -1
|
||||
}
|
||||
|
||||
func (v *View) SelectedLineIdx() int {
|
||||
|
Reference in New Issue
Block a user