Escape regex in pre-filled search pattern in Find prompt

Fixes #3177
This commit is contained in:
Dmytro Maluka 2024-03-15 12:25:39 +01:00
parent db26b5fee5
commit 399134fe5b

View File

@ -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)
}