37469 Commits

Author SHA1 Message Date
Barrett Ruth
c1a65ff353
docs(tui): kitty keyboard protocol flags #41056
Nvim has sent CSI > 3 u since 4fb3b57a19, but tui.txt still documented
CSI > 1 u.
2026-07-30 05:50:39 -04:00
Justin M. Keyes
b5c623112e
Merge #41057 from janlazo/vim-na-c-plus-docs 2026-07-30 05:48:42 -04:00
Kyle
a3eff66e31
fix(tui): xterm default cursor style #41050
Problem:
xterm doesn't reset to user configured default with the sequence `\x1b[0 q`.

Solution:
Restore old behavior: if the reset cursor style terminfo entry is
absent, xterm's sequence should set the cursor to steady block, which is
the xterm default. In the near future, they may support another option
(`\x1b[7 q`) to reset to the user configured default.
2026-07-30 03:34:26 -04:00
Jan Edmund Lazo
a3b85b9a4d build(vim-patch): ':vim9' is n/a
1. Vim9 error messages, ex commands, are N/A.
2. ":scriptversion" is N/A:
3. Most `#.*define.*ex_ni$` are N/A
   because `FEAT_` compile guards are N/A.

----

Target patch: v8.2.2238

Actual patch list:

```
vim-patch:8.2.4240: error for using flatten() in Vim9 script is unclear
vim-patch:9.0.0170: various minor code formatting issues
vim-patch:9.1.0356: MS-Windows: --remote may change working directory
vim-patch:9.2.0251: Link error when building without channel feature
vim-patch:9.2.0714: Coverity warns for NULL deref
vim-patch:9.2.0818: tests: client-server test fails without X11 server
vim-patch:9.2.0868: GTK: Window Manager hint prevents giving focus to dialog
```

----

