Commit Graph

10367 Commits

Author SHA1 Message Date
zeertzjq
e1c4e5523f vim-patch:39ee7d1: runtime(yara): add ftplugin for yara filetype (#38361)
Add a minimal ftplugin `runtime/ftplugin/yara.vim` that sets:
- `commentstring` for YARA line comments (`//`)
- `comments` for YARA block comment (`/* */`)
- `formatoptions` to wrap comment lines and continue comment after newlines
This was heavily inspired from `runtime/ftplugin/c.vim`

closes: vim/vim#19736

39ee7d17b9

Co-authored-by: Thomas Dupuy <thom4s.d@gmail.com>
2026-03-19 11:10:39 +08: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
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
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
Justin M. Keyes
7dfb8e3497 docs: terminal.txt new layout 2026-03-18 20:07:32 +01: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
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
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
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
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
726dc2757b docs(api): manually format api-buffer-updates 2026-03-16 14:52:04 +01: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
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
zeertzjq
46f538c210 vim-patch:049c76f: runtime(termdebug): drop outdated comment from termdebug.vim (#38325)
that was an internal note which somehow slipped in months ago and even
survived the change to Vimscript9

closes: vim/vim#18305

049c76f0e8

Co-authored-by: Simon Sobisch <simonsobisch@web.de>
2026-03-16 19:55:23 +08: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
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
Yinzuo Jiang
6e7fb51813 vim-patch:partial:225d4d921: runtime(termdebug): Refactored StartDebug_term and EndDebug functions
- Functions are way too long. Readability and maintainability should
be slightly improved.

- Some variables are re-assigned to their initial value at teardown.
This should not be needed since all internal variables are
re-initialized at startup of every Termdebug session.

Only include:
- prompt-mode buffer tracking changes around `promptbufnr`
- prompt buffer cleanup in `CloseBuffers()` and `EndDebugCommon()`
- related `BufUnload` and gdb startup failure cleanup adjustments

The remaining upstream `StartDebug_term()` refactor and helper extraction
do not apply here.

closes: vim/vim#15086

225d4d9212

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@gmail.com>
AI-assisted: Codex
2026-03-16 19:05:15 +08:00
Yinzuo Jiang
34fea4fc64 vim-patch:fce324f557: runtime(termdebug): close all buffers in the same way
For ASM and Variables buffer, check were done to make sure they existed
before attempting to close them, but not for debugged program or gdb
communication. The debugged program window is a user-facing one and
user might close it manually, so it's better to check if it exists.

fce324f557

Co-authored-by: Damien Riegel <damien@riegel.io>
AI-assisted: Codex
2026-03-16 19:05:15 +08:00
Christian Clason
5a0a26a725 build(deps): bump luv to 1.52.1-0 2026-03-16 10:29:58 +01: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
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
Sean Dewar
094b297a3b feat(api): nvim_win_set_config can move split to other tp as floatwin
Problem: not possible for nvim_win_set_config to convert a split to a floatwin,
then move it to another tabpage in one call.

Solution: allow it.
2026-03-14 20:48:32 +00:00
Sean Dewar
7be4ae796f fix(api): relax config validation for "win"
Problem: only possible to move floats between tabpages if relative=win, which
has the restrictive effect of also anchoring it to the target window.

Solution: allow "win" without "relative" or "split"/"vertical". Only assume
missing "win" is 0 if relative=win is given to maintain that behaviour. (or when
configuring a new window)

Also add an error when attempting to change a split into a float that's in
another tabpage, as this isn't actually supported yet. (until the next commit)

Maybe this could do with some bikeshedding. Unclear if "win" should require
"relative" to be given, like with "row"/"col"; this can be annoying though as
specifying "relative" requires other fields to be given too.
2026-03-14 20:48:31 +00:00
Sean Dewar
e5240b35c3 refactor(api): cleanup, more comments, more tests, news
- Factor out logic to keep nvim_win_set_config clean.
- Clean up a few things, remove redundant logic, reflow some lines.
- Add some more comments where appropriate.
- Don't consider negative "win", as that's only relevant for splits.
- Add more test coverage.
- Add news.txt entry.
2026-03-14 19:27:19 +00:00
altermo
929be7ee00 refactor(treesitter): move range related functions 2026-03-14 12:25:14 +01:00
altermo
39fa5e8ba9 docs(treesitter): fix typo 2026-03-14 12:25:14 +01:00
glepnir
5653b25e9b fix(lsp): handle non-string documentation in completion items #38291
Problem: `get_doc` throws error with "attempt to get length of a userdata
value" when `item.documentation` is truthy but not a string (e.g. vim.NIL
from a JSON null).

Solution: Check `type(item.documentation)` before taking its length.
2026-03-14 05:20:34 -04:00
zeertzjq
f58d24040a vim-patch:9.2.0155: filetype: ObjectScript are not recognized (#38288)
Problem:  filetype: ObjectScript are not recognized
Solution: Add ObjectScript filetype detection for *.cls files
          (Hannah Kimura)).

Reference:
https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCOS_intro

closes: vim/vim#19668

b11c8efbe6

Co-authored-by: Hannah <hannah.kimura@intersystems.com>
2026-03-14 01:42:10 +00:00
nikolightsaber
fd1e019e90 refactor(treesitter)!: get_parser return nil on error #37276 2026-03-13 15:57:36 -04:00
Justin M. Keyes
017d8aa298 refactor: rename _ensure_integer => _assert_integer 2026-03-13 20:32:01 +01:00
Justin M. Keyes
682c77805c docs: misc 2026-03-13 20:32:01 +01:00
Oleh Volynets
caf7808591 feat(diagnostic): custom status format function #36696
Problem:  Statusline component of diagnostics allows only the default
          format "sign:count".

Solution: Extend vim.diagnostic.Opts.Status to allow a custom signs
          or formatting function that provides the status presentation.
2026-03-13 07:21:45 -04:00
zeertzjq
957eb1fde0 vim-patch:3697c6b: runtime(ssh): ignore case in 'keywordprg', update syntax script (#38277)
- ftplugin(sshdconfig): use "-I" for 'keywordprg' to search
  case-insensitive in the man page
- syntax(sshdconfig,sshconfig): Mark "lowdelay", "throughput", and
  "reliability" as deprecated for IPQoS, highlighting them as
  errors/warnings to reflect OpenSSH 10.1p1 release

Reference:
https://www.openssh.org/releasenotes.html#10.1p1

closes: vim/vim#19636

3697c6b020

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2026-03-12 23:45:04 +00:00
luukvbaal
52dd62aa6e fix(ui2): use pager to list consecutively typed commands #38272
Problem:  Mimicked block mode for cmdline entered while expanded
          does not work intuitively for repeated commands yielding
          messages exceeding the screen height. The expanded cmdline
          resizes and scrolls to bottom/top when appending a message
          and entering the cmdline. Also includes the entered command,
          as opposed to the UI1 behavior.
          Crash when scrolling to bottom of pager due to recursive
          uv_run after shell message callback executes `nvim_command()`
          with 'showcmd'.

Solution: Still mimic block mode when entering the expanded cmdline,
          but when the entered command emits a message open the pager
          with the current message content in the expanded cmdline.
          Always route typed commands to the pager when it is open.
          Use `nvim_buf_set_cursor()` instead of `nvim_command()`.
2026-03-12 18:38:39 -04:00
Lewis Russell
ce1154048b refactor: integer functions, optimize asserts #34112
refactor(lua): add integer coercion helpers

Add vim._tointeger() and vim._ensure_integer(), including optional base
support, and switch integer-only tonumber()/assert call sites in the Lua
runtime to use them.

This also cleans up related integer parsing in LSP, health, loader, URI,
tohtml, and Treesitter code.

supported by AI
2026-03-12 11:04:05 -04:00
Justin M. Keyes
7ea148a1dc docs: use "ev" convention in event-handlers
Problem:
In autocmd examples, using "args" as the event-object name is vague and
may be confused with a user-command.

Solution:
Use "ev" as the conventional event-object name.
2026-03-12 11:12:56 +01:00
Justin M. Keyes
bc67976c95 docs: vimfn descriptions 2026-03-12 11:12:56 +01:00
Justin M. Keyes
96e6ce6619 docs: misc 2026-03-12 11:12:56 +01:00
anondeveg
32aee065a8 feat(startup): warn if NVIM_LOG_FILE is inaccessible #38070
Problem:
If NVIM_LOG_FILE, or the default fallback, is inaccessible (e.g.
directory is owned by root), users get confused.

Solution:
Show a warning when $NVIM_LOG_FILE or $XDG_STATE_HOME are inaccessible.

Also fix a latent memory leak: `os_mkdir_recurse` returns a uv error
code (int), but it was stored as `bool`, causing `os_strerror` to
receive an invalid error code and leak memory.

See: https://docs.libuv.org/en/v1.x/errors.html#c.uv_strerror

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-03-12 04:40:07 -04:00
zeertzjq
99a0b2f7b8 vim-patch:2cf18fc: runtime(python): Update syntax, improve pythonNumber pattern performance (#38263)
- Improve the performance of all pythonNumber patterns by unrolling
  digit/underscore sequence loops.
- Split the float literal pattern into two simpler patterns.

fixes:  vim/vim#19625 (Reported by James McCoy)
closes: vim/vim#19630

2cf18fcc24

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-03-12 07:55:00 +08:00