fix: leave the cursor moving when going on the cwd

This commit is contained in:
kiyan
2021-06-05 10:53:04 +02:00
parent 8cf639c821
commit f56ac7884c

View File

@@ -196,7 +196,7 @@ end
function M.place_cursor_on_node() function M.place_cursor_on_node()
local node = lib.get_node_at_cursor() local node = lib.get_node_at_cursor()
if not node then return end if not node or node.name == ".." then return end
local line = api.nvim_get_current_line() local line = api.nvim_get_current_line()
local cursor = api.nvim_win_get_cursor(0) local cursor = api.nvim_win_get_cursor(0)
local idx = vim.fn.stridx(line, node.name) local idx = vim.fn.stridx(line, node.name)