Commit Graph
35993 Commits
Author SHA1 Message Date
zeertzjqandFelix Pehla 2a4d666637 vim-patch:ff6f277: runtime(swayconfig): add additional criteria and hdr (#38728)
Sway 1.11 added `security_context_v1` metadata as criteria:
 - `sandbox_engine`
 - `sandbox_app_id`
 - `sandbox_instance_id`

Sway 1.12 will add the `tag` criteria for `xdg_toplevel_tag_v1`, as
well as the `hdr` output option (with options `on`, `off`, and
`toggle`).

closes: vim/vim#19884

https://github.com/vim/vim/commit/ff6f277a4dbbc1fec75c9a9d29fb85ba55127618

Co-authored-by: Felix Pehla <29adc1fd92@gmail.com>
2026-04-03 17:55:35 +08:00
zeertzjq d7ef77d175 vim-patch:9.2.0285: :syn sync grouphere may go beyond end of line (#38727)
Problem:  :syn sync grouphere may go beyond end of line.
Solution: Start searching for the end of region at the end of match
          instead of a possibly invalid position (zeertzjq).

closes: vim/vim#19896

https://github.com/vim/vim/commit/b7cffc84340d6c141fb8f7dbe771c4c15dcc47d4
2026-04-03 09:22:26 +00:00
zeertzjqandAliaksei Budavei 3cb79189f3 vim-patch:12f6f20: runtime(sh): Keep function name patterns engine neutral (#38719)
Request less backtracking to function-name candidates for
nonlinear patterns with any regexp engine BUT force using
the old engine with these patterns to avoid incurring an
additional penalty, according to ":syntime report", when the
new regexp engine is preferred.

fixes:  vim/vim#19847
closes: vim/vim#19849

https://github.com/vim/vim/commit/12f6f20552187432ac67e3bd83a285a1e608b457

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2026-04-03 07:00:47 +08:00
zeertzjq 596a7a32f3 test(terminal/cursor_spec): fix flaky test (#38712)
FAILED   test/functional/terminal/cursor_spec.lua @ 419: :terminal cursor uses the correct attributes
test/functional/terminal/cursor_spec.lua:448: Expected objects to be the same.
Passed in:
(string) 'block'
Expected:
(string) 'vertical'
stack traceback:
	test/functional/terminal/cursor_spec.lua:448: in function <test/functional/terminal/cursor_spec.lua:419>
2026-04-02 14:22:18 +00:00
dependabot[bot] 028805ccbb ci: bump korthout/backport-action
Bumps the github-actions group with 1 update in the / directory: [korthout/backport-action](https://github.com/korthout/backport-action).


Updates `korthout/backport-action` from 4.2.0 to 4.3.0
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](https://github.com/korthout/backport-action/compare/4aaf0e03a94ff0a619c9a511b61aeb42adea5b02...3c06f323a58619da1e8522229ebc8d5de2633e46)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-version: 4.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-02 15:19:07 +02:00
zeertzjq fb9c843ab0 feat(:restart): reattach all UIs (#38683)
This is quite easy since [command] is now only executed once on UIEnter.
2026-04-02 20:57:02 +08:00
Yi Ming 0eb2eb4106 refactor(lsp): remove implicit rpc error tostring #38707
Problem:
LSP error responses implicitly rely on a custom `__tostring` function
(`vim.lsp.rpc.format_rpc_error`) for formatting. This causes errors that are not
created via `vim.lsp.rpc.error` to behave inconsistently with those that are.

Furthermore, we usually use `log.error` to print these errors, which uses
`vim.inspect` under the hood, so the custom `__tostring`  provides little
benefit.

This increases the difficulty of refactoring the code, as it tightly couples RPC
error handling with the LSP.

Solution:
Convert every potential `__tostring` call to an explicit one. Since we don't
describe this behavior in the documentation, this should not be a breaking
change.
2026-04-02 08:53:29 -04:00
Christian Clason 2cf5dcb170 build(deps): bump tree-sitter to 64698af1a 2026-04-02 14:33:07 +02:00
Lewis Russell 3309b48c83 refactor(treesitter): add nts_parser_parse_buf
This PR creates a C function `nts_parser_parse_buf()`
which is like `ts_parser_parse_string()` but instead can be passed
an nvim buffer number to parse.
2026-04-02 14:29:36 +02:00
altermo facc21cc63 fix(treesitter): select reset to "v" visualmode() 2026-04-02 14:29:09 +02:00
zeertzjq f2cdf73afc fix(api): avoid error when parsing invalid expr after :echo (#38695)
Problem:  Parsing :echo followed by invalid expression leads to error.
Solution: Suppress error when skipping over expression.
2026-04-01 23:05:47 +00:00
zeertzjqandChristian Brabandt 0851ac2706 vim-patch:9.2.0280: [security]: path traversal issue in zip.vim (#38693)
Problem:  [security]: path traversal issue in zip.vim
          (Michał Majchrowicz)
Solution: Detect more such attacks and warn the user.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-jc86-w7vm-8p24

https://github.com/vim/vim/commit/7088926316d8d4a7572a242d0765e99adfc8b083

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-01 22:23:23 +00:00
Justin M. Keyes 68c26b344b docs: misc #38584 2026-04-01 17:04:41 -04:00
Justin M. Keyes 202f67dce3 Merge #38560 refactor vim.lsp.rpc 2026-04-01 16:46:59 -04:00
Luis Calle 79a2235fd1 perf(vim.pos): use nvim_buf_line_count instead of fetching all lines #38686 2026-04-01 15:28:31 -04:00
phanium a2d9863c27 fix(ui2): vim.on_key should return nil instead of false (#38668) 2026-04-01 15:07:26 +02:00
zeertzjqandChristian Brabandt a0fcf32ad5 vim-patch:82ebaa7: runtime(racket): Make visual K mapping more robust for shell injection (#38677)
fyi @benknoble

https://github.com/vim/vim/commit/82ebaa79b03f0f9d66eeba51570c62a83096108f

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-01 19:21:24 +08:00
Yi Ming dbd93de62a refactor(lsp): better encapsulation and readability, inline unnecessary 2026-04-01 18:16:40 +08:00
zeertzjq 65e2218585 vim-patch:9.2.0277: tests: test_modeline.vim fails (#38672)
Problem:  tests: test_modeline.vim fails (after v9.2.0276)
Solution: Rewrite the tests to use the existing s:modeline_fails()
          function, update documentation (zeertzjq).

https://github.com/vim/vim/commit/8c8772c6b321d4955c8f09926e3eda2b4cd83680
2026-04-01 08:43:03 +00:00
Jan Edmund Lazo 8367340b05 build(vim-patch): N/A runtime files (#38666)
* fix(vim-patch): runtime/doc/print.txt is N/A

- https://github.com/neovim/neovim/issues/21471

* fix(vim-patch): test_urls.vim is N/A

- https://github.com/neovim/neovim/pull/35593
2026-04-01 04:25:43 +00:00
zeertzjqandThomas Braun fa51f5502f vim-patch:12c6417: runtime(sshconfig): Add missing kex algorithm (#38656)
These are available already with openssh 10.2p1.

closes: vim/vim#19864

https://github.com/vim/vim/commit/12c641758753bf143b50fb94039e2b0305681c9e

Co-authored-by: Thomas Braun <thomas.braun@byte-physics.de>
2026-04-01 10:00:31 +08:00
zeertzjqandChristian Brabandt c7604323e3 vim-patch:9.2.0276: [security]: modeline security bypass (#38657)
Problem:  [security]: modeline security bypass
Solution: disallow mapset() from secure mode, set the P_MLE flag for the
          'complete', 'guitabtooltip' and 'printheader' options.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-8h6p-m6gr-mpw9

https://github.com/vim/vim/commit/75661a66a1db1e1f3f1245c615f13a7de44c0587

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-01 08:00:33 +08:00
zeertzjq a89d7dcb91 docs: misc (#38578) 2026-04-01 07:59:51 +08:00
d29db48e0a vim-patch:374f06f: runtime(racket): Use shellescape() to harden the K mapping
fyi: @benknoble

https://github.com/vim/vim/commit/374f06ffd8b890809289911334d8f0b0b15603bc

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Michał Majchrowicz <mmajchrowicz@afine.com>
2026-04-01 07:58:14 +08:00
zeertzjqandChristian Brabandt ec1bea9c05 vim-patch:e551e71: runtime(tera): use fnameescape() when loading separate syntax files
https://github.com/vim/vim/commit/e551e71d7e47c233d55272162bc3e9160bc9d102

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-01 07:58:14 +08:00
zeertzjqandEisuke Kawashima 0860b24c2c vim-patch:52169db: translation(cleanup): squeeze successive empty lines and remove stray comments
closes: vim/vim#19860

https://github.com/vim/vim/commit/52169dbc285724cf2ba5956426fa08d26c6f4672

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2026-04-01 07:46:16 +08:00
zeertzjqandRestorerZ 9b9c72f6d4 vim-patch:cca3df9: translation: improve the po/cleanup.vim script
explicitly delete into the black-hole register

closes: vim/vim#15499

https://github.com/vim/vim/commit/cca3df9275c6f76e3b31ad9b13ced91a44e1855b

Co-authored-by: RestorerZ <restorer@mail2k.ru>
2026-04-01 07:46:16 +08:00
Justin M. Keyes 2b7d793cd6 Merge #38579 from liskin/terminfo-urxvt
fix(termkey): use terminfo for (shift+)left/right keys
2026-03-31 18:07:08 -04:00
Matthew ChenandPhạm Bình An 410ba8374d fix(tutor): open a temporary copy instead of original file #38522
Problem:
`:Tutor` should open a copy of the tutor file instead of the original. This is
because edits modify the original file buffer, and crashes or other misuse could
potentially corrupt the original file even if it's WO.

Solution:
Copy the tutor file to a temp path before opening. Store the original path in
`b:tutor_file` so metadata json loading still works.

- `tutor#TutorCmd` will now copy the tutor file to a temp path via `tempname()`
  before opening with `drop`. Store the original path in `b:tutor_file` only
  after the buffer is created.
- `tutor#LoadMetadata` now uses `b:tutor_file` to resolve the JSON path instead
  of `expand('%')`, which now points to the temp copy buffer
- `ftplugin/tutor.vim` does not make the `tutor#LoadMetadata` call anymore. It
  was guarded by `filereadable(expand('%').'.json')` which fails for the new
  temp copy path logic . Instead, `tutor#LoadMetadata` is already called
  directly inside `tutor#TutorCmd` since we are already assumed to enable
  interactive.

Co-authored-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
2026-03-31 15:27:06 -04:00
luukvbaal 75e5e37942 fix(ui2): flicker when entering pager from expanded cmdline #38639
Problem:  'showcmd' causes flickering when pressing "g<" to enter the
          pager when the cmdline is expanded for messages.
          Initial keypress for an incomplete mapping is not giving 'showcmd'
          feedback while cmdline is expanded for messages (which is only
          dismissed upon the vim.on_key callback after 'timeoutlen').

Solution: Delay dismissing expanded cmdline when vim.on_key() callback
          receives "g".
          Place 'showcmd' "last" virtual text during expanded cmdline.
2026-03-31 15:01:58 -04:00
Christian Clason 953f9bc398 build(deps): bump tree-sitter to v0.26.8 2026-03-31 19:56:21 +02:00
Yi Ming e31bfb81ce fix(lsp): use winresetview() to avoid switching to normal mode (#38641) 2026-03-31 09:31:30 -07:00
luukvbaal cd2a27507a fix(window): clear cmdline 'ruler' when window is closed #38631
Problem:  When 'ruler' is in last line of the screen and the current
          floating window is closed, the ruler is not cleared.
Solution: When closing the current floating window, redraw the cmdline
          if that contained, and will no longer contain the 'ruler'.
2026-03-31 11:11:33 -04:00
luukvbaal 1685ced335 fix(cmdline): redraw cmdline after empty message (#38485)
Problem: Cmdline is not redrawn after an empty message clears it.
Remembered last drawn cursor position may be outdated but
equal to the current cmdline content with UI2.
Solution: Ensure cmdline is redrawn after an empty message clears it.
Compare wanted cursor position with actual cursor position.
2026-03-31 14:16:55 +02:00
altermoandzeertzjq 1bcf2d7f90 fix(treesitter): select with node ending with unicode char (#38557)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2026-03-31 13:03:18 +08:00
zeertzjq da58fe8fd2 fix(defaults): check for TUI on non-stdio channel on startup (#38581) 2026-03-31 11:17:33 +08:00
zeertzjq 96d6042689 test(tui_spec): work around flaky test with ASAN (#38619)
FAILED   test/functional/terminal/tui_spec.lua @ 2641: TUI exits immediately when stdin is closed #35744
test/functional/terminal/tui_spec.lua:2648: Failed to match any screen lines.
Expected (anywhere): "%[Process exited 1%]"
Actual:
  |^                                                  |
  |[Process exited 129]{100:                              }|
  |{100:~                                                 }|
  |{100:~                                                 }|
  |{3:[No Name]                                         }|
  |                                                  |
  |{5:-- TERMINAL --}                                    |
2026-03-31 02:26:23 +00:00
19fff0e0be vim-patch:9.2.0232: fileinfo not shown after :bd of last listed buffer (#38453)
Problem:  fileinfo not shown after :bd of last listed buffer
          (memeplex)
Solution: Set need_fileinfo to true in empty_curbuf()
          (Hirohito Higashi)

When deleting the last listed buffer with :bd, the new empty buffer's
file info (e.g. "[No Name]" --No lines in buffer--) was not displayed.
do_ecmd() only calls fileinfo() for existing buffers (oldbuf), not for
newly created empty buffers.

Set need_fileinfo in empty_curbuf() so the file info is displayed after
redraw.

fixes:  vim/vim#548
closes: vim/vim#19802

https://github.com/vim/vim/commit/3d472d86753c451ce6914f70161ffc40ee37ea96

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 09:13:54 +08:00
zeertzjq bc272cc36f test(tui_spec): unskip a few more tests on Windows (#38618) 2026-03-31 00:54:53 +00:00
dbc4800dda vim-patch:2844765: translation: do not add message location as comments into vim.pot (#38587)
Let's add the --no-location to the xgettext command line call, so that
the generated vim.pot file does not contain the message location. Those
will get out of date soon and we don't want to update vim.pot just
because the location in a comment changes.

https://github.com/vim/vim/commit/2844765e903214490e1494ec55d118b30fa45567

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-03-31 07:59:57 +08:00
zeertzjq a3a48392c5 fix(:restart): only pass --headless when there is no UI (#38580)
Change --embed so that the first UI can be on non-stdio channel even if
neither --headless nor --listen is passed.
2026-03-31 07:00:34 +08:00
Christian Clason 545007ac72 build(deps): bump luajit to 18b087cd2 2026-03-30 23:43:26 +02:00
Christian Clason e508aa0fa8 fix(ui2): allow empty argument for enable() #38605
Problem: `vim._core.ui2.enable` requires passing an empty table for
default options, unlike other (native) Lua API.

Solution: Initialize `opts` with empty table if `nil` is passed.
2026-03-30 16:47:02 +00:00
Ayush GoyalandLuuk van Baal f50e7d8205 fix(ui2): correct buffer reference in msg:start_timer() (#38600)
Problem:  Mixing "buf" and "M.bufs.msg" in M.msg:start_timer().
          Cannot run `require("vim._core.ui2").enable(nil)`.
Solution: Replace "M.bufs.msg" with "buf". Allow `opts == nil`.

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2026-03-30 16:36:45 +00:00
skewb1k 2dce2af768 docs: fix syntax errors in examples #38606 2026-03-30 11:49:30 -04:00
github-actions[bot] 183933998c docs: update version.c #38505
vim-patch:9.1.0333: tests: test_xdg fails on the appimage repo
vim-patch:9.1.0336: tests: typo in test_xdg
vim-patch:9.1.0339: tests: xdg test uses screen dumps
vim-patch:9.1.0347: A few typos in test_xdg when testing gvimrc
vim-patch:b9897ec27 runtime(xdg): remove // from 'undo' and 'viwedir'
vim-patch:2e9e7cb8e runtime(xdg): Move viminfofile storage to state dir
vim-patch:9.2.0255: tests: Test_popup_opacity_vsplit() fails in a wide terminal
vim-patch:9.2.0260: statusline not redrawn after closing a popup window
vim-patch:9.2.0261: terminal: redraws are slow
vim-patch:9.2.0264: Cannot disable kitty keyboard protocol in vim :terminal
vim-patch:9.2.0268: memory leak in call_oc_method()
vim-patch:9.2.0269: configure: Link error on Solaris

vim-patch:9.2.0258: memory leak in add_mark()
2026-03-30 11:02:32 -04:00
Yi Ming 57797ed7d4 feat(lsp): respect 'switchbuf' for jump commands, drop reuse_win #38510
Problem:
LSP jump operations such as `buf.definition`/`buf.type_definition` do
not follow the 'switchbuf' option. Instead their behavior is controlled
by `vim.lsp.LocationOpts.reuse_win`. When `reuse_win=true`, the effect
is very similar to `set switchbuf=useopen`.

Note that functions like `buf.definition` open the quickfix
window when there are multiple results, and jumping between quickfix
entries already follows 'switchbuf', so unifying the behavior is more
intuitive.

Solution:
Follow the 'switchbuf' option and drop `reuse_win`.

We can achieve this behavior by using :cfirst when the quickfix list has
only one item, rather than customizing the jump logic as before.
2026-03-30 10:54:55 -04:00
dependabot[bot] f062c6fd43 ci: bump msys2/setup-msys2 from 2.30.0 to 2.31.0 in the github-actions group across 1 directory (#38601)
ci: bump msys2/setup-msys2

Bumps the github-actions group with 1 update in the / directory: [msys2/setup-msys2](https://github.com/msys2/setup-msys2).


Updates `msys2/setup-msys2` from 2.30.0 to 2.31.0
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/msys2/setup-msys2/compare/4f806de0a5a7294ffabaff804b38a9b435a73bda...cafece8e6baf9247cf9b1bf95097b0b983cc558d)

---
updated-dependencies:
- dependency-name: msys2/setup-msys2
  dependency-version: 2.31.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-30 10:29:12 -04:00
zeertzjqandChristian Brabandt cbe142d3a4 vim-patch:068c060: runtime(rustfmt): not correctly escaping directory names (#38597)
Problem:  runtime(rustfmt): not correctly escaping directory names
Solution: Use fnamescape() (Michał Majchrowicz)

https://github.com/vim/vim/commit/068c0604c95e76f0f98984f908747deba94ed155

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-03-30 19:32:55 +08:00
zeertzjq 80e5ccdd44 refactor(buffer.c): fix coverity warning (#38589)
The NULL checks added in #35679 are no longer needed after #38473.

_____________________________________________________________________________________________
*** CID 645258:           (REVERSE_INULL)
/src/nvim/buffer.c: 645             in close_buffer()
639             // Autocommands deleted the buffer.
640             emsg(_(e_auabort));
641             return false;
642           }
643           buf->b_locked--;
644           buf->b_locked_split--;
>>>     CID 645258:           (REVERSE_INULL)
>>>     Null-checking "win" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
645           if (abort_if_last && win != NULL && one_window(win, NULL)) {
646             // Autocommands made this the only window.
647             emsg(_(e_auabort));
648             return false;
649           }
650         }
/src/nvim/buffer.c: 626             in close_buffer()
620           // Autocommands deleted the buffer.
621           emsg(_(e_auabort));
622           return false;
623         }
624         buf->b_locked--;
625         buf->b_locked_split--;
>>>     CID 645258:           (REVERSE_INULL)
>>>     Null-checking "win" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
626         if (abort_if_last && win != NULL && one_window(win, NULL)) {
627           // Autocommands made this the only window.
628           emsg(_(e_auabort));
629           return false;
630         }
631
2026-03-30 14:50:12 +08:00