Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 041dbd1

Browse files
xVermillionxxVermillionx
and
xVermillionx
authoredMar 9, 2024
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

Lines changed: 2 additions & 2 deletions
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)
Please sign in to comment.