Skip to content

Commit 7f047dd

Browse files
committed
refactor(#2787): replace deprecated
1 parent a5f1b86 commit 7f047dd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lua/nvim-tree/actions/finders/search-node.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,17 @@ function M.fn()
8585
end
8686
-- reset &path
8787
if path_existed then
88-
vim.api.nvim_buf_set_option(bufnr, "path", path_opt)
88+
if vim.fn.has "nvim-0.10" == 1 then
89+
vim.api.nvim_set_option_value("path", path_opt, { buf = bufnr })
90+
else
91+
vim.api.nvim_buf_set_option(bufnr, "path", path_opt) ---@diagnostic disable-line: deprecated
92+
end
8993
else
90-
vim.api.nvim_buf_set_option(bufnr, "path", nil)
94+
if vim.fn.has "nvim-0.10" == 1 then
95+
vim.api.nvim_set_option_value("path", nil, { buf = bufnr })
96+
else
97+
vim.api.nvim_buf_set_option(bufnr, "path", nil) ---@diagnostic disable-line: deprecated
98+
end
9199
end
92100

93101
-- strip trailing slash

0 commit comments

Comments
 (0)