Skip to content

Commit 8cf3e60

Browse files
committed
refactor(#2787): replace deprecated
1 parent 69f6804 commit 8cf3e60

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lua/nvim-tree/actions/node/open-file.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@ local function usable_win_ids()
2626
return vim.tbl_filter(function(id)
2727
local bufid = vim.api.nvim_win_get_buf(id)
2828
for option, v in pairs(M.window_picker.exclude) do
29-
local ok, option_value = pcall(vim.api.nvim_buf_get_option, bufid, option)
29+
local ok, option_value
30+
if vim.fn.has "nvim-0.10" == 1 then
31+
ok, option_value = pcall(vim.api.nvim_get_option_value, option, { buf = bufid })
32+
else
33+
ok, option_value = pcall(vim.api.nvim_buf_get_option, bufid, option) ---@diagnostic disable-line: deprecated
34+
end
35+
3036
if ok and vim.tbl_contains(v, option_value) then
3137
return false
3238
end

0 commit comments

Comments
 (0)