Skip to content

Commit

Permalink
fix(#3009): nvim < 0.10 apply view options locally (#3010)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-courtis authored Nov 24, 2024
1 parent 1f3ffd6 commit ca7c4c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/nvim-tree/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ local function set_window_options_and_buffer()
local eventignore = vim.api.nvim_get_option("eventignore") ---@diagnostic disable-line: deprecated
vim.api.nvim_set_option("eventignore", "all") ---@diagnostic disable-line: deprecated

-- #3009 vim.api.nvim_win_set_option does not set local scope without explicit winid.
-- Revert to opt_local instead of propagating it through for just the 0.10 path.
for k, v in pairs(M.View.winopts) do
vim.api.nvim_win_set_option(0, k, v) ---@diagnostic disable-line: deprecated
vim.opt_local[k] = v
end

vim.api.nvim_set_option("eventignore", eventignore) ---@diagnostic disable-line: deprecated
Expand Down

0 comments on commit ca7c4c3

Please sign in to comment.