From 7f047ddadb7f56a7e7ea080d1d5a92feda26b275 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Sat, 1 Jun 2024 16:23:16 +1000 Subject: [PATCH] refactor(#2787): replace deprecated --- lua/nvim-tree/actions/finders/search-node.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lua/nvim-tree/actions/finders/search-node.lua b/lua/nvim-tree/actions/finders/search-node.lua index 9e8a45fb..5e3b612d 100644 --- a/lua/nvim-tree/actions/finders/search-node.lua +++ b/lua/nvim-tree/actions/finders/search-node.lua @@ -85,9 +85,17 @@ function M.fn() end -- reset &path if path_existed then - vim.api.nvim_buf_set_option(bufnr, "path", path_opt) + if vim.fn.has "nvim-0.10" == 1 then + vim.api.nvim_set_option_value("path", path_opt, { buf = bufnr }) + else + vim.api.nvim_buf_set_option(bufnr, "path", path_opt) ---@diagnostic disable-line: deprecated + end else - vim.api.nvim_buf_set_option(bufnr, "path", nil) + if vim.fn.has "nvim-0.10" == 1 then + vim.api.nvim_set_option_value("path", nil, { buf = bufnr }) + else + vim.api.nvim_buf_set_option(bufnr, "path", nil) ---@diagnostic disable-line: deprecated + end end -- strip trailing slash