32803 Commits

Author SHA1 Message Date
Justin M. Keyes
e8b87a554f NVIM v0.11.6
Following is a list of fix/feature commits in this release.
See `:help news` in Nvim for release notes.

FEATURES
--------------------------------------------------------------------------------
- b92e92b20d lsp: support auto-force escalation in client stop #36430
- 808d973fb0 lsp: warn about unknown filetype #36910

FIXES
--------------------------------------------------------------------------------
- 5e7af0ba01 :ls: check for finished terminal properly (#37303)
- 6ce7b9b851 api: autocmds mess up nvim_get_option_value's dummy buffer
- c124594b22 api: buffer overflow in nvim_buf_get_extmarks overlap #37184
- 7f51431c12 api: crash when moving curwin to other tabpage #35679
- 7896fe2dea api: do not allow opening float to closing buffer
- 91ebbc6c4e api: ignore split_disallowed when opening a float
- 10a1df2789 api: nvim_get_option_value dummy buffer crashes
- da825e5541 api: on_bytes gets stale data on :substitute #36487
- a9ffdca528 api: open_win leak from naughty autocommands
- 92849eacff api: parse_expression crash with ident and curly
- 1db945b584 api: parse_expression crash with unopened ] and node
- 79b67ce331 appimage: wrong $ARCH used by linuxdeploy #36712
- 46011a4e87 autocmd: fire TabClosed after freeing tab page
- a512d43716 autocmd: heap UAF with :bwipe in Syntax autocmd
- bea500dbeb autocmd: parsing of comma-separated buflocal patterns
- 648cf4e586 autocmd: skip empty comma-separated patterns properly
- fa24e045e9 buffer: defer w_buffer clearing to prevent dict watcher crash #36748
- 9fb49aacde buffer: don't allow changedtick watcher to delete buffer (#36764)
- cae3c838a7 buffer: don't reuse 1-line terminal buffer (#37261)
- 6f84ea7c66 buffer: switching buffer should respect jumpoptions+=view (#36969)
- 16ca7ceaed build: disable problematic marktree assert in RelWithDebInfo builds
- c469cba162 channel: unreference list after callback finishes (#37358)
- 43f5297fe3 clipboard: tmux clipboard data may be stale #36787
- 0358f37e3d clipboard: use tmux only in a tmux session (#36603)
- 7e99466a89 eval: 0 should mean current tabpage in gettabvar() (#36891)
- 656ff4c438 events: crash on WinScrolled #35995
- 63c5a101af install: only install "tee" on Windows #36629
- e8c21a8b51 langmap: assert failure on mapping to char >= 256 (#37291)
- 890c257194 lsp: check `nvim.lsp.enable` before `doautoall` #36518
- 275c769f01 lua: don't remove first char of non-file stacktrace source (#37008)
- 83c589d95f lua: relax `vim.wait()` timeout validation (#36907)
- bd2317f17f lua: separate vim.{g,b,w,t} types #37081
- f21c169a02 lua: vim._with() doesn't save boolean options properly (#37354)
- 9acbf5102f lua: vim.wait(math.huge) fails #36885
- 5143419e22 man.lua: :Man slow/hangs if MANPAGER is set #36689
- df9452ea9e man.lua: show_toc condition may cause infinite loop #36979
- 124c18261c marks: wrong line('w$', win) with conceal_lines (#37047)
- 6ef1b655fe normal: assertion failure with "gk" in narrow window (#37444)
- 5ca2eb5e48 remote: remote-ui connect timeout on slow networks #36800
- 2a3cd8dc80 rpc: don't overwrite already received results on error (#37339)
- e0fdfd3d4b scripts: release.sh
- ba600c495f session: window sizes not stored with float windows (#37344)
- 53090ab6a8 statusline: scope truncation bookkeeping
- 800118e204 terminal: :edit should respect 'bufhidden' with exited job (#37301)
- 4b41c284ed terminal: <Ignore> should be no-op (#37494)
- 074d342f63 terminal: avoid multiple terminals writing to same buffer (#37219)
- 2cc78732fc terminal: crash when TermClose deletes other buffers
- ea871923eb terminal: crash when TermClose switches back to terminal buffer
- ceed171485 terminal: crash with race between buffer close and OSC 2 (#37225)
- acc46e1dd7 terminal: handle closing terminal with pending TermRequest (#37227)
- bb31e7b345 terminal: inconsistent mode change when switching buffer (#37215)
- 40c974e689 terminal: restore options properly when switching buffer (#37485)
- 46f569a890 treesitter: use metadata in :EditQuery captures #37116
- 076f7994be trust: :trust command on Windows #36509
- d997c8e344 tutor: escape tutor filename #36539
- fcd0517dee ui.open: use "start" instead of deprecated "rundll32" #36731
- 6a507bad18 vim.fs: abspath(".") returns "/…/." (#36584)
- d974c684da vim.fs: root() should always return absolute path #36466
- 91fd4d127e vim.loader: randomized AppImage path pollutes luac cache #35636
- 45cda1bcf4 vim.loader: randomized AppImage path pollutes luac cache #36944
- d9631c7678 window: crash closing only non-float if autocmds :tabonly (#37218)
- f7e2554bfb window: crash closing split if autocmds close other splits (#37233)
- 7a9bced071 window: disallow closing autocmd window in other tabpage
- 88619e1aaf window: handle closing the only non-float in other tabpage
- d38ba7e2b8 window: restore b_nwindows if win_close_othertab keeps window
- 6338d2d54b window: win_move_after UAF from naughty autocmds (#37065)
- fac7c10eb8 windows: set manifest resource ID to 1 in nvim.rc for MinGW (#36611)

BUILD
--------------------------------------------------------------------------------
- d0ed06dcea haiku os support #36639
- a94647bb08 build(windows): restore "tee" on Windows #36627
- 1f93acc293 build(windows): vendor xxd.c (#36755)

REVERTED CHANGES
--------------------------------------------------------------------------------
- ae25f6942e fix: vim.lsp.omnifunc should not throw away other items

VIM PATCHES
--------------------------------------------------------------------------------
- b3eab00e55 229f79c: runtime(yaml): fix wrong order of undo_ftplugin suboptions
- 89f8e97099 3a324c8: runtime(doc): Fix typo in syntax.txt (#37522)
- d1cd79a4b6 64799a5: runtime(doc): clarify the behavior of CTRL-Z
- 0978d83c6e 7bc9880: runtime(make): do not automatically indent after a special target
- 781da755e8 8.1.0753: printf format not checked for semsg() (#37248)
- 44eae48b75 9.1.0893: No test that undofile format does not regress (#37193)
- 9a50420461 9.1.1872: Cmdline history not updated when mapping <Up> and <CR> (#36334)
- d1604e0f38 9.1.1969: Wrong cursor position after formatting with long 'formatprg' (#36918)
- fda8d2c717 9.1.2028: [security]: Buffer-overflow with incomplete multi-byte chars (#37133)
- f96e401b7e 9.1.2055: Division by zero in :file after failing to wipe buffer (#37268)
- f8961c3878 9.1.2058: b_locked_split is not checked for :sbuffer
- 9f2b991331 9.1.2066: :wqall! doesn't close a terminal like :qall! does (#37314)
- b1fa8f1430 9.1.2068: :bd/bw may try to switch to a closing buffer
- 600d9f35a4 9.1.2086: Memory leak when skipping invalid literal dict
- 0cc15be15d 9.1.2087: Crash when using :tabonly in BufUnload
- d052d22979 9.1.2090: Last buffer not freed with EXITFREE
- 537e8d69f8 9.1.2095: :wqall! doesn't quit when using :quit in BufWritePost
- 0b1f5a1d60 9.1.2105: tests: not enough tests for using plain_vgetc() (#37521)
- 0da1e4b1c5 9.1.2107: :normal may change cmdline history (#37523)
- a66fce6fab 98a0cbf: patch 9.1.1971: crash with invalid positional argument 0 in printf() (#36919)
- 85404d18fe eb732ed: runtime(doc): Wrap overlength lines in uganda.txt (#36550)
- a93b5a7104 fe8c8b1: runtime(doc): fix outdated :function help
- 0706c55ab1 partial:9.1.1955: sort() does not handle large numbers correctly (#36840)
stable v0.11.6
2026-01-26 16:27:53 +01:00
glepnir
1772203187 docs: nvim_set_hl fg_index, bg_indexed #37534
(cherry picked from commit 543e14d040)
2026-01-26 14:06:34 +00:00
zeertzjq
0da1e4b1c5 vim-patch:9.1.2107: :normal may change cmdline history (#37523)
Problem:  :normal may change cmdline history if the keys don't
          explicitly leave Cmdline mode (after 9.1.1872).
Solution: Check ex_normal_busy (zeertzjq)

closes: vim/vim#19237

85241020e8
(cherry picked from commit f10a1dcf4d)
2026-01-24 01:47:39 +00:00
zeertzjq
0b1f5a1d60 vim-patch:9.1.2105: tests: not enough tests for using plain_vgetc() (#37521)
Problem:  Not enough tests for using plain_vgetc().
Solution: Add tests for using plain_vgetc() during various commands.
          (zeertzjq)

closes: vim/vim#19236

2b6bdbc697
(cherry picked from commit e0b724de09)
2026-01-24 00:59:54 +00:00
zeertzjq
89f8e97099 vim-patch:3a324c8: runtime(doc): Fix typo in syntax.txt (#37522)
closes: vim/vim#19239

3a324c83ab

Co-authored-by: Antoine Saez Dumas <antoine.saezdumas.git@gmail.com>
(cherry picked from commit 7daf8d2363)
2026-01-24 00:21:51 +00:00
zeertzjq
9a50420461 vim-patch:9.1.1872: Cmdline history not updated when mapping <Up> and <CR> (#36334)
Problem:  Cmdline history not updated when mapping both <Up> and <CR>.
Solution: Consider the command typed when in Cmdline mode and there is
          no pending input (zeertzjq).

Although the existing behavior technically does match documentation, the
"completely come from mappings" part is a bit ambiguous, because one may
argue that the command doesn't completely come from mappings as long as
the user has typed a key in Cmdline mode.  I'm not entirely sure if this
change will cause problems, but it seems unlikely.

fixes: vim/vim#2771
related: neovim/neovim#36256
closes: vim/vim#18607

97b6e8b424
(cherry picked from commit 2407833ba1)
2026-01-23 23:54:40 +00:00
zeertzjq
4b41c284ed fix(terminal): <Ignore> should be no-op (#37494)
(cherry picked from commit 196df35cca)
2026-01-22 01:58:47 +00:00
zeertzjq
40c974e689 fix(terminal): restore options properly when switching buffer (#37485)
(cherry picked from commit 25ce44845d)
2026-01-21 11:19:30 +00:00
zeertzjq
9ba985c250 test: add tests for #14379 2026-01-20 07:39:21 +08:00
zeertzjq
537e8d69f8 vim-patch:9.1.2095: :wqall! doesn't quit when using :quit in BufWritePost
Problem:  :wqall! doesn't quit when using :quit in BufWritePost
          (after 8.0.1190).
Solution: Restore old value of "exiting" when calling not_exiting()
          instead of always resetting it to FALSE (zeertzjq).

related: vim/vim#2205
closes:  vim/vim#19212

e803ad1c56
2026-01-20 07:39:21 +08:00
Emanuel Krollmann
a512d43716 fix(autocmd): heap UAF with :bwipe in Syntax autocmd
Problem:
Creating an autocommand which executes `:bwipe` on the Syntax event
causes a heap-use-after-free.

Solution: set BF_SYN_SET flag before applying autocommands
(cherry picked from commit f36dd7557a)
2026-01-18 18:23:15 +00:00
zeertzjq
6ef1b655fe fix(normal): assertion failure with "gk" in narrow window (#37444)
When width1 and width2 are negative the assertion may fail. It seems
that adding a negative value to w_curswant won't cause any problems, so
just change the assertion.

(cherry picked from commit 41068c77aa)
2026-01-18 04:10:59 +00:00
Sean Dewar
1db945b584 fix(api): parse_expression crash with unopened ] and node
Problem: nvim_parse_expression null pointer dereference with unmatched ]
followed by a node.

Solution: if ast_stack was empty, set new_top_node_p to top of the stack after
pushing the list literal node; similar to what's done for curlies.

This bug was originally found by a Matrix user, but I couldn't remember how to
trigger it... Ran into the other crash while finding a repro. :P

(cherry picked from commit a5e5ec8910)
2026-01-17 13:48:49 +00:00
Sean Dewar
92849eacff fix(api): parse_expression crash with ident and curly
Problem: nvim_parse_expression null pointer dereference when parsing an
identifier followed by { with "highlight" parameter set to false.

Solution: only set opening_hl_idx if pstate->colors is not NULL.

Not added to parser_tests.lua as that uses highlight = true.

(cherry picked from commit 5226801be2)
2026-01-17 13:48:49 +00:00
zeertzjq
d052d22979 vim-patch:9.1.2090: Last buffer not freed with EXITFREE
Problem:  Last buffer not freed with EXITFREE (after 9.1.2087).
Solution: Free the last buffer when inside free_all_mem()
          (zeertzjq).

This isn't really a memory leak, as the last buffer's memory is still
reachable via pointers like firstbuf and lastbuf. But it's possible that
this may cause false ASAN warnings in the future, which is what EXITFREE
is supposed to prevent.

closes: vim/vim#19194

6c118afeaa
(cherry picked from commit 960cba7b3b)
2026-01-17 11:40:16 +00:00
zeertzjq
0cc15be15d vim-patch:9.1.2087: Crash when using :tabonly in BufUnload
Problem:  Crash when using :tabonly in BufUnload.
Solution: Set curbuf when setting curwin->w_buffer. Don't wipe out a
          buffer if there are no other buffers. Don't decrement
          b_nwindows if it was 0 before buf_freeall() (zeertzjq).

fixes:  vim/vim#19088#issuecomment-3710172769
closes: vim/vim#19186

fa64f92f6a
(cherry picked from commit eb5a7cc0dd)
2026-01-17 11:40:16 +00:00
zeertzjq
1e001b5c8d test: remove duplicate test (#37434)
This test is a copy of Test_bufunload_all() and requires too much
additional cleanup for the Windows log message.

(cherry picked from commit 8754118213)
2026-01-17 01:36:45 +00:00
Sean Dewar
600d9f35a4 vim-patch:9.1.2086: Memory leak when skipping invalid literal dict
Problem:  memory leak when not evaluating (just parsing) invalid literal
          dict.
Solution: Always clear the key's typval (Sean Dewar)

Though "check_typval_is_value(&tv) == FAIL && !evaluate" is maybe never
true, also always clear tvs if check_typval_is_value fails; at worst
this would be a no-op as their initial types are VAR_UNKNOWN.

closes: vim/vim#19178

b10a3e1a20

check_typval_is_value change is for Vim9 script. (from 9.0.2163)

N/A patch:
vim-patch:9.0.2163: Vim9: type can be assigned to list/dict

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
(cherry picked from commit ba1d50fdc3)
2026-01-16 00:02:51 +00:00
Sean Dewar
10a1df2789 fix(api): nvim_get_option_value dummy buffer crashes
Problem: nvim_get_option_value with "filetype" set can crash if autocommands
open the dummy buffer in more windows, or if &bufhidden == "wipe".

Solution: Attempt to close all dummy buffer windows before wiping. Promote the
dummy buffer to a normal buffer if that fails.

(cherry picked from commit 7e2e116343)
2026-01-15 23:19:44 +00:00
Sean Dewar
b0f341feea refactor: remove dead code, adjust comment
Removed code doesn't seem to do anything? Looks like a clobbered remnant from
when do_filetype_autocmd lived in did_set_string_option.

Doc comment for wipe_buffer doesn't decrement top_file_num since a2d25b7 (2016),
which presumably means the comment on marks doesn't apply either. (fmark_T::fnum
can't refer to the wrong buffer as numbers aren't reused here anymore)

(cherry picked from commit 40114d1631)
2026-01-15 23:19:44 +00:00
Sean Dewar
6ce7b9b851 fix(api): autocmds mess up nvim_get_option_value's dummy buffer
Problem: When the "filetype" key is set for nvim_get_option_value, autocommands
can crash Nvim by prematurely wiping the dummy buffer, or cause options intended
for it to instead be set for unrelated buffers if switched during OptionSet.

Solution: Don't crash. Also quash side-effects from setting the buffer options.
(cherry picked from commit 3cb462a960)
2026-01-15 23:19:44 +00:00
zeertzjq
b4cd55df15 refactor(event/stream.c): fix confusing indent (#37398)
(cherry picked from commit 896968cad1)
2026-01-15 01:20:39 +00:00
zeertzjq
617a2f4061 Merge pull request #37367 from zeertzjq/backport
fix(channel): unreference list after callback finishes (#37358)
2026-01-12 09:11:57 +08:00
zeertzjq
c469cba162 fix(channel): unreference list after callback finishes (#37358) 2026-01-12 08:36:14 +08:00
zeertzjq
f21c169a02 fix(lua): vim._with() doesn't save boolean options properly (#37354)
Problem:  vim._with() doesn't save boolean options with false values
          properly.
Solution: Use vim.F.if_nil().
(cherry picked from commit 94144d4678)
2026-01-11 12:30:12 +00:00
zeertzjq
2a3cd8dc80 fix(rpc): don't overwrite already received results on error (#37339)
This fixes a regression from cf6f60ce4d
(possibly), as before that commit a frame is popped from the call stack
immediately after its response is received.

Also fix leaking the allocated error messages.

(cherry picked from commit 39d8aa0a1a)
2026-01-11 10:49:03 +00:00
zeertzjq
ba600c495f fix(session): window sizes not stored with float windows (#37344)
(cherry picked from commit 2d3dc070ce)
2026-01-10 15:15:48 +00:00
zeertzjq
1b13864d97 test(server_notifications_spec): improve chanclose test (#37337)
Check that a pending event is actually cancelled, in place of the
nvim_subscribe that was removed in #28487.

(cherry picked from commit cb77bd1b86)
2026-01-10 04:37:36 +00:00
zeertzjq
9e21befb32 Merge pull request #37335 from zeertzjq/backport
fix(terminal): :edit should respect 'bufhidden' with exited job (#37301)
2026-01-10 08:54:31 +08:00
zeertzjq
800118e204 fix(terminal): :edit should respect 'bufhidden' with exited job (#37301) 2026-01-10 08:26:45 +08:00
zeertzjq
2c9f1317de refactor(fileio.c): avoid downcasting in {read,write}_eintr() (#37323)
(cherry picked from commit 272ec9627c)
2026-01-09 08:35:55 +00:00
zeertzjq
5e7af0ba01 fix(:ls): check for finished terminal properly (#37303)
Use terminal_running() instead of channel_job_running().

(cherry picked from commit 49d7f694a8)
2026-01-09 02:22:20 +00:00
zeertzjq
9f2b991331 vim-patch:9.1.2066: :wqall! doesn't close a terminal like :qall! does (#37314)
Problem:  :wqall! doesn't close a terminal buffer like :qall! does
          (after 8.0.1525).
Solution: Check eap->forceit (zeertzjq).

Ref: https://github.com/vim/vim/issues/2654#issuecomment-366803932

related: vim/vim#2654
related: neovim/neovim#14061
closes:  vim/vim#19129

d8558fdf4f
(cherry picked from commit 681d006549)
2026-01-09 00:15:54 +00:00
zeertzjq
781da755e8 vim-patch:8.1.0753: printf format not checked for semsg() (#37248)
Problem:    printf format not checked for semsg().
Solution:   Add GNUC attribute and fix reported problems. (Dominique Pelle,
            closes vim/vim#3805)

b5443cc46d

Cherry-pick a change from patch 8.2.3830.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit ef522420f2)
2026-01-08 23:17:15 +00:00
Sean Dewar
b1fa8f1430 vim-patch:9.1.2068: :bd/bw may try to switch to a closing buffer
Problem:  :bdelete/bunload/bwipeout may attempt to switch to a closing
          buffer, which fails. (after 9.1.2058)
Solution: don't consider switching to closing buffers (Sean Dewar)

closes: vim/vim#19107

63d53de72d

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
(cherry picked from commit e002e4d7fc)
2026-01-08 23:08:32 +00:00
Sean Dewar
f8961c3878 vim-patch:9.1.2058: b_locked_split is not checked for :sbuffer
Problem:  b_locked_split is not checked for :sbuffer, which allows
          autocommands to leave windows open to freed buffers.
Solution: In do_buffer_ext, check just before possibly splitting, after
          handling 'switchbuf'. Leave win_split to handle the check for
          curbuf. (needed even if curbuf is not the target, as setting
          the buffer after splitting may fail) (Sean Dewar)

closes: vim/vim#19096

ac5c8ab6cc

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
(cherry picked from commit 5f871007d7)
2026-01-08 23:08:32 +00:00
zeertzjq
ad70c2300e test(terminal/buffer_spec): fix flaky test (#37299)
It turns out that uv_write() doesn't queue the write if there are no
pending writes, so vim.uv.run() isn't needed to reproduce the crash.

(cherry picked from commit 0bd4d3f779)
2026-01-08 03:01:10 +00:00
zeertzjq
4f0e5678f3 test(buffer_updates_spec): move on_detach tests to its block (#37297)
(cherry picked from commit bfb70c03ff)
2026-01-08 02:30:29 +00:00
zeertzjq
e8c21a8b51 fix(langmap): assert failure on mapping to char >= 256 (#37291)
Usually 'langmap' is used to map keyboard characters to ASCII motions or
mappings. It's not entirely clear what the purpose of mapping to Unicode
characters is, but since there is no error for mapping between two chars
both >= 256, only give a warning that this will not work properly when
mapping from a char < 256 to a char >= 256.

(cherry picked from commit 16c1334399)
2026-01-08 01:15:01 +00:00
zeertzjq
1c0b0b3522 refactor: fix using %*s instead of %.*s (#37290)
`%*s` specifies the width limit, not the number of bytes.
In these places it doesn't matter as they are ASCII-only.

(cherry picked from commit 89960e27d6)
2026-01-08 00:32:59 +00:00
zeertzjq
f96e401b7e vim-patch:9.1.2055: Division by zero in :file after failing to wipe buffer (#37268)
Problem:  Division by zero in :file after failing to wipe buffer
          (after 8.2.4631).
Solution: Still call buf_clear_file() when failing to wipe buffer
          (zeertzjq).

closes: vim/vim#19088

1aa5ca4ecb
(cherry picked from commit 97bfc0c99b)
2026-01-06 12:41:49 +00:00
zeertzjq
cae3c838a7 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...

(cherry picked from commit 23aa4853b3)
2026-01-06 09:09:23 +00:00
zeertzjq
ea871923eb fix(terminal): crash when TermClose switches back to terminal buffer
Problem:  Crash when deleting terminal buffer and TermClose switches
          back to the terminal buffer.
Solution: Set b_locked_split.

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
(cherry picked from commit ad85871ca1)
2026-01-05 23:53:27 +00:00
zeertzjq
2cc78732fc fix(terminal): crash when TermClose deletes other buffers
Problem:  Crash when deleting terminal buffer and TermClose deletes
          other buffers.
Solution: Close the terminal after restoring b_nwindows.
(cherry picked from commit 7297e9d339)
2026-01-05 23:53:27 +00:00
zeertzjq
26db87652e test(terminal): fix incorrect TermClose test
The test may wipe the wrong buffer if :bdelete switches to another one.

Also remove the builtin TermClose autocommand. It doesn't affect the
tests for now, but still it's better to avoid its interference.

(cherry picked from commit d42fa1753a)
2026-01-05 23:53:27 +00:00
zeertzjq
77809f0d9c Merge pull request #37249 from zeertzjq/backport
fix(terminal): avoid multiple terminals writing to same buffer (#37219)
2026-01-05 14:13:55 +08:00
zeertzjq
074d342f63 fix(terminal): avoid multiple terminals writing to same buffer (#37219)
Problem:  Calling termopen() or nvim_open_term() on a buffer with an
          existing terminal leads to two terminals writing to the same
          buffer if the terminal job is still running, or memory leak
          if the terminal job has exited.
Solution: Close the terminal if the terminal job has exited, otherwise
          report an error.
2026-01-05 13:54:08 +08:00
zeertzjq
e4a2bbf5f5 Merge pull request #37244 from zeertzjq/backport
Backport to release-0.11
2026-01-05 11:53:10 +08:00
zeertzjq
f7e2554bfb fix(window): crash closing split if autocmds close other splits (#37233)
Problem:  Crash when closing a split window if autocmds close other
          split windows but there are still floating windows.
Solution: Bail out and give the window back its buffer.
2026-01-05 11:34:49 +08:00
Sean Dewar
a9ffdca528 fix(api): open_win leak from naughty autocommands
Problem: error set by win_set_buf may leak if autocommands immediately close the
new window.

Solution: free the error set by win_set_buf. (prefer nvim_open_win's error as
it's more important and will cause 0 to be returned)
2026-01-05 11:34:26 +08:00