We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dde476e commit 69f6804Copy full SHA for 69f6804
lua/nvim-tree/actions/node/open-file.lua
@@ -258,7 +258,15 @@ local function open_in_new_window(filename, mode)
258
-- If `hidden` is not enabled, check if buffer in target window is
259
-- modified, and create new split if it is.
260
local target_bufid = vim.api.nvim_win_get_buf(target_winid)
261
- if vim.api.nvim_buf_get_option(target_bufid, "modified") then
+
262
+ local modified
263
+ if vim.fn.has "nvim-0.10" == 1 then
264
+ modified = vim.api.nvim_get_option_value("modified", { buf = target_bufid })
265
+ else
266
+ modified = vim.api.nvim_buf_get_option(target_bufid, "modified") ---@diagnostic disable-line: deprecated
267
+ end
268
269
+ if modified then
270
if not mode:match "split$" then
271
mode = "vsplit"
272
end
0 commit comments