mirror of
https://github.com/neovim/neovim.git
synced 2024-12-26 14:11:15 -07:00
a873f33993
Problem: BufWinEnter is not fired when not entering a new window, even when a different buffer is specified and buffer-related autocommands are unblocked (!noautocmd). Solution: fire it in the context of the new window and buffer. Do not do it if the buffer is unchanged, like :{s}buffer. Be wary of autocommands! For example, it's possible for nvim_win_set_config to be used in an autocommand to move a window to a different tabpage (in contrast, things like wincmd T actually create a *new* window, so it may not have been possible before, meaning other parts of Nvim could assume windows can't do this... I'd be especially cautious of logic that restores curwin and curtab without checking if curwin is still valid in curtab, if any such logic exists). Also, bail early from win_set_buf if setting the temp curwin fails; this shouldn't be possible, as the callers check that wp is valid, but in case that's not true, win_set_buf will no longer continue setting a buffer for the wrong window. Note that pum_create_float_preview also uses win_set_buf, but from a glance, doesn't look like it properly checks for autocmds screwing things up (win_enter, nvim_create_buf...). I haven't addressed that here. Also adds some test coverage for nvim_open_win autocommands. Closes #27121. |
||
---|---|---|
.. | ||
autocmd_spec.lua | ||
buffer_spec.lua | ||
buffer_updates_spec.lua | ||
command_spec.lua | ||
extmark_spec.lua | ||
highlight_spec.lua | ||
keymap_spec.lua | ||
menu_spec.lua | ||
proc_spec.lua | ||
rpc_fixture.lua | ||
server_notifications_spec.lua | ||
server_requests_spec.lua | ||
tabpage_spec.lua | ||
ui_spec.lua | ||
version_spec.lua | ||
vim_spec.lua | ||
window_spec.lua |