From 02ae52357ba4da77a4c120390791584a81d15340 Mon Sep 17 00:00:00 2001 From: geril2207 <62308020+geril2207@users.noreply.github.com> Date: Sun, 31 Dec 2023 06:40:58 +0300 Subject: [PATCH] fix: hijack_cursor on update focused file and vim search (#2600) refactor: hijack_cursor search skip --- lua/nvim-tree.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lua/nvim-tree.lua b/lua/nvim-tree.lua index ead71c33..3016ec9c 100644 --- a/lua/nvim-tree.lua +++ b/lua/nvim-tree.lua @@ -112,13 +112,11 @@ function M.reset_highlight() renderer.render_hl(view.get_bufnr()) end -local prev_line function M.place_cursor_on_node() - local l = vim.api.nvim_win_get_cursor(0)[1] - if l == prev_line then + local search = vim.fn.searchcount() + if search and search.exact_match == 1 then return end - prev_line = l local node = lib.get_node_at_cursor() if not node or node.name == ".." then