diff options
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/github.com/jesseduffield/gocui/view.go | 7 | ||||
-rw-r--r-- | vendor/modules.txt | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/vendor/github.com/jesseduffield/gocui/view.go b/vendor/github.com/jesseduffield/gocui/view.go index 4edc5a58d..887a5c7fe 100644 --- a/vendor/github.com/jesseduffield/gocui/view.go +++ b/vendor/github.com/jesseduffield/gocui/view.go @@ -218,7 +218,7 @@ func (v *View) SelectSearchResult(index int) error { } y := v.searcher.searchPositions[index].y - v.FocusPoint(0, y) + v.FocusPoint(v.ox, y) if v.searcher.onSelectItem != nil { return v.searcher.onSelectItem(y, index, itemCount) } @@ -227,10 +227,9 @@ func (v *View) SelectSearchResult(index int) error { func (v *View) Search(str string) error { v.writeMutex.Lock() - defer v.writeMutex.Unlock() - v.searcher.search(str) v.updateSearchPositions() + if len(v.searcher.searchPositions) > 0 { // get the first result past the current cursor currentIndex := 0 @@ -243,8 +242,10 @@ func (v *View) Search(str string) error { } } v.searcher.currentSearchIndex = currentIndex + v.writeMutex.Unlock() return v.SelectSearchResult(currentIndex) } else { + v.writeMutex.Unlock() return v.searcher.onSelectItem(-1, -1, 0) } } diff --git a/vendor/modules.txt b/vendor/modules.txt index 66d582ce3..47c766c71 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -161,7 +161,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.20211102093457-be3a05cf7131 +# github.com/jesseduffield/gocui v0.3.1-0.20211102104458-40df0be5a474 ## explicit github.com/jesseduffield/gocui # github.com/jesseduffield/minimal/gitignore v0.3.3-0.20211018110810-9cde264e6b1e |