mirror of
https://github.com/neovim/neovim.git
synced 2024-12-25 21:55:17 -07:00
a70eae57bd
Problem: nvim_open_win blocking all win_set_buf autocommands when !enter && !noautocmd is too aggressive. Solution: temporarily block WinEnter/Leave and BufEnter/Leave events when setting the buffer. Delegate the firing of BufWinEnter back to win_set_buf, which also has the advantage of keeping the timing consistent (e.g: before the epilogue in enter_buffer, which also handles restoring the cursor position if autocommands didn't change it, among other things). Reword the documentation for noautocmd a bit. I pondered modifying do_buffer and callees to allow for BufEnter/Leave being conditionally disabled, but it seems too invasive (and potentially error-prone, especially if new code paths to BufEnter/Leave are added in the future). Unfortunately, doing this has the drawback of blocking ALL such events for the duration, which also means blocking unrelated such events; like if window switching occurs in a ++nested autocmd fired by win_set_buf. If this turns out to be a problem in practice, a different solution specialized for nvim_open_win could be considered. :-) |
||
---|---|---|
.. | ||
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 |