neovim/test/functional
Sean Dewar a70eae57bd
fix(api): make open_win block only enter/leave events if !enter && !noautocmd
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. :-)
2024-03-08 23:24:04 +00:00
..
api fix(api): make open_win block only enter/leave events if !enter && !noautocmd 2024-03-08 23:24:04 +00:00
autocmd vim-patch:9.1.0158: 'shortmess' "F" flag doesn't work properly with 'autoread' 2024-03-08 07:04:39 +08:00
core fix(process): start pty process eof timer on main thread (#27625) 2024-02-26 09:47:49 +08:00
editor fix(options): don't update curswant for 'winhl' or 'winbl' (#27515) 2024-02-18 18:11:20 +08:00
ex_cmds fix(process): start pty process eof timer on main thread (#27625) 2024-02-26 09:47:49 +08:00
fixtures build: create separate targets for nvim with and without runtime files 2024-01-20 12:59:27 +01:00
legacy vim-patch:9.1.0112: Remove undo information, when cleaning quickfix buffer 2024-02-16 07:18:06 +08:00
lua feat(lsp): add fswatch watchfunc backend 2024-03-01 23:00:20 +00:00
options fix(defaults): make terminal autoclose not block other events (#27581) 2024-02-22 13:54:21 -06:00
plugin test(tohtml_spec): don't use hard-coded sleeping time (#27770) 2024-03-08 10:24:46 +08:00
provider fix(eval): make has('pythonx') work properly (#27739) 2024-03-05 15:54:41 +08:00
script docs(lua): improvements for LSP and Diagnostic 2024-03-05 13:36:46 +00:00
shada test: move format_{string,luav} to a separate module 2024-01-17 10:10:17 +00:00
terminal test(terminal/buffer_spec): re-skip bang test on Windows 2024-02-26 10:11:59 +08:00
treesitter test(treesitter): fix obsolete predicates 2024-02-21 23:10:25 +01:00
ui fix(column): full redraw with 'stc, 'rnu' and inserted lines (#27712) 2024-03-03 08:40:46 +08:00
vimscript refactor(tests): get channel id via nvim_get_chan_info #27441 2024-02-12 05:50:39 -08:00
example_spec.lua test: use integers for API Buffer/Window/Tabpage EXT types 2024-01-16 19:11:49 +00:00
helpers.lua refactor: rewrite ruby provider in lua 2024-01-24 19:26:53 +01:00
preload.lua refactor: format test/* 2024-01-03 02:09:29 +01:00