Skip to content

Commit

Permalink
Escape regex in pre-filled search pattern in Find prompt
Browse files Browse the repository at this point in the history
Fixes #3177
  • Loading branch information
dmaluka committed Mar 15, 2024
1 parent db26b5f commit 399134f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/action/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,9 @@ func (h *BufPane) find(useRegex bool) bool {
}
}
pattern := string(h.Cursor.GetSelection())
if useRegex && pattern != "" {
pattern = regexp.QuoteMeta(pattern)
}
if eventCallback != nil && pattern != "" {
eventCallback(pattern)
}
Expand Down

0 comments on commit 399134f

Please sign in to comment.