Skip to content

Commit

Permalink
adapted to changes on lite-xl/lite-xl#1232
Browse files Browse the repository at this point in the history
  • Loading branch information
jgmdev committed Jan 19, 2023
1 parent fac9f19 commit dea010f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/search_ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ function Results:find(text, doc, force)

-- regex search
if regexcheck:is_checked() then
local regex_find_offsets = regex.match
if regex.find_offsets then
regex_find_offsets = regex.find_offsets
end
local pattern = regex.compile(
findtext:get_text(),
insensitive:is_checked() and "im" or "m"
Expand All @@ -187,7 +191,7 @@ function Results:find(text, doc, force)
search_func = function(line_text)
---@cast line_text string
local results = nil
local offsets = {regex.match(pattern, line_text)}
local offsets = {regex_find_offsets(pattern, line_text)}
if offsets[1] then
results = {}
for i=1, #offsets, 2 do
Expand Down

0 comments on commit dea010f

Please sign in to comment.