aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/core/doc/search.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/data/core/doc/search.lua b/data/core/doc/search.lua
index b4c553c9..8395769a 100644
--- a/data/core/doc/search.lua
+++ b/data/core/doc/search.lua
@@ -43,6 +43,7 @@ end
function search.find(doc, line, col, text, opt)
doc, line, col, text, opt = init_args(doc, line, col, text, opt)
+ local plain = not opt.pattern
local pattern = text
local search_func = string.find
if opt.regex then
@@ -60,9 +61,9 @@ function search.find(doc, line, col, text, opt)
end
local s, e
if opt.reverse then
- s, e = rfind(search_func, line_text, pattern, col - 1)
+ s, e = rfind(search_func, line_text, pattern, col - 1, plain)
else
- s, e = search_func(line_text, pattern, col)
+ s, e = search_func(line_text, pattern, col, plain)
end
if s then
return line, s, line, e + 1