Commit Graph

10153 Commits

Author SHA1 Message Date
altermo
bc00aec21c test(treesitter): skip unreliable select test #38391
The test sometimes(around 1/30) fails on PUC-lua.
2026-03-20 17:42:27 -04: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
Justin M. Keyes
f9b2189b28 Merge #38047 _provider_foreach 2026-03-20 05:11:27 -04:00
Yochem van Rosmalen
72a63346d8 feat(stdlib): vim.fs.ext() returns file extension #36997
Problem:
Checking the extension of a file is done often, e.g. in Nvim's codebase
for differentiating Lua and Vimscript files in the runtime. The current
way to do this in Lua is (1) a Lua pattern match, which has pitfalls
such as not considering filenames starting with a dot, or (2)
fnamemodify() which is both hard to discover and hard to use / read if
not very familiar with the possible modifiers.

vim.fs.ext() returns the file extension including the leading dot of
the extension. Similar to the "file extension" implementation of many
other stdlibs (including fnamemodify(file, ":e")), a leading dot
doesn't indicate the start of the extension. E.g.: the .git folder in a
repository doesn't have the extension .git, but it simply has no
extension, similar to a folder named git or any other filename without
dot(s).
2026-03-20 05:08:00 -04:00
glepnir
24714c0d43 refactor(test): clean up pumborder round test cases #38368
Problem: pumborder round tests contained redundant.

Solution: Remove unnecessary test code.
2026-03-20 04:46:57 -04: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
a18d51a958 vim-patch:9.2.0204: filetype: cps files are not recognized
Problem:  filetype: cps files are not recognized
Solution: Detect *.cps files as json filetype (Guillaume Barbier).

Reference:
https://github.com/cps-org/cps
https://cps-org.github.io/cps/

closes: vim/vim#19758

53884ba7a8

