Commit Graph

19433 Commits

Author SHA1 Message Date
vanaigr
9170178ee5 fix: use correct window dimension for range estimation 2026-03-23 19:36:48 +01:00
vanaigr
20b2dd39cc fix(decor): clamp last column by decor provider range 2026-03-23 19:36:48 +01:00
Justin M. Keyes
3a3c6f0907 refactor: rename termcap.lua -> tty.lua #38437
Problem:
The `termcap.lua` module is too narrowly named. We may need a place for
tty-related functionality in the future.
https://github.com/neovim/neovim/pull/31399#discussion_r1882598297

Solution:
This isn't a public/documented interface, so just rename it.
2026-03-23 10:14:48 -04:00
Justin M. Keyes
fc21433167 fix(session): spacebar heater not warm enough #38434
Problem:
vim-obsession depends on the exact string "let SessionLoad = 1" being
present in session files. ed9dfc7c2c/plugin/obsession.vim (L36-L41)

Solution:
Revert cosmetic change from e12a9e7c4e.
2026-03-23 08:09:33 -04:00
skewb1k
9a5641b4b5 fix(lua): drop support for boolean buf in vim.keymap #38432
Problem:
`vim.keymap.*.Opts.buf` allows `boolean` aliases for more widely
used `integer?` values, `true` -> `0` and `false` -> `nil`. This
conversion is unnecessary and can be handled at call sites.

Solution:
As a follow-up to deprecating the `buffer` option, drop support for
boolean values for the new `buf` option. The deprecated `buffer`
continues to support booleans for backward compatibility.
2026-03-23 08:00:53 -04:00
github-actions[bot]
d7e534d6b3 docs: update version.c #38304
vim-patch:9.2.0166: Coverity warning for potential NULL dereference
vim-patch:9.2.0170: channel: some issues in ch_listen()
vim-patch:9.2.0173: tests: Test_balloon_eval_term_visual is flaky
vim-patch:9.2.0177: Vim9: Can set environment variables in restricted mode
vim-patch:9.2.0183: channel: using deprecated networking APIs
vim-patch:9.2.0187: MS-Windows: rendering artifacts with DirectX renderer
vim-patch:2b70de167 CI: bump actions/upload-artifact to v7
vim-patch:a907a7f73 runtime(doc): disable color codes when generating ascii man pages in Makefile
vim-patch:c9e5aeff3 runtime(doc): Update Italian xxd manpage
vim-patch:9.2.0210: tests: Test_xxd tests are failing
vim-patch:9774651ec runtime(manpager): Strip OSC 8 hyperlink sequences in manpager plugin
vim-patch:9.2.0220: MS-Windows: some defined cannot be set on Cygwin/Mingw
vim-patch:9.2.0224: channel: 2 issues with out/err callbacks
vim-patch:243dcd1bc translation(it): Update Italian xxd man page
vim-patch:9.2.0230: popup: opacity not working accross vert splits
vim-patch:9.2.0231: Amiga: Link error for missing HAVE_LOCALE_H

