From dde476e8508eb014c0785f1cdba57a728259b353 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Sat, 1 Jun 2024 16:31:19 +1000 Subject: [PATCH] refactor(#2787): replace deprecated --- lua/nvim-tree/appearance/diagnostics.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/nvim-tree/appearance/diagnostics.lua b/lua/nvim-tree/appearance/diagnostics.lua index 2922937a..eacef5e9 100644 --- a/lua/nvim-tree/appearance/diagnostics.lua +++ b/lua/nvim-tree/appearance/diagnostics.lua @@ -129,7 +129,12 @@ function M.hi_test() render_displays("other, long", displays_long, bufnr, l) -- finalise and focus the buffer - vim.api.nvim_buf_set_option(bufnr, "modifiable", false) + if vim.fn.has "nvim-0.10" == 1 then + vim.api.nvim_set_option_value("modifiable", false, { buf = bufnr }) + else + vim.api.nvim_buf_set_option(bufnr, "modifiable", false) ---@diagnostic disable-line: deprecated + end + vim.cmd.buffer(bufnr) end