nvim-tree.lua
nvim-tree.lua copied to clipboard
NvimTree aligns itself on the right the first time I open a file, but closing and opening the file again fixes it.
Description
Pretty much the title. I have configured NvimTree to start when opening a directory. When started this way, the first time I open a file NvimTree will align itself on the right side of the screen for some reason. Closing the file and opening it again will correctly re-align NvimTree on the left side.
Neovim version
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Operating system and version
5.19.2-arch1-1
nvim-tree version
e3353c4
Minimal config
-- PLUGINS
local Plug = vim.fn['plug#']
vim.call('plug#begin', '~/.config/nvim/plugged')
Plug 'kyazdani42/nvim-tree.lua'
vim.call('plug#end')
-- NVIM TREE CONFIG
require("nvim-tree").setup({
sort_by = "name",
open_on_setup = true,
hijack_cursor = true,
view = {
side = "left",
width = 20,
mappings = {
list = {
{ key = "-", action = "dir_up" },
{key = "+", action = "cd"}
},
},
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
})
Steps to reproduce
- Open Nvim with a directory as a target.
- NvimTree will open in fullscreen mode as normal
- Choose a file and open it by pressing enter
- NvimTree will be positioned on the right side of the screen while the file will be opened on the left side
- Close the file with :q
- Now open it back again in the same way
- Now the file is on the right side while NvimTree is on the left, as it should
Expected behavior
NvimTree should be aligned to the left side the first time it is opened.
Actual behavior
No response
Confirmed
same issue
Same on macOS 12.5.1
confirmed on Neovim 0.7.2
Same on macOS 12.0.1 (macOS Monterey) NVIM v0.7.2
Same issue on Linux using Neovim
Same issue on Linux(Ubuntu 22.04) NVIM v0.7.2
Same issue on neovim on MacOS Ventura 13.0
fix branch: 1553-wrong-align-on-open-dir
PR: #1594
I would be very grateful if this fix were tested:
cd /path/to/nvim-tree.lua
git pull
git checkout 1553-wrong-align-on-open-dir
Checkout master when you are finished testing.;q
@alex-courtis It works! Thank you!
@alex-courtis thank you !! waiting for the master branch , #1594 fixed this.