Skip to content

Commit 2dfef91

Browse files
0ax1claude
andcommitted
fix: eliminate flicker when opening tree window
Suppress events during the open+reposition to prevent intermediate redraws. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 31503ad commit 2dfef91

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lua/nvim-tree/view.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,14 @@ local function open_window()
121121
if config.g.view.float.enable then
122122
vim.api.nvim_open_win(0, true, open_win_config())
123123
else
124-
vim.api.nvim_command("vsp")
124+
local ei = vim.o.eventignore
125+
vim.o.eventignore = "all"
126+
vim.api.nvim_open_win(M.get_bufnr(), true, {
127+
split = config.g.view.side or "left",
128+
width = view_state.get_width(),
129+
})
125130
M.reposition_window()
131+
vim.o.eventignore = ei
126132
end
127133
setup_tabpage(vim.api.nvim_get_current_tabpage())
128134
set_window_options_and_buffer()

0 commit comments

Comments
 (0)