diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2026-01-06 16:42:17 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-06 16:42:17 +0800 |
| commit | 23aa4853b3fd3b02d5431fadeba52d97e532f53c (patch) | |
| tree | e5e4ee7525a08d52c069eeb42ae2a7337f42288d /runtime/lua/vim/loader.lua | |
| parent | 8b7accd07e462dc6efd688fa18cb46ebb0325a67 (diff) | |
| download | rneovim-23aa4853b3fd3b02d5431fadeba52d97e532f53c.tar.gz rneovim-23aa4853b3fd3b02d5431fadeba52d97e532f53c.tar.bz2 rneovim-23aa4853b3fd3b02d5431fadeba52d97e532f53c.zip | |
fix(buffer): don't reuse 1-line terminal buffer (#37261)
Problem: :edit and :enew may reuse a 1-line terminal buffer, causing
the new buffer to still be a terminal buffer.
Solution: Don't reuse a terminal buffer, as it's not reused when it has
more than 1 line.
After this change close_buffer() is the only place where buf_freeall()
can be called on a terminal buffer, so move the buf_close_terminal()
call into buf_freeall() to save some code. Furthermore, closing the
terminal in buf_freeall() is probably more correct anyway, as it is
"things allocated for a buffer that are related to the file".
Also, remove the useless check for on_detach callbacks deleting buffer.
Even if b_locked fails to prevent that, the crash will happen at the end
of buf_updates_unload() first. On the other hand, many other call sites
of buf_updates_unload() and other buffer_updates_* functions don't set
b_locked, which may be a problem as well...
Diffstat (limited to 'runtime/lua/vim/loader.lua')
0 files changed, 0 insertions, 0 deletions