vim-patch:9.2.0176: external diff is allowed in restricted mode
vim-patch:9.2.0188: Can set environment variables in restricted mode
vim-patch:9.2.0191: feat(has): add support for 'android' and 'termux' feature flags
2026-03-23 07:28:15 -04:00
zeertzjq
0a60f32af3 refactor(move.c): fix coverity warning (#38427)
*** CID 645128:         Integer handling issues  (INTEGER_OVERFLOW)
/src/nvim/move.c: 2071             in scroll_cursor_bot()
2065           used += boff.height;
2066           if (used > wp->w_view_height) {
2067             break;
2068           }
2069           if (extra < (mouse_dragging > 0 ? mouse_dragging - 1 : so)
2070               || scrolled < min_scroll) {
>>>     CID 645128:         Integer handling issues  (INTEGER_OVERFLOW)
>>>     Expression "extra", where "boff.height" is known to be equal to 2147483647, overflows the type of "extra", which is type "int".
2071             extra += boff.height;
2072             if (boff.lnum >= wp->w_botline
2073                 || (boff.lnum + 1 == wp->w_botline
2074                     && boff.fill > wp->w_filler_rows)) {
2075               // Count screen lines that are below the window.
2076               scrolled += boff.height;
2026-03-23 03:30:17 +00:00
zeertzjq
e51f217be7 vim-patch:9.2.0223: Option handling for key:value suboptions is limited (#38426)
Problem:  Option handling for key:value suboptions is limited
Solution: Improve :set+=, :set-= and :set^= for options that use
          "key:value" pairs (Hirohito Higashi)

For comma-separated options with P_COLON (e.g., diffopt, listchars,
fillchars), :set += -= ^= now processes each comma-separated item
individually instead of treating the whole value as a single string.

For :set += and :set ^=:
- A "key:value" item where the key already exists with a different value:
  the old item is replaced.
- An exact duplicate item is left unchanged.
- A new item is appended (+=) or prepended (^=).

For :set -=:
- A "key:value" or "key:" item removes by key match regardless of value.
- A non-colon item removes by exact match.

This also handles multiple non-colon items (e.g., :set
diffopt-=filler,internal) by processing each item individually, making
the behavior order-independent.

Previously, :set += simply appended the value, causing duplicate keys to
accumulate.

fixes:  vim/vim#18495
closes: vim/vim#19783

e2f4e18437

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 10:13:48 +08:00
zeertzjq
fae782557c vim-patch:9.2.0226: No 'incsearch' highlighting support for :uniq (#38425)
Problem:  No 'incsearch' highlighting support for :uniq
Solution: Add :uniq support (Hirohito Higashi)

closes: vim/vim#19780

48137e4e48

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-03-23 09:38:48 +08:00
zeertzjq
11b9ec38d2 vim-patch:9.2.0222: "zb" scrolls incorrectly with cursor on fold (#38423)
Problem:  "zb" scrolls incorrectly with cursor on fold.
Solution: Set w_botline to the line below the fold (zeertzjq).

related: neovim/neovim#38413
closes:  vim/vim#19785

5a3b75d67b
2026-03-23 07:12:08 +08:00
Justin M. Keyes
e12a9e7c4e docs: starting.txt new layout 2026-03-22 01:57:28 +01:00
skewb1k
4d3a67cd62 feat(lua): replace buffer with buf in vim.keymap.set/del #38360
The `buffer` option remains functional but is now undocumented.
Providing both will raise an error. Since providing `buf` was disallowed
before, there is no code that will break due to using `buffer` alongside
`buf`.
2026-03-21 12:00:06 -04:00
zeertzjq
a969e92249 vim-patch:9.2.0219: call stack can be corrupted (#38406)
Problem:  call stack can be corrupted, because calculated remaining
          capacity for call stack string can underflow (after v9.1.1983)
Solution: Calculate capacity against maximum capacity
          (Sergey Vlasov).

closes: vim/vim#19759

8e0483c2f4

Co-authored-by: Sergey Vlasov <sergey@vlasov.me>
2026-03-21 22:51:09 +08:00
Justin M. Keyes
c257d8abed Merge #38370 from justinmk/doc2 2026-03-20 18:51:36 -04:00
tao
7be4e4dd65 fix(pty): prevent orphan conhost.exe on Windows 10 #38244
Problem:
On Windows 10, the ConPTY closing order is strict. Calling
ClosePseudoConsole after closing the output stream can easily
lead to accidental deadlocks, leaving orphan conhost.exe processes.
See https://learn.microsoft.com/en-us/windows/console/closepseudoconsole#remarks
and https://learn.microsoft.com/en-us/windows/console/creating-a-pseudoconsole-session#ending-the-pseudoconsole-session

Solution:
Based on the warning in the docs above, we need to call ClosePseudoConsole
on a separate thread first so that the output pipe can fully drain on
the main thread. Also, `wait_eof_timer` is outdated, so I removed it
to avoid extra cleanup logic around it (it was introduced in the
early winpty days).

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-03-20 18:42:41 -04:00
Justin M. Keyes
e3a1e47bb2 docs: misc 2026-03-20 23:30:09 +01:00
Justin M. Keyes
cd71221250 fix(intro): crash on small screen #38397 2026-03-20 22:23:39 +00:00
Evgeni Chasnovski
9595f07425 feat(ux): sexy intro #38378
Problem: Intro is not sexy.

Solution: Make it sexy.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-03-20 16:56:00 -04:00
Shadman
24684f90ea feat(progress): status api, 'statusline' integration #35428
Problem:
Default statusline doesn't show progress status.

Solution:
- Provide `vim.ui.progress_status()`.
- Include it in the default 'statusline'.

How it works:
Status text summarizes "running" progress messages.
 - If none: returns empty string
 - If one running item: "title:  percent%"
 - If multiple running items: "Progress: N items avg-percent%"
2026-03-20 07:18:20 -04:00
zeertzjq
238d4fa71a fix(terminal): possible missing refresh with buffer updates (#38388)
Problem:
Terminal refresh may be missed if buffer update callbacks poll for uv
events. Example test failure on FreeBSD:

FAILED   test/functional/terminal/buffer_spec.lua @ 1049: :terminal buffer scrollback is correct if buffer update callbacks poll for uv events
test/functional/terminal/buffer_spec.lua:1004: Row 1 did not match.
Expected:
  |*19995: TEST{MATCH: +}|
  |*19996: TEST{MATCH: +}|
  |*19997: TEST{MATCH: +}|
  |*19998: TEST{MATCH: +}|
  |*19999: TEST{MATCH: +}|
  |^[Process exited 0]                                |
  |{5:-- TERMINAL --}                                    |
Actual:
  |*19696: TEST                                       |
  |*19697: TEST                                       |
  |*19698: TEST                                       |
  |*19699: TEST                                       |
  |*19700: TEST                                       |
  |^[Process exited 0]                                |
  |{5:-- TERMINAL --}                                    |

Solution:
Call changed_lines() after resetting invalid region in refresh_screen().
Handle terminal being invalidated in the middle of refresh_timer_cb().
2026-03-20 12:05:19 +08:00
zeertzjq
d36e7787c1 vim-patch:9.2.0209: freeze during wildmenu completion (#38386)
Problem:  Vim may freeze if setcmdline() is called while the wildmenu or
          cmdline popup menu is active (rendcrx)
Solution: Cleanup completion state if cmdbuff_replaced flag has been set
          (Yasuhiro Matsumoto)

fixes:  vim/vim#19742
closes: vim/vim#19744

332dd22ed4

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-03-20 08:44:01 +08:00
zeertzjq
f577e05522 vim-patch:9.2.0202: [security]: command injection via newline in glob() (#38385)
Problem:  The glob() function on Unix-like systems does not escape
          newline characters when expanding wildcards. A maliciously
          crafted string containing '\n' can be used as a command
          separator to execute arbitrary shell commands via
          mch_expand_wildcards(). This depends on the user's 'shell'
          setting.
Solution: Add the newline character ('\n') to the SHELL_SPECIAL
          definition to ensure it is properly escaped before being
          passed to the shell (pyllyukko).

closes: vim/vim#19746

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-w5jw-f54h-x46c

645ed6597d

Co-authored-by: pyllyukko <pyllyukko@maimed.org>
2026-03-20 08:19:52 +08:00
glepnir
531442ddd8 fix(ui): apply 'pumborder' to mouse menu, fix overflow #36193
Problem:
Mouse popup menus (right-click context menus) do not respect the
'pumborder' option and could overflow screen boundaries when borders
were enabled near the edge.

Solution:
- Remove the mouse menu exclusion from border rendering.
- Add boundary check to shift menu left when border would exceed screen
  width, ensuring complete visibility of menu content and borders.
2026-03-19 13:11:35 -04:00
zeertzjq
4c48f19e51 vim-patch:partial:9.2.0193: using copy_option_part() can be improved (#38369)
Problem:  using copy_option_part() can be improved
Solution: Refactor and use the return value of copy_option_part() to
          avoid strlen() calls (John Marriott).

In addition, this commit includes the following changes:

memline.c:
- In recover_names():
  - Replace calls to vim_strsave() with vim_strnsave() for the literal
    strings
  - Use a string_T to store local variable dir_name.

bufwrite.c:
- In buf_write()
  - move variable wp to where it is used.

help.c:
- In fix_help_buffer():
  - replace call to add_pathsep() with after_pathsep()

optionstr.c:
- In export_myvimdir():
  - use a string_T to store local variable buf
  - replace call to add_pathsep() with after_pathsep()

scriptfile.c:
- In do_in_path():
  - use a string_T to store local variable buf
  - measure the lengths of prefix and name once before the while loop
  - replace call to add_pathsep() with after_pathsep()
  - move some variables closer to where they are used

spellfile.c:
- In init_spellfile():
  - use a string_T to store local variable buf

closes: vim/vim#19725

a74e5fc5b9

Co-authored-by: John Marriott <basilisk@internode.on.net>
2026-03-19 10:31:11 +00:00
zeertzjq
7d6b6b2d14 fix(terminal): don't poll for output during scrollback refresh (#38365)
Problem:
If buffer update callbacks poll for uv events during terminal scrollback
refresh, new output from PTY process may lead to incorrect scrollback.

Solution:
Don't poll for output to the same terminal as the one being refreshed.
2026-03-19 18:16:57 +08:00
zeertzjq
875958c9a1 fix(terminal): don't refresh for sync flush when exiting (#38363)
Fixes the following error log:

    ERR 2026-03-18T20:17:36.920 T281.9357.0 buf_updates_send_changes:258: Disabling buffer updates for dead channel 1
2026-03-19 02:53:52 +00:00
Justin M. Keyes
1b2b715389 fix(messages): disallow user-defined integer message-id #38359
Problem:
`nvim_echo(…, {id=…})` accepts user-defined id as a string or integer.
Generated ids are always higher than last highest msg-id used. Thus
plugins may accidentally advance the integer id "address space", which,
at minimum, could lead to confusion when troubleshooting, or in the
worst case, could overflow or "exhaust" the id address space.

There's no use-case for it, and it could be the mildly confusing, so we
should just disallow it.

Solution:
Disallow *integer* user-defined message-id.
Only allow *string* user-defined message-id.
2026-03-18 21:07:17 -04:00
Sean Dewar
6f12663de5 fix(api): nvim_get_option_value FileType autocmd handling #37414
Problem:
nvim_get_option_value with "filetype" set silently returns incorrect
defaults if autocommands are blocked, like when they're already running.

Solution:
Allow its FileType autocommands to nest: `do_filetype_autocmd(force=true)`.
Also error if executing them fails, rather than silently return wrong defaults.

Endless nesting from misbehaving scripts should be prevented by the recursion
limit in apply_autocmds_group, which is 10.
2026-03-18 20:11:59 -04:00
tao
19715e6e8a fix(fs): expand drive-relative paths on Windows #37084
Problem:
On windows, if a drive-relative path doesn't contain a slash,
`path_to_absolute` can't split out the relative component, causing
expansion to fails. e.g., `c:` `c:.` `c:..` `c:foo.md`

Solution:
For these cases, we can pass letter and colon to `path_full_dir_name`.
Notably, `..` is included as well.
if that relative path exists, it can be expanded correctly.
2026-03-18 19:54:19 -04:00
glepnir
8f9278d7c2 fix(menu): right-click menu fails with E335 when using V after i_ctrl-o #37349
Problem:
Right-click menu fails with E335 when using V in Insert mode (after
i_ctrl-o). The mode detection checks restart_edit before VIsual_active,
incorrectly selecting Insert mode binding even when Visual mode is
active.

Solution:
Check Visual mode before Insert mode, to match get_menu_mode() priority
order.
2026-03-18 18:52:06 -04:00
Justin M. Keyes
286b78de9b docs: misc, terminal
Close #38319
Close #38348

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Barrett Ruth <br.barrettruth@gmail.com>
2026-03-18 20:40:20 +01:00
Ayaan
63642ebf80 refactor(terminal): impl "[Process exited]" in Lua #38343
Problem:
"[Process exited]" is implemented in C with anonymous namespace
and users have no way to hide it.

Solution:
- Handle "TermClose" event in Lua.
- User can delete the "nvim.terminal" augroup to avoid "[Process exited]".
2026-03-18 07:54:41 -04:00
skewb1k
20225fc330 build: suppress -Wfree-nonheap-object false positives in lua_cjson #37250
Problem:
Building with GCC emits -Wfree-nonheap-object warnings in lua_cjson code
when calling strbuf_free(), despite the free being conditionally valid.
This is an unresolved GCC issue: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98753

Solution:
Supress warnings with the -Wno-free-nonheap-object flag for now.
2026-03-18 05:27:19 -04:00
mgleonard425
b38173e493 feat(terminal): synchronized output (mode 2026) #38284
Problem:
Applications running inside :terminal that use DEC private mode 2026
(synchronized output) to batch screen updates get garbled rendering.
Neovim's embedded libvterm does not handle mode 2026, so the
synchronization sequences are ignored and intermediate screen states
leak through as visual corruption.

Solution:
Add mode 2026 support to libvterm's state machine and wire it through
to terminal.c. When an application enables mode 2026, invalidation of
the terminal buffer is deferred until the application disables it,
causing all accumulated screen updates to flush as a single
atomic refresh.

* fix(terminal): harden sync output redraw gating

Problem:
The initial mode 2026 implementation gated invalidate_terminal()
but missed three other redraw paths: term_sb_push/term_sb_pop
bypassed the gate by directly adding to invalidated_terminals,
refresh_timer_cb could fire mid-sync flushing partial state, and
the 10ms timer delay after sync-end left a window for stale
repaints.

Solution:
- Gate term_sb_push/term_sb_pop during synchronized output
- Skip syncing terminals in refresh_timer_cb
- On sync end, schedule a zero-delay full-screen refresh via
  sync_flush_pending flag in terminal_receive()
- Add news.txt entry for mode 2026 support

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test(terminal): add vterm unit tests for mode 2026

Add unit-level tests for synchronized output (mode 2026) to
vterm_spec.lua, covering settermprop callbacks and DECRQM
query/response.

Suggested-by: justinmk

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(terminal): address review feedback for mode 2026

- Use multiqueue_put(main_loop.events) instead of restarting the
  global refresh timer on sync end, to avoid affecting other
  invalidated terminals.
- Add screen:expect_unchanged() to verify screen doesn't update
  during sync mode.
- Merge buffer-lines test into existing test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:40:49 -04:00
Justin M. Keyes
02ce446510 docs: api, lsp, messages, intro #38327 2026-03-17 17:02:15 -04:00
zeertzjq
5773f0e994 fix(marks): make jumpoptions=view work with 'smoothscroll' (#38339)
Problem:  'jumpoptions' "view" doesn't remember skipcol and may lead to
          glitched display with 'smoothscroll'.
Solution: Save skipcol in the mark view. Also make sure skipcol doesn't
          exceed line size.
2026-03-17 21:52:25 +08:00
Harsh Kapse
a5b8cf145d feat(diff): merge adjacent blocks using inline:word (#37085)
vim-patch:9.2.0174: diff: inline word-diffs can be fragmented

Problem:  When using 'diffopt=inline:word', lines were excessively
          fragmented with punctuation creating separate highlight
          blocks, making it harder to read the diffs.
Solution: Added 'diff_refine_inline_word_highlight()' to merge
          adjacent diff blocks that are separated by small gaps of
          non-word characters (up to 5 bytes by default) (HarshK97).

When using inline:word diff mode, adjacent changed words separated by
punctuation or whitespace are now merged into a single highlight block
if the gap between them contains fewer than 5 non-word characters.

This creates more readable diffs and closely matches GitHub's own diff
display.

closes: vim/vim#19098

42c6686c78
2026-03-17 12:11:55 +00:00
zeertzjq
9ab6c607cc vim-patch:9.2.0180: possible crash with winminheight=0 (#38335)
Problem:  possible crash with winminheight=0
          (Emilien Breton)
Solution: Use <= instead of < when checking reserved room in
          frame_setheight() to correctly handle the zero-height
          boundary case (Hirohito Higashi).

In frame_setheight(), when shrinking the current window and the only
other window has 'winfixheight' with 'winminheight'=0, room_reserved
was not cleared because the condition used '<' instead of '<='.
The freed rows were discarded, leaving fr_height sum less than
topframe fr_height.  Subsequent resize operations then computed a
wrong room_cmdline that expanded topframe beyond the screen, causing
a crash.

fixes:  vim/vim#19706
closes: vim/vim#19712

a5d9654620

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-03-17 00:02:32 +00:00
TomIO
6edae88052 feat(vimscript): scripts can detect 'android', 'termux' #38218
Problem:
The 'android' and 'termux' feature flags have been shipped in the
downstream neovim/neovim-nightly package for 5+ years but were never
properly documented in the downstream patch.

Solution:
Upstream the 'android' and 'termux' feature flags into Neovim as
decoupled feature flags, this enables the 'android' feature in
particular to be available independently of the 'termux' feature
for builds of Neovim against the Android NDK, but not including
the Termux NDK patchset.

Co-authored-by: Lethal Lisa <43791059+lethal-lisa@users.noreply.github.com>
Co-authored-by: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com>
2026-03-16 19:12:12 -04:00
Sean Dewar
33b357d01f vim-patch:9.2.0182: autocmds may leave windows with w_locked set #38332
Problem:  autocmds that switch windows may cause them to remain with
          w_locked set, preventing them from being closed longer than
          intended.
Solution: Unset w_locked in the window where it was set (Sean Dewar).

closes: vim/vim#19716

bae31c35bb

Also move alist_add_list's ga_grow inside the if block, so it's only called when
check_arglist_locked is OK, like Vim.

I also notice a redundant return at the end of the block; could be useful if
more code is added later, so I'm leaving it.
2026-03-16 23:05:39 +00:00
Shadman
7b7e8cc724 feat(progress): disable cmdline progress msg via messagesopt' #36730
Problem:
No way to disable progress messages in cmdline message area. If
a third-party plugin handles Progress events + messages, the user may
not want the "redundant" progress displayed in the cmdline message area.

Solution:
Support "progress:c" entry in 'messageopts' option.
2026-03-16 11:29:47 -04:00
Justin M. Keyes
680d25e5b3 fix(api): use standard error messages 2026-03-16 14:52:04 +01:00
Justin M. Keyes
ca67ba3b66 docs: misc 2026-03-16 14:52:03 +01:00
Sean Dewar
97b064c9ac fix(api): nvim_open_tabpage positional "enter"
Problem: nvim_open_tabpage's "enter" argument is optional, which is inconsistent
with nvim_open_win.

Solution: make it a (non-optional) positional argument, like nvim_open_win.

Also change "enter"'s description to be more like nvim_open_win's doc.
2026-03-16 13:20:45 +00:00
Sean Dewar
0c1ed63c05 fix(api): nvim_open_tabpage "after" like :[count]tab
Problem: "after" in nvim_open_tabpage is inconsistent with how a count works
with :tab, :tabnew, etc. Plus, the name "after" implies it's inserted after that
number.

Solution: internally offset by 1. Allow negative numbers to mean after current.

Hmm, should we even reserve sentinels for after current? Callers can probably
just use nil...
2026-03-16 13:05:47 +00:00
Sean Dewar
cd4c98fded fix: nvim_open_tabpage cleanup, fixes, more tests
- Cleanup, remove redundant comments, add more tests.
- Enhance win_new_tabpage rather than create a new function for !enter, and use
  a different approach that minimizes side-effects. Return the tabpage_T * and
  first win_T * it allocated.
- Disallow during textlock, like other APIs that open windows.
- Remove existing win_alloc_firstwin error handling from win_new_tabpage; it's
  not needed, and looks incorrect. (enter_tabpage is called for curtab, which is
  not the old tabpage! Plus newtp is not freed)
- Fix checks after creating the tabpage:
  - Don't fail if buf wasn't set successfully; the tab page may still be valid
    regardless. Set buffer like nvim_open_win, possibly blocking Enter/Leave
    events. (except BufWinEnter)
  - tp_curwin may not be the initial window opened by win_new_tabpage. Use the
    win_T * it returns instead, which is the real first window it allocated,
    regardless of autocmd shenanigans.
  - Properly check whether tab page was freed; it may have also been freed
    before win_set_buf. Plus, it may not be safe to read its handle!
2026-03-16 13:05:47 +00:00
Will Hopkins
e80d19142b feat(api): add nvim_open_tabpage
Problem: no API function for opening a new tab page and returning its handle, or
to open without entering.

Solution: add nvim_open_tabpage.
2026-03-16 13:05:46 +00:00
Justin M. Keyes
c82f83abb0 fix(ux): drop "Sorry" from messages #38318
Problem:
"Sorry" in a message (1) is noise, and (2) actually reduces the clarity
of the message because the titlecasing of "Sorry" distracts from the
actually important part of the message.

Solution:
Drop "Sorry" from messages.
2026-03-16 07:46:34 -04:00
Sean Dewar
3cd07709ba fix(terminal): don't always leave if enter autocmds delete buffer #38324
Problem: #38316 is a bit aggressive; we need not always leave Terminal mode if
autocmds put us in a different terminal.

Solution: don't skip entering; let terminal_check_focus handle whether we should
immediately leave.
2026-03-16 09:56:36 +00:00
Justin M. Keyes
16f7440cc7 feat(help): super K (":help!") guesses tag at cursor #36205
Problem:
`K` in help files may fail in some noisy text. Example:

      (`fun(config: vim.lsp.ClientConfig): boolean`)
                            ^cursor

Solution:
- `:help!` (bang, no args) activates DWIM behavior: tries `<cWORD>`,
  then trims punctuation until a valid tag is found.
- Set `keywordprg=:help!` by default.
- Does not affect `CTRL-]`, that is still fully "tags" based.
2026-03-15 19:02:49 -04:00