aboutsummaryrefslogtreecommitdiff
path: root/scripts/lintcommit.lua
diff options
context:
space:
mode:
authorSean Dewar <6256228+seandewar@users.noreply.github.com>2026-03-24 18:25:03 +0000
committerSean Dewar <6256228+seandewar@users.noreply.github.com>2026-03-29 23:49:24 +0100
commit6617f85b76fbd8300683bdf53c5cb5490662b6dd (patch)
treee69d173e08bef292ede5d650303fcab08f70b815 /scripts/lintcommit.lua
parentd539d6ac6e3f382ef094f2d05540e29e4d86da35 (diff)
downloadrneovim-6617f85b76fbd8300683bdf53c5cb5490662b6dd.tar.gz
rneovim-6617f85b76fbd8300683bdf53c5cb5490662b6dd.tar.bz2
rneovim-6617f85b76fbd8300683bdf53c5cb5490662b6dd.zip
vim-patch:9.2.0253: various issues with wrong b_nwindows after closing buffers
Problem: close_buffer() callers incorrectly handle b_nwindows, especially after nasty autocmds, allowing it to go out-of-sync. May lead to buffers that can't be unloaded, or buffers that are prematurely freed whilst displayed. Solution: Modify close_buffer() and review its callers; let them decrement b_nwindows if it didn't unload the buffer. Remove some now unneeded workarounds like 8.2.2354, 9.1.0143, 9.1.0764, which didn't always work (Sean Dewar) (endless yapping omitted) related: vim/vim#19728 https://github.com/vim/vim/commit/bf21df1c7bc772e3a29961c961d0821584d50ee0 b_nwindows = 0 change for free_all_mem() was already ported. Originally Nvim returned true when b_nwindows was decremented before the end was reached (to better indicate the decrement). That's not needed anymore, so just return true only at the end, like Vim. (retval isn't used anywhere now anyways) Set textlock for dict watchers at the end of close_buffer() to prevent them from switching windows, as that can leave a window with a NULL buffer. (possible before this PR, but the new assert catches it; added a test) Despite textlock, things still aren't ideal, as watchers may observe the buffer as unloaded and hidden (b_nwindows was decremented), yet still in a window... Likewise, for Nvim, wipe_qf_buffer()'s comment may not be entirely accurate; autocmds are blocked, but on_detach callbacks (textlocked) and dict watchers may still run. Might be problematic, but those aren't new issues. Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Diffstat (limited to 'scripts/lintcommit.lua')
0 files changed, 0 insertions, 0 deletions