Skip to content

Commit f4d576b

Browse files
committed
Allow action chaining of 'FindNext' and 'FindPrevious'
1 parent 9eb8782 commit f4d576b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/action/actions.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,9 @@ func (h *BufPane) UnhighlightSearch() bool {
10741074

10751075
// FindNext searches forwards for the last used search term
10761076
func (h *BufPane) FindNext() bool {
1077+
if h.Buf.LastSearch == "" {
1078+
return false
1079+
}
10771080
// If the cursor is at the start of a selection and we search we want
10781081
// to search from the end of the selection in the case that
10791082
// the selection is a search result in which case we wouldn't move at
@@ -1100,6 +1103,9 @@ func (h *BufPane) FindNext() bool {
11001103

11011104
// FindPrevious searches backwards for the last used search term
11021105
func (h *BufPane) FindPrevious() bool {
1106+
if h.Buf.LastSearch == "" {
1107+
return false
1108+
}
11031109
// If the cursor is at the end of a selection and we search we want
11041110
// to search from the beginning of the selection in the case that
11051111
// the selection is a search result in which case we wouldn't move at

0 commit comments

Comments
 (0)