fix: searchcount exception on invalid search regex (#2693)
* fix: wrap searchcount in pcall to avoid error * fix: searchcount in pcall --------- Co-authored-by: xVermillionx <xVermillionx@notvalid>
This commit is contained in:
parent
efafd73efa
commit
041dbd18f4
@ -105,8 +105,8 @@ function M.open_on_directory()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function M.place_cursor_on_node()
|
function M.place_cursor_on_node()
|
||||||
local search = vim.fn.searchcount()
|
local ok, search = pcall(vim.fn.searchcount)
|
||||||
if search and search.exact_match == 1 then
|
if ok and search and search.exact_match == 1 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user