Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented ResetSearch and allow action chaining of FindNext and FindPrevious #3333

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Allow action chaining of 'FindNext' and 'FindPrevious'
masmu committed Jun 8, 2024
commit f4d576b6e09f9fa7851a595a338cf41b7ad08802
6 changes: 6 additions & 0 deletions internal/action/actions.go
Original file line number Diff line number Diff line change
@@ -1074,6 +1074,9 @@ func (h *BufPane) UnhighlightSearch() bool {

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

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