Skip to content

Commit fce72fa

Browse files
authored
fix(nvim): use raw text for highlight in preview (#637)
1 parent 0a953ab commit fce72fa

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

lua/fff/location_utils.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ function M.highlight_grep_matches(bufnr, location, namespace)
204204

205205
-- Build case-insensitive pattern if the query has no uppercase (smart case)
206206
local has_upper = search_text:match('[A-Z]')
207-
local escaped = vim.pesc(search_text)
208207

209208
-- Highlight pattern occurrences in a window around the target line.
210209
-- Limit to ±200 lines from target to keep it fast for large files.
@@ -218,7 +217,7 @@ function M.highlight_grep_matches(bufnr, location, namespace)
218217
for idx, line in ipairs(lines) do
219218
local i = scan_start + idx - 1
220219
local search_line = has_upper and line or line:lower()
221-
local search_pat = has_upper and escaped or escaped:lower()
220+
local search_pat = has_upper and search_text or search_text:lower()
222221
local start_pos = 1
223222
while true do
224223
local s, e = search_line:find(search_pat, start_pos, true)

0 commit comments

Comments
 (0)