neovim/runtime
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
..
autoload vim-patch:8fad5d58874e 2024-02-29 22:54:57 +01:00
colors vim-patch:9.1.0106: Visual highlight hard to read with 'termguicolors' 2024-02-15 10:50:29 +08:00
compiler vim-patch:9.1.0013: Modula2 filetype support lacking (#27020) 2024-01-16 17:45:57 +00:00
doc fix(api): make open_win block only enter/leave events if !enter && !noautocmd 2024-03-08 23:24:04 +00:00
ftplugin vim-patch:e93afc2e6126 2024-03-03 10:38:58 +01:00
indent vim-patch:b4eb3f1e4489 2024-02-29 22:54:57 +01:00
keymap vim-patch:caee7956a21a 2023-11-05 21:56:56 +01:00
lua fix(api): make open_win block only enter/leave events if !enter && !noautocmd 2024-03-08 23:24:04 +00:00
macros vim-patch:79230f027a25 2024-02-16 08:57:45 +01:00
pack/dist/opt vim-patch:9.1.0025: A few typos in tests and justify.vim 2024-01-12 22:24:52 +01:00
plugin fix(tohtml): set filetype of generated HTML to html 2024-02-28 18:34:12 +00:00
queries build(deps): bump tree-sitter-bash to v0.20.5 2024-02-10 14:49:09 +01:00
spell
syntax vim-patch:63c39e4ef749 2024-03-06 10:05:12 +01:00
tools
tutor docs(tutor): include https urls where applicable (#27461) 2024-02-16 20:54:32 +08:00
CMakeLists.txt build: various fixes 2024-02-01 12:06:55 +01:00
delmenu.vim
filetype.lua
ftoff.vim
ftplugin.vim
ftplugof.vim
indent.vim
indoff.vim
macmap.vim
makemenu.vim vim-patch:9.1.0013: Modula2 filetype support lacking (#27020) 2024-01-16 17:45:57 +00:00
menu.vim
mswin.vim vim-patch:d9ebd46bd090 2024-03-04 23:03:09 +01:00
neovim.ico
nvim.appdata.xml docs: add wiki FAQ to the runtime documentation (#26539) 2023-12-13 17:31:39 +01:00
nvim.desktop
nvim.png
optwin.vim
synmenu.vim vim-patch:9.1.0013: Modula2 filetype support lacking (#27020) 2024-01-16 17:45:57 +00:00