-
-
Notifications
You must be signed in to change notification settings - Fork 619
nvim-tree buffer options applied to entire window #3009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
0.10 working as expected Changing to: local function set_window_options_and_buffer()
pcall(vim.api.nvim_command, "buffer " .. M.get_bufnr())
if vim.fn.has("nvim-0.10") ~= 1 then Replicates the issue. |
Many thanks for raising this @arjan-bal
You're right - revert is just fine for the older code path. See comments in PR: https://github.com/nvim-tree/nvim-tree.lua/pull/3010/files#diff-daa2785203fb370deedccd5b5c910812d0069024b341af2bb770f14e4f712fc9 |
@arjan-bal I'd be most grateful if you thoroughly tested a fix branch cd /path/to/nvim-tree.lua
git pull
git checkout 3009-nvim-0-9-view-winopts-applied-globally When you're finished testing: git checkout master |
@alex-courtis #3010 fixes the issue, thanks! |
Many thanks @arjan-bal ! |
Description
I have set settings like
relativenumber
,number
andcolorcolumn
in my vimrc which is sourced in myinit.lua
. After updating nvim-tree, I found that these settings were getting overridden by the plugin. I was able to trace the behaviour change to #2968 which introduced the following linesnvim-tree.lua/lua/nvim-tree/view.lua
Lines 167 to 169 in 1f3ffd6
Before this change, the lines were
nvim-tree.lua/lua/nvim-tree/view.lua
Lines 150 to 152 in d41b4ca
The reason for the behaviour change seems to be that
vim.opt_local
was applying the settings only to the current buffer whilevim.api.nvim_win_set_option
is applying the settings to the entire window.From my understanding, the benefit of using
vim.api.nvim_win_set_option
is to support earlier versions of nvim. I'm not familiar with lua or the nvim API, so I don't know the exact fix if the code can't be reverted to usevim.opt_local
.Neovim version
Operating system and version
Debian
Windows variant
No response
nvim-tree version
v1.7
Clean room replication
Steps to reproduce
Expected behavior
the
colorcolumn
at col 80 should show up. It does so up tillnvim-tree
v1.6.1Actual behavior
You will see that the
colorcolumn
is not visible.The text was updated successfully, but these errors were encountered: