mirror of
https://github.com/neovim/neovim.git
synced 2026-07-31 12:49:11 +00:00
## Flicker cause ui2's `check_targets()` function creates the hidden ui2 windows with this call chain: ``` nvim_open_win() win_set_buf() do_buffer() set_curbuf() enter_buffer() ``` and `enter_buffer()` sets `need_fileinfo`:fdc09be03c/src/nvim/buffer.c (L1837-L1839)This is then picked up by `normal_redraw`:fdc09be03c/src/nvim/normal.c (L1381-L1385)The fileinfo message then causes a ui2 window to appear to display it:fdc09be03c/runtime/lua/vim/_core/ui2/messages.lua (L325-L330)... which ends up calling `set_pos`, which registers an `on_key` handler:fdc09be03c/runtime/lua/vim/_core/ui2/messages.lua (L726-L728)This handler closes the ui2 window when the user presses, for example, `l` (because the user's not focusing said window). The handler eventually calls `check_targets()`:fdc09be03c/runtime/lua/vim/_core/ui2/messages.lua (L594-L595)and `check_targets()` takes us back to the beginning, causing the ui2 window flicker ## Repro ```vim =require("vim._core.ui2").enable() set ch=0 shm-=F ve=all e /tmp/x ``` Then hit `Ctrl-G` to show fileinfo (if not already shown) and hold `l` ## Fix Effectively surround the ui2 window creating with `:silent`