Ignore diff blanklines via regex ("-I"), not "--ignore-blank-lines".
Almost useless.
I tried with/without "--word-diff=porcelain", "--word-diff-regex",
and diff algorithms like `--histogram`.
2026-07-30 01:21:07 -04:00
Jan Edmund Lazo
85b1df6ec1 build(vim-patch): clientserver feature is N/A
Shared API, documented in remote.txt, is surface-level.
Assume 0% compatiblity from Vim.
2026-07-29 23:22:31 -04:00
zeertzjq
a85cce90e3
vim-patch:partial:b4ae16c: runtime(doc): clarify 'laststatus' effect (#41052)
fixes: vim/vim#20875

b4ae16ca3e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-07-30 00:11:46 +00:00
zeertzjq
d93684023f
vim-patch:9.2.0871: screen line is lost when splitting a 'winfixheight' window (#41054)
Problem:  When the only window has 'winfixheight' set and 'laststatus'
          is one, splitting it leaves one screen line unused.  This
          happens for example when jumping to an item from a maximized
          quickfix window (rendcrx)
Solution: Do not subtract the height of the status line twice
          (Hirohito Higashi)

fixes:  vim/vim#20495
closes: vim/vim#20871

ab36bcc870

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 23:12:10 +00:00
zeertzjq
943df84fb6
vim-patch:f26970c: runtime(karel): improve indent plugin (#41053)
closes: vim/vim#20873

f26970ce56

Co-authored-by: Patrick Meiser-Knosowski <knosowski@graeffrobotics.de>
2026-07-29 22:59:15 +00:00
zeertzjq
9a4b38584c
vim-patch:9.2.0874: fold size is compared against 'foldminlines' of the wrong window (#41051)
Problem:  checkSmall() compares the fold size of window "wp" against
          the current window's 'foldminlines'.  A fold of another
          window, e.g. measured while it is redrawn, is judged by an
          unrelated option value.
Solution: Use 'foldminlines' of the window containing the fold
          (Igor Mikushkin).

closes: vim/vim#20864

773dc19f14

Co-authored-by: Igor Mikushkin <igor.mikushkin@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-07-29 22:19:12 +00:00
Barrett Ruth
e29af9c32f
refactor(zip)!: builtin zip.lua plugin #40846
Problem:
The bundled `zip` plugin is implemented in Vimscript, making it harder to
maintain and build on with Nvim's Lua runtime infrastructure.

Solution:
Add an opt-out `zip.lua` browser backed by `nvim.dir`, and disable the legacy
Vimscript implementation by moving it to `pack/dist/opt/zip/`. Load it with
`:packadd zip`.
2026-07-29 12:54:43 -04:00
Nathan Zeng
1dbc766fa7
fix(ui2): clear empty cmdline after backspace #41043
Problem:
Cmdline area shows stale ":" after backspacing out of the command line.

Solution:
Clear the command line for empty commands. Note that `:<CR>` will now
clear the command line too.
2026-07-29 12:40:08 -04:00
Justin M. Keyes
b9d732c249
Merge #41045 from justinmk/refactoroptions 2026-07-29 09:57:19 -04:00
Justin M. Keyes
1a755e4890 fix(options): latent codegen bug
Problem:
Latent bug from 7f6c14ed54a46e822b80134d39a89f97523a2706 (2015).
If an option default is "false" (`o.defaults.if_false = false`, e.g.
'fileignorecase'), codegen does not give it a `.def_val` on the platform
where its `#if` condition is undefined; it is zero-initialized.

This wasn't noticed until the parent commit, where zero value is
kObjectTypeNil, which `set_option_varp()` rejects.

Solution:
Check `if_false == nil` insteada of "falsey", so the `#else` branch gets
generated.
2026-07-29 15:27:45 +02:00
Justin M. Keyes
cb7c019167 refactor(options): drop OptVal, use Object
Problem:
The object subsystem has an intermediate representation for no real
reason. Besides the code cost, this also adds an extra (api <=> OptVal)
conversion step, which is a (small) perf cost.

Solution:
We already have `Object`, so use it instead.

- drop `OptVal`, `OptValData`, `OptValType`, and related boilerplate.
- add `kObjectTypeUnset`.
2026-07-29 15:27:45 +02:00
flatplum
7b34bca2a6
docs(health): avoid warnings for dynamic filetypes #41036
Problem:
Dynamic filetypes defined by `vim.filetype.add` may show health warnings.

Solution:
Document a way to suppress these harmless warnings.
2026-07-29 09:03:53 -04:00
glepnir
182b02afb0
fix(insexpand): use String cleanup for compl_leader (#41044)
Problem:
compl_leader is a String, but it is cleared with XFREE_CLEAR().

Solution:
Replace XFREE_CLEAR() with API_CLEAR_STRING().
2026-07-29 10:51:44 +00:00
zeertzjq
7b7a21bd2a
vim-patch:9.2.0869: buf_copy_options() can lose the P_INSECURE flag (#41040)
Problem:  An insecurely-set 'indentexpr', 'formatexpr', 'includeexpr'
          or 'complete' value can end up evaluated outside the
          sandbox after buf_copy_options() and clears the flag.
Solution: Copy the insecure flag alongside the value in
          buf_copy_options(), and make 'complete' a per-buffer
          insecure-flags field

Supported by AI.

closes: vim/vim#20861

35f7fdfdfb

I'm a bit hesitant to port this, but it's a follow-up to #39452.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-07-29 17:44:51 +08:00
zeertzjq
1eba3a75da
vim-patch:9.2.0870: filetype: marko files are not recognized (#41038)
Problem:  filetype: marko files are not recognized
Solution: Detect *.marko files as marko filetype, include a syntax
          plugin and add syntax tests (Brian Carbone)

References:
https://markojs.com
https://github.com/marko-js/tree-sitter
https://github.com/marko-js/language-server
https://v5.markojs.com/docs/editor-plugins/

closes: vim/vim#20863

95da62a910

Co-authored-by: Brian Carbone <brian@briancarbone.com>
2026-07-29 09:14:48 +08:00
zeertzjq
a8626466e8
vim-patch:70d55cd: runtime(m4): Prevent the m4Disabled region from nesting within itself. (#41037)
closes: vim/vim#20801

70d55cd516

Co-authored-by: Sam Williams <sam@badcow.co>
2026-07-29 09:14:14 +08:00
Barrett Ruth
635acc7dc8
fix(terminal): cursor moves on resize when line above is full width #40996 2026-07-28 14:59:18 -04:00
Barrett Ruth
0d36e61d70
fix(dir): "-" on a non-file buffer opens a bogus path #41034 2026-07-28 13:37:06 -04:00
Evgeni Chasnovski
4bba83b4b7
fix(pack): do not write the lockfile when installing from it #41031
Problem: Installing plugins during lockfile synchronization always
  writes the lockfile, even though its content is used during install.
  This might be a problem if the lockfile (itself or its parent
  directory) is not writeable (can only be read).

Solution: Do not write the lockfile when installing directly from it.
  This is okay since the `src` and `rev` are used directly from the
  lockfile and don't change at this step. While potential change in
  `version` (that must be written to the lockfile) is handled in other
  code path.
2026-07-28 09:46:13 -04:00
glepnir
3fa5904cf2
fix(lsp): multibyte fragment treated as commit char #41019
Problem:
commit_chars_str() reads a 0x80-0xBF byte as a 2-byte lead, so
"\xA9x" makes "x" a commit character. nvim_get_hl() returns
a dict, so `#` on it is 0 whether or not the group exists

Solution:
use vim.str_utf_end() and drop entries that are not one whole
character. use next check dict length.
2026-07-28 08:39:03 -04:00
tianrking
089c415cb2
fix(floatwin): relative='cursor' may use outdated cursor position #40768
Problem:
Cursor-relative floats can use stale screen coordinates after a cursor move is restored without a redraw.

Solution:
Validate the current cursor before converting cursor-relative coordinates.

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2026-07-28 07:32:35 -04:00
glepnir
916a6e9546
fix(eval): complete_info() equal, preselect, commit_chars #41022
Problem:  complete_info() does not report "equal", "preselect" or "commit_chars".

Solution: Report them for the items that set them.
2026-07-28 07:24:58 -04:00
Olivia Kinnear
5226e26e99
feat(pos): vim.pos.cursor() without args returns curwin pos #40975 2026-07-28 07:21:45 -04:00
altermo
59296a9fef
fix(treesitter): incremental selection: "vin" not always starts "v" #41016 2026-07-28 06:14:32 -04:00
Barrett Ruth
93f427f603
docs(dir): buffer state discarded by 'bufhidden' #41014 2026-07-28 06:12:01 -04:00
zeertzjq
205a1ce4c7
test(old): map gQ to 1q: (#41025) 2026-07-28 18:11:42 +08:00
zeertzjq
5745ea93f1
vim-patch:9.2.0860: filetype: xilinx design constraint files are not recognized (#41024)
Problem:  filetype: xilinx design constraint files are not recognized
Solution: Detect *.xdc files as tcl filetype (Wu, Zhenyu)

Reference:
https://docs.amd.com/r/en-US/ug903-vivado-using-constraints/About-XDC-Constraints

closes: vim/vim#20853

247a4cb45e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2026-07-28 18:11:29 +08:00
Jan Edmund Lazo
72e3fc2074
build(vim-patch): ":version" doc is n/a #41018
Nvim diverged from Vim's ":version".

- no date
- different compiled features list
- different config file and directory
- no compiler flags

* build(vim-patch): n/a doc for balloon feature (8.2.3917)
2026-07-28 06:10:36 -04:00
github-actions[bot]
6997d3404e
docs: update version.c #41006
vim-patch:c74a87eea runtime(helptoc): reload cached g:helptoc.shell_prompt when starting toc
vim-patch:647d7f738 runtime(doc): fix typo in tag for helptoc package
vim-patch:1c00af2a2 runtime(doc): Remove obsolete labelling from 'h' occasion in :help 'highlight'
vim-patch:9.1.1537: helptoc: still some issues when markdown code blocks
vim-patch:958ae91f3 runtime(doc): typo in recent doc style tweaks in options.txt
vim-patch:9ade3f589 runtime(doc): Clarification in listener_add() doc
vim-patch:9.2.0344: channel: ch_listen() can bind to network interface
vim-patch:9.2.0669: GTK4: toolbar can be improved
vim-patch:9.2.0857: popup: opacity popup over a terminal is not cleared when closed
vim-patch:9.2.0858: MS-Windows GUI: white flash when VimEnter is slow
vim-patch:9.2.0859: GTK2: Link error
vim-patch:935fa240e runtime(doc): clarify vim9 script autoload mechanism
vim-patch:9.2.0861: GTK4: bleed region updates in jumps
vim-patch:9.2.0862: Missing test change from v9.2.0857
vim-patch:9.2.0863: MS-Windows GUI: window contents can be missing when VimEnter is slow
2026-07-28 06:05:23 -04:00
Milad Rashidikhah
20ff82d9fc fix(treesitter): clamp unbounded fold ranges
Problem:
Tree-sitter uses UINT32_MAX for full-document ranges, which becomes -1 on 32-bit platforms and reaches _foldupdate as an invalid end row.

Solution:
Treat negative changed-range end rows as unbounded and clamp them to the buffer line count. Add a regression test that simulates the 32-bit sentinel.

AI-assisted: Codex
2026-07-28 11:00:30 +02:00
bfredl
26357692c8
Merge pull request #40649 from dchinmay2/push-ppxvyxntnsuu
build(zig): bump ziglua to fix building with system lua
2026-07-28 08:25:12 +02:00
Barrett Ruth
e3c5974adf
feat(dir): open cwd with 1- #40948 2026-07-27 18:30:54 -04:00
Justin M. Keyes
fbcb7a056c
feat(exmode): "1q:", :exmode #41010
Problem:
Want `gQ` for _le multicursor_.

Solution:
- Don't use `gQ` for exmode.
- Introduce `:exmode`.
- Introduce `[count]q:` as an alias to `:exmode`.
2026-07-27 11:12:47 -04:00
Josh Hirschkorn
97a71ab484
fix(man): use direct lookup without manpath #40421
Problem:
On NetBSD, `man -w open` can return the exact manpage path, but `:Man`
may still fail when man directories cannot be discovered from `manpath
-q`, bare `man -w`, or `$MANPATH`.

Solution:
Fall back to the direct manpage lookup when directory discovery fails.
Add a test for resolving `open(2)` through `goto_tag()` without manpath
data.
2026-07-27 13:20:46 +00:00
glepnir
0b3b12da8d
fix(completion): "preselect" ignores "noinsert", menu order #41007
Problem:  A preselected item is inserted even with "noinsert", and the
          first added preselected item wins over the first one shown
          in the menu.
Solution: Use K_DOWN when "noinsert" is set; pick the first preselected
          item that made it into the menu.
2026-07-27 08:49:12 -04:00
Justin M. Keyes
80cd482577
fix(lua): vim.regex():match_str abort in Luv callback #41008 2026-07-27 11:01:54 +00:00
Justin M. Keyes
8ee8869a91
Merge #40971 from janlazo/vim-na-helphelp-tags-pt2
build(vim-patch): skip doc for n/a features
2026-07-27 06:58:38 -04:00
Justin M. Keyes
359459dec6
refactor(exmode): Ex-mode as cmdwin + Lua #40991
Problem:
POSIX-compatible Ex-mode requires special-cases all over the codebase to
match various quirks that don't actually matter to users.
- The main utility of *interactive* Ex-mode is its REPL behavior, and
  that can be achieved with `cmdwin`, which also gains extra UX
  benefits.
- The main utility of *non-interactive* `nvim -es` is for shell
  scripting, where Ex-mode quirks are mostly unhelpful (e.g. the
  "Entering Ex mode" message).

Solution:
- Reimplement *interactive* Ex-mode as a "persistent, insert-mode
  cmdwin" in Lua.
  - "nvim -e/-E" is simply an alias to "gQ".
- Reframe *non-interactive* Ex-mode (`nvim -es`) as "script mode".
  - Drop POSIX Ex-mode quirks.

Improvements:
- "nvim -V1 -es" output ends with a final newline!
- "nvim -V1 -es" no longer shows the "Entering Ex mode" msg. (This was
  pointless noise, unwanted for scripting purposes.)
- stdin is no longer typeahead. Scripts (":lua io.read()") can read
  stdin as data.
- Empty line is a no-op: a stray blank line no longer moves the cursor
  (deviates from POSIX ex "+1"), no longer exits 1 at EOF (E501).

Preserved behavior:
- cursor starts at "$"
- mode()=="cv" (for non-interactive)
- multiline commands (:append/:function/heredoc pull continuation lines)
- bare-range print
- :print=>stdout
- -V1=>stderr
- CRLF input
- continue-after-error and exit codes

Dropped (regressed) POSIX behavior (non-interactive):
- Event loop only ticks while/between commands, not while blocked
  waiting for a stdin line.
- ":g/pat/visual...Q"
- input()/getchar()/":s/x/y/c" no longer consume stdin lines as
  answers: Nvim stops at end-of-input, skipping the rest of the script,
  exit 0. Use ":lua io.read()" instead.
  - If users care about this they should use interactive Ex-mode (`gQ`).
- ":@r" stops at end of the register instead of continuing to read
  cmdline input from stdin.
2026-07-27 06:25:21 -04:00
Barrett Ruth
faaa4d57f1
test: start plugin specs with --clean #40995 2026-07-27 04:26:11 -04:00
Jan Edmund Lazo
931a6d2c14 build(vim-patch): ":h builtin-function-list" is n/a 2026-07-27 01:57:18 -04:00
Jan Edmund Lazo
649bf7bcf2 build(vim-patch): helptoc is 100% n/a
Use "gO" mapping instead.
vim9script is N/A.

Detect 'runtime/doc/helphelp.txt' N/A patches for helptoc.
2026-07-27 01:21:24 -04:00
Jan Edmund Lazo
6dc755ee09 build(vim-patch): skip doc for n/a features
Fix xfuncname to support tags that target Vim mappings, options.

- events
- options
    - *'luadll'*
    - *'mzschemedll'*
    - *'mzschemegcdll'*
    - *'perldll'*
    - *'pythondll'*
    - *'pythonthreedll'*
    - *'rubydll'*
    - *'tcldll'*
    - *'winptydll'*
    - t_.+, termcap opts
- internal variables
- cli flags
- ':h emacs-tags'
2026-07-27 01:20:35 -04:00
zeertzjq
7f8175dc48
Merge pull request #41003 from zeertzjq/vim-f88e719
vim-patch: runtime file updates
2026-07-27 06:47:21 +08:00
zeertzjq
1c83e43f27 vim-patch:916809a: runtime(python): highlight the 'lazy' soft keyword
Lazy imports (PEP 810, to be released in Python 3.15) introduces a
`lazy` soft keyword that's recognized when it precedes a `from` or
`import` keyword.

closes: vim/vim#20342

916809ae1e

Co-authored-by: Jon Parise <jon@indelible.org>
2026-07-27 06:31:58 +08:00
zeertzjq
1d36cf1dbe vim-patch:f88e719: runtime(python): Fix indenting for brackets within python byte strings
Problem:  s:SearchBracket()'s skip-expression matches syntax group
          names ending in "Comment", "Todo", or "String" to decide
          whether a candidate bracket is inside a string/comment
          and should be skipped for indentation purposes. Byte and
          raw-byte string literals (b"...", rb"...") are highlighted
          via the pythonBytes/pythonRawBytes syntax groups, which
          don't end in "String", so brackets inside them (e.g.
          b"[") were never skipped and were counted as real,
          unmatched brackets, producing incorrect indentation.

Solution: Add "Bytes" to the indent script's existing suffix match,
          so pythonBytes/pythonRawBytes are recognized directly, the
          same way pythonString/pythonFString/pythonRawString
          already are.

          This supersedes an earlier version of this fix that
          renamed pythonBytes/pythonRawBytes to
          pythonBytesString/pythonRawBytesString in
          runtime/syntax/python.vim.

fixes:  vim/vim#20812
closes: vim/vim#20827

f88e7191da

Co-authored-by: qwavies <qwavsbusiness@gmail.com>
2026-07-27 06:31:40 +08:00
zeertzjq
ef93e93958 vim-patch:4e3df44: runtime(indent-tests): Annotate timed "search*()"es for tracing
related: vim/vim#17116

4e3df44aa2

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2026-07-27 06:31:33 +08:00
Rob Pilling
c57818bb43
fix(ui2): avoid flickering fileinfo messages #41002
## Flicker cause

ui2's `check_targets()` function creates the hidden ui2 windows with this call chain:
```
nvim_open_win()
win_set_buf()
do_buffer()
set_curbuf()
enter_buffer()
```

and `enter_buffer()` sets `need_fileinfo`:

fdc09be03c/src/nvim/buffer.c (L1837-L1839)

This is then picked up by `normal_redraw`:

fdc09be03c/src/nvim/normal.c (L1381-L1385)

The fileinfo message then causes a ui2 window to appear to display it:

fdc09be03c/runtime/lua/vim/_core/ui2/messages.lua (L325-L330)

... which ends up calling `set_pos`, which registers an `on_key` handler:

fdc09be03c/runtime/lua/vim/_core/ui2/messages.lua (L726-L728)

This handler closes the ui2 window when the user presses, for example, `l` (because the user's not focusing said window).
The handler eventually calls `check_targets()`:

fdc09be03c/runtime/lua/vim/_core/ui2/messages.lua (L594-L595)

and `check_targets()` takes us back to the beginning, causing the ui2 window flicker

## Repro

```vim
=require("vim._core.ui2").enable()
set ch=0 shm-=F ve=all
e /tmp/x
```

Then hit `Ctrl-G` to show fileinfo (if not already shown) and hold `l`

## Fix

Effectively surround the ui2 window creating with `:silent`
2026-07-26 17:40:06 -04:00