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 7f047dd commit 698cdf7Copy full SHA for 698cdf7
lua/nvim-tree/utils.lua
@@ -226,7 +226,14 @@ function M.rename_loaded_buffers(old_path, new_path)
226
vim.api.nvim_buf_set_name(buf, new_path .. buf_name:sub(#old_path + 1))
227
-- to avoid the 'overwrite existing file' error message on write for
228
-- normal files
229
- if vim.api.nvim_buf_get_option(buf, "buftype") == "" then
+ local buftype
230
+ if vim.fn.has "nvim-0.10" == 1 then
231
+ buftype = vim.api.nvim_get_option_value("buftype", { buf = buf })
232
+ else
233
+ buftype = vim.api.nvim_buf_get_option(buf, "buftype") ---@diagnostic disable-line: deprecated
234
+ end
235
+
236
+ if buftype == "" then
237
vim.api.nvim_buf_call(buf, function()
238
vim.cmd "silent! write!"
239
vim.cmd "edit"
0 commit comments