fix: hijack_cursor on update focused file and vim search (#2600)

refactor: hijack_cursor search skip
This commit is contained in:
geril2207 2023-12-31 06:40:58 +03:00 committed by GitHub
parent 96a783fbd6
commit 02ae52357b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,13 +112,11 @@ function M.reset_highlight()
renderer.render_hl(view.get_bufnr()) renderer.render_hl(view.get_bufnr())
end end
local prev_line
function M.place_cursor_on_node() function M.place_cursor_on_node()
local l = vim.api.nvim_win_get_cursor(0)[1] local search = vim.fn.searchcount()
if l == prev_line then if search and search.exact_match == 1 then
return return
end end
prev_line = l
local node = lib.get_node_at_cursor() local node = lib.get_node_at_cursor()
if not node or node.name == ".." then if not node or node.name == ".." then