diff options
author | Luka Markušić <luka.markusic@microblink.com> | 2022-07-29 06:53:49 +0200 |
---|---|---|
committer | Luka Markušić <luka.markusic@microblink.com> | 2022-07-29 06:59:52 +0200 |
commit | 83dfc3b28b0ee3a38859ef461b0b7e5d19dcb000 (patch) | |
tree | 536b11bd0d7216b2b77bee551595a73d6943d983 /vendor | |
parent | 367b0d331836c90c015bf0c45f88612f3d94d08a (diff) |
Update gocui
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/github.com/jesseduffield/gocui/gui.go | 8 | ||||
-rw-r--r-- | vendor/github.com/jesseduffield/gocui/view.go | 15 | ||||
-rw-r--r-- | vendor/modules.txt | 2 |
3 files changed, 17 insertions, 8 deletions
diff --git a/vendor/github.com/jesseduffield/gocui/gui.go b/vendor/github.com/jesseduffield/gocui/gui.go index 17150c477..563d18dcc 100644 --- a/vendor/github.com/jesseduffield/gocui/gui.go +++ b/vendor/github.com/jesseduffield/gocui/gui.go @@ -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) + } } } } diff --git a/vendor/github.com/jesseduffield/gocui/view.go b/vendor/github.com/jesseduffield/gocui/view.go index 8051cce72..5735c2fc4 100644 --- a/vendor/github.com/jesseduffield/gocui/view.go +++ b/vendor/github.com/jesseduffield/gocui/view.go @@ -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 { diff --git a/vendor/modules.txt b/vendor/modules.txt index 07d49b414..96043b723 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -172,7 +172,7 @@ github.com/jesseduffield/go-git/v5/utils/merkletrie/filesystem github.com/jesseduffield/go-git/v5/utils/merkletrie/index github.com/jesseduffield/go-git/v5/utils/merkletrie/internal/frame github.com/jesseduffield/go-git/v5/utils/merkletrie/noder -# github.com/jesseduffield/gocui v0.3.1-0.20220417002912-bce22fd599f6 +# github.com/jesseduffield/gocui v0.3.1-0.20220723050330-1f853fadb335 ## explicit; go 1.12 github.com/jesseduffield/gocui # github.com/jesseduffield/kill v0.0.0-20220618033138-bfbe04675d10 |