Skip to content

Commit 02ae523

Browse files
authored
fix: hijack_cursor on update focused file and vim search (#2600)
refactor: hijack_cursor search skip
1 parent 96a783f commit 02ae523

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lua/nvim-tree.lua

+2-4
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,11 @@ function M.reset_highlight()
112112
renderer.render_hl(view.get_bufnr())
113113
end
114114

115-
local prev_line
116115
function M.place_cursor_on_node()
117-
local l = vim.api.nvim_win_get_cursor(0)[1]
118-
if l == prev_line then
116+
local search = vim.fn.searchcount()
117+
if search and search.exact_match == 1 then
119118
return
120119
end
121-
prev_line = l
122120

123121
local node = lib.get_node_at_cursor()
124122
if not node or node.name == ".." then

0 commit comments

Comments
 (0)