Skip to content

Commit 041dbd1

Browse files
xVermillionxxVermillionx
and
xVermillionx
authored
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>
1 parent efafd73 commit 041dbd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/nvim-tree.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ function M.open_on_directory()
105105
end
106106

107107
function M.place_cursor_on_node()
108-
local search = vim.fn.searchcount()
109-
if search and search.exact_match == 1 then
108+
local ok, search = pcall(vim.fn.searchcount)
109+
if ok and search and search.exact_match == 1 then
110110
return
111111
end
112112

0 commit comments

Comments
 (0)