Co-authored-by: Guillaume Barbier <barbier.guillaume60@gmail.com>
2026-03-20 08:17:18 +08:00
zeertzjq
e2c3106b85 vim-patch:9.2.0201: filetype: Wireguard config files not recognized
Problem:  filetype: Wireguard config files not recognized
Solution: Detect /etc/wireguard/*.conf files as dosini filetype
          (Furkan Sahin).

closes: vim/vim#19751

cc8798e719

Co-authored-by: Furkan Sahin <furkan-dev@proton.me>
2026-03-20 08:17:18 +08:00
tris203
c8d9ade16a refactor(lsp): replace _provider_value_get with _provider_foreach
Introduce _provider_foreach to iterate over all matching provider
capabilities for a given LSP method, handling both static and dynamic
registrations. Update diagnostic logic and tests to use the new
iteration approach, simplifying capability access and improving
consistency across features.
2026-03-19 17:51:21 +00:00
Yi Ming
06befe1e34 feat(defaults): map "grx" to vim.lsp.codelens.run() #37689
Problem
Unlike inlay hints, code lenses are closely related to running commands;
a significant number of code lenses are used to execute a command (such
as running tests). Therefore, it is necessary to provide a default
mapping for them.

Solution
Add a new default mapping "grx" (mnemonic: "eXecute", like "gx").
2026-03-19 13:47:52 -04: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
Luuk van Baal
e58a842749 fix(ui2): wrong condition used to detect active pager
Problem:  Entering the pager is scheduled to avoid errors while in the
          cmdwin. Meanwhile the current window is used as a condition to
          detect an active pager.
Solution: Keep track of when the user is in the pager (or entered the
          cmdwin while the pager was open).
2026-03-19 16:38:57 +01:00
Olivia Kinnear
e406c4efd6 feat(lsp): vim.lsp.get_configs() #37237
Problem:
No way to iterate configs. Users need to reach
for `vim.lsp.config._configs`, an internal interface.

Solution:
Provide vim.lsp.get_configs().
Also indirectly improves :lsp enable/disable completion
by discarding invalid configs from completion.
2026-03-19 07:33:34 -04: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
Maria Solano
4430c9a424 feat(lsp): migrate document_color to capability framework (#38344)
* feat(lsp): migrate `document_color` to capability framework

* feat(lsp): use `vim.Range` in `document_color` module
2026-03-18 17:18:48 -07: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
Juan Pablo Briones
f4f1149292 fix(options): vim.opt fails for 'fillchars' #37141
Problem:
When `to_vim_value[info.metatype](info, value)` is called, a list value
such as `{'eob:a'}` is treated like a map, which generates `1:eob:a`.

Note: commands like `:lua vim.opt.wildmode={'longest:full'}` are not an
issue because only cases harcoded in `key_value_options` have metatype `map`.

Solution:
Check for array type and use the same logic as in array metatypes.
2026-03-18 19:19:47 -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
Yi Ming
addd408b39 fix(lsp): redraw codelens after request completed #38352
Problem:
When code lens is enabled, `on_attach` is executed, but it does not trigger a redraw. Another event, eg, moving the cursor, is required to trigger a redraw and execute the decoration provider's `on_win`.

Solution:
Trigger a `redraw` after each request is completed.
2026-03-18 11:02:46 -04: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
zeertzjq
c3308fa5fe test(tui_spec): remove unnecessary :messages (#38349)
The :echomsg commands already trigger a hit-enter prompt. The :messages
will lead to an intermediate state, which causes the test to be flaky.
2026-03-18 01:49:36 +00:00
zeertzjq
1d776d909f test: always show snapshot if screen:expect_unchanged() fails (#38347)
If the final screen state does match but an intermediate screen state
doesn't, show the first intermediate state.
2026-03-18 07:10:01 +08: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
glepnir
0da9827673 fix(lsp): respect documentation markup kind in completion preview #38338
Problem:
Completion preview always assumes plain text, ignoring LSP documentation "kind".

Solution:
Pass markup kind from completion item to info window, or fallback to PlainText.
2026-03-17 10:24:30 -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
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
b8f1426a86 Merge #27223 nvim_open_tabpage 2026-03-16 09:51:27 -04:00
glepnir
88a72efb46 fix(diagnostic): open_float() handles config.float function #31577
Problem:
The `float` field of vim.diagnostic.config can be a function,
but diagnostic.open_float() does not handle it correctly.

Solution:
Add handling for it in open_float().
2026-03-16 09:50:13 -04: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
Yinzuo Jiang
6dd634b025 vim-patch:9.2.0143: termdebug: no support for thread and condition in :Break
Problem:  termdebug :Break does not support `thread` and `if` arguments
Solution: extend :Break and :Tbreak to accept optional location, thread
          {nr}, and if {expr} arguments (Yinzuo Jiang).

closes: vim/vim#19613

5890ea5397

AI-assisted: Codex
2026-03-16 19:05:15 +08:00
zeertzjq
9d025e6a4d test(old): avoid indexing undefined signs
Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2026-03-16 19:05:15 +08:00
Yinzuo Jiang
42640c62d1 vim-patch:partial:9.1.1004: tests: a few termdebug tests are flaky
Problem:  tests: a few termdebug tests are flaky; test_termdebug_basic()
          and test_termdebug_config_types() may fail if there is too
          much load
Solution: Set g:test_is_flaky

Only include:
- mark Test_termdebug_basic() as flaky in oldtest termdebug plugin tests

The Test_termdebug_config_types() part does not apply here.

ebb08d5913

Co-authored-by: Christian Brabandt <cb@256bit.org>
AI-assisted: Codex
2026-03-16 19:05:15 +08:00
Yinzuo Jiang
dff515205c vim-patch:partial:9.1.0613: tests: termdebug test may fail and leave file around
Problem:  tests: termdebug test may fail and leave temp file around
          (Dominique Pellé)
Solution: only run balloon_show() if the function exists, validate
          termdebug is running using the g: termdebug_is_running var,
          use defer to delete temporary files

Only include:
- guard balloon_show() in the termdebug plugin
- wait for g:termdebug_is_running in Test_termdebug_basic()

The remaining upstream test cleanups do not apply here.

fixes: vim/vim#15334

2979cfc262

Co-authored-by: Christian Brabandt <cb@256bit.org>
AI-assisted: Codex
2026-03-16 19:05:15 +08: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
Sean Dewar
1c57e4cb4f fix(terminal): heap UAF from autocmds when entering #38316
Problem: heap-use-after-free possible when entering Terminal mode if
autocommands close the terminal.

Solution: set the refcount. Skip to the end if we must close the terminal.
2026-03-15 17:38:25 -04:00
phanium
0ca9849387 fix(statusline): missing info/hint diagnostics #38307
Problem: default stl treat vim.diagnostics.count() return as array

Solution: next() tell if a dict is empty
2026-03-15 10:35:08 -04:00