Commit Graph

36029 Commits

Author SHA1 Message Date
marvim
8b0b58fde6 docs: update version.c 2026-04-06 04:09:40 +00:00
zeertzjq
1fcd849d40 Merge pull request #38751 from zeertzjq/vim-9.2.0291
vim-patch:9.2.{0291,0293}
2026-04-06 12:01:12 +08:00
zeertzjq
870e50f0ff vim-patch:9.2.0293: :packadd may lead to heap-buffer-overflow
Problem:  :packadd may lead to heap-buffer-overflow when all entries in
          'runtimepath' have the same length (after 9.2.0291).
Solution: Check for comma after current entry properly (zeertzjq).

related: vim/vim#19854
closes:  vim/vim#19911

bc182ae56e
2026-04-06 11:47:44 +08:00
zeertzjq
4d7dfa081b vim-patch:9.2.0291: too many strlen() calls
Problem:  too many strlen() calls
Solution: refactor concat_fname() and remove calls to strlen()
          (John Marriott)

Function `concat_fnames()` can make up to 5 calls to `STRLEN()` (either
directly or indirectly via `STRCAT()`). In many cases the lengths of
arguments `fname1` and/or `fname2` are either known or can simply be
calculated.

This Commit refactors this function to accept the lengths of arguments
`fname1` and `fname2` as arguments. It also adds new argument `ret` to
return the resulting string as a `string_T`.

Additionally:
- function `add_pack_dir_to_rtp()` in `scriptfile.c`:
   Use a `string_T` to store local variables `new_rtp` and `afterdir`.
   Replace calls to `STRCAT()` with calls to `STRCPY()`.
   Change type of variable `keep` to `size_t` for consistency with
   other lengths.

- function `qf_get_fnum()` in `quickfix.c`:
  Use a `string_T` to store local variables `ptr` and `bufname`
- function `qf_push_dir()` in `quickfix.c`:
  Use a `string_T` to store local variable `dirname`.
  Replace call to `vim_strsave()` with `vim_strnsave()`.

- function `qf_guess_filepath()` in `quickfix.c`:
  Use a `string_T` to store local variable `fullname`.

- function `make_percent_swname()` in `memline.c`:
  Rename some variables to better reflect their use.
  Use a `string_T` to store local variables `d` and `fixed_name`.
  Slightly refactor to remove need to create an extra string.
- function `get_file_in_dir()` in `memline.c`:
  Use a `string_T` to store local variables `tail` and `retval`.
  Move some variables closer to where they are used.

- function `cs_resolve_file()` in `if_cscope.c`:
  Use a `string_T` to store local variable `csdir`.
  Remove one call to `STRLEN()`.

- function `add_pathsep()` in `filepath.c`:
  Refactor and remove 1 call to `STRLEN()`

- function `set_init_xdg_rtp()` in `option.c`:
  Use a `string_T` to store local variable `vimrc_xdg`.

closes: vim/vim#19854

cb51add7ae

Co-authored-by: John Marriott <basilisk@internode.on.net>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-06 11:47:44 +08:00
zeertzjq
4aa8969d29 vim-patch:9.2.0299: runtime(zip): may write using absolute paths (#38810)
Problem:  runtime(zip): may write using absolute paths
          (syndicate)
Solution: Detect this case and abort on Unix, warn in the documentation
          about possible issues

46f530e517

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-06 10:15:19 +08:00
Justin M. Keyes
42f6c55139 Merge #38796 from justinmk/doc2 2026-04-05 20:36:45 -04:00
Evgeni Chasnovski
157c7bccb0 fix(pack): avoid eager vim.version call #38705
Problem: Commands that rely on Git may need its version to perform more
  targeted actions (like decide which arguments are safe to use).
  For performance, computing this version is delayed up until it is
  needed (like to not compute on regular startup), but not done before
  every Git operation (as it is too much and can be done better).

  This requires storing the Git version in a variable which is currently
  initiated via `vim.version.parse()` call (most probably because it was
  easier to handle Lua types this way).

  However, the problem is that this results in sourcing `vim.version`
  and computing `vim.version.parse` on every startup even if no Git
  operation would be done.

Solution: Don't call `vim.version.parse()` during `require('vim.pack')`
  and ensure its more precise lazy computation.
2026-04-05 20:35:14 -04:00
Justin M. Keyes
6b796696c3 docs: statusline
fix https://github.com/neovim/neovim/issues/38670
2026-04-06 02:29:29 +02:00
Olivia Kinnear
13faa0ef84 feat(defaults): :Open without args opens current file #38776
Problem:
Running `:Open` on an open buffer does not run `vim.ui.open()` on that file, requiring the user to type `:Open %`. This is inconsistent with most other vim commands which accept files, which default to the current buffer's file.

Solution:
Default to the current file when `:Open` is used without arguments.
2026-04-05 19:46:45 -04:00
Elijah Koulaxis
bba48ee1b0 fix(windows): force console codepage to UTF-8 for shell/system() #38742
Problem:
On Windows, `:!echo тест` shows `????` because the console code page defaults to a legacy ANSI encoding (e.g. CP1252) instead of `UTF-8`

Solution:
Call `SetConsoleOutputCP(CP_UTF8)` and `SetConsoleCP(CP_UTF8)` in `do_os_system()` before spawning child processes, and restore the original values after. It covers both `:!` and `system()` since they both go through `do_os_system()`
2026-04-05 19:16:48 -04:00
Yi Ming
909fc0b992 fix(lsp): do not respond to codelens refresh if a request is already scheduled (#38801) 2026-04-05 13:54:27 -07:00
Tom Ampuero
6d420feaef fix(net): handle remote archive URLs via tar/zip browse #38744
Problem:
Opening .tar.gz or .zip URLs shows raw binary instead of using the archive plugins.

Solution:
Similar to the original netrw implementation, the autocmd should detect
archive URLs, download them to a temp file and the open them with
tar/zip handlers already bundled as vim plugins.
2026-04-05 15:22:26 -04:00
Jibril
cfbac23235 fix(coverity): coverity/530031, coverity/530027 resource leaks #37916
Fixed resource leak caused by overwriting lp->sl_midword by freeing
lp->sl_midword first.
2026-04-05 15:08:30 -04:00
Yochem van Rosmalen
398ee83f4f fix(vim.net): check if vim.system's stdout is nil #38713
Problem:
Apparently vim.SystemCompleted.stdout can also be nil, even without a
custom stdout handler. (Although the docs can be interpreted otherwise).

Solution:
Explicitly check for nil and set the result body to an empty string if
stdout was nil.
2026-04-05 13:11:59 -04:00
Evgeni Chasnovski
3cba8df041 fix(pack): use uv.available_parallelism() to compute number of threads #38717
Problem: Computing number of threads for parallel asynchronous
  computation using `uv.cpu_info()` can be slow. This is especially
  noticeable since it is pre-computed on every `require('vim.pack')` and
  not only when parallelism is needed.

Solution: Use `uv.available_parallelism()` to compute number of threads
  in a helper function.
2026-04-05 13:06:00 -04:00
Justin M. Keyes
57457f227d docs: bump minimum required Win 10 to version 2004
see https://github.com/neovim/neovim/issues/32367#issuecomment-4188641644
2026-04-05 18:22:59 +02:00
zeertzjq
9705a1c13b fix(help): show error when using :help! with nothing at cursor #38775
It's possible to still show the old Easter egg, but then the user won't
know about the new feature, so showing E349 is better.
2026-04-05 10:59:22 -04:00
github-actions[bot]
38c32aa029 docs: update version.c #38752
vim-patch:9.2.0286: still some unnecessary (int) casts in alloc()
vim-patch:9.2.0288: libvterm: signed integer overflow parsing long CSI args
vim-patch:bd8b6c6b0 CI: Bump codecov/codecov-action
vim-patch:9.2.0294: if_lua: lua interface does not work with lua 5.5
vim-patch:9.2.0297: libvterm: can improve CSI overflow code

vim-patch:8.2.0356: MS-Windows: feedkeys() with VIMDLL cannot handle CSI
vim-patch:8.2.0647: MS-Windows: repeat count for events was not used
2026-04-05 10:51:18 -04:00
luukvbaal
2663f51890 fix(ui2): update spill indicator when appending to expanded cmdline #38715
Problem:  When messages are appended to an already expanded cmdline,
          the spilled lines indicator is not updated.
Solution: Remove early return for updating virtual text while cmdline is
          expanded, guard updating "msg" virt_text at callsite instead.
2026-04-05 09:48:38 -04:00
dundargoc
bebf949f1f build(cmake): allow ignoring deps sha
Followup to 39335d6a7d.
2026-04-05 11:29:55 +02:00
Christian Clason
39335d6a7d build(cmake): allow ignoring deps sha
Problem: Specifying an URL (e.g., Github URL for a PR commit) on the
command line does not work since it will check it against the pinned
checksum.

Solution: Allow overriding `DEPS_IGNORE_SHA` from the command line as
well.
2026-04-05 00:08:56 +02:00
zeertzjq
9927d9259d fix(:restart): inherit stderr fd on Unix (#38755)
This in turn gives TTY access to channel_from_stdio() in the new server,
if the old server has access to a TTY.
2026-04-04 21:57:27 +08:00
zeertzjq
e20c4ea966 fix(channel): crash on exit after closing v:stderr channel (#38754)
Problem:  Crash on exit after closing v:stderr channel when piping
          to stdin.
Solution: Reopen stderr as /dev/null or NUL instead of closing it.
          This also avoids writing to an related file if one is opened
          after closing v:stderr.
2026-04-04 20:54:27 +08:00
zeertzjq
c62f8538a6 vim-patch:5943c57: runtime(zathurarc): Update page-padding, wrap the zathurarcOption keywords (#38759)
page-padding was split in page-v-padding and page-h-padding

closes: vim/vim#19899

5943c57173

Co-authored-by: Carlo Klapproth <6682561+elcarlosIII@users.noreply.github.com>
2026-04-04 20:50:16 +08:00
zeertzjq
426cbfbd76 vim-patch:9.2.0298: Some internal variables are not modified (#38758)
Problem:  Some internal variables are not modified
Solution: Add const qualifier to static table data
          (Hirohito Higashi).

Several static arrays that are never modified at runtime were missing the
const qualifier. Add const to move them from .data to .rodata section.

closes: vim/vim#19901

3c79e33aeb

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-04-04 20:50:01 +08:00
zeertzjq
e2bced7703 vim-patch:9.2.0296: Redundant and incorrect integer pointer casts in drawline.c (#38757)
Problem:  Currently `colnr_T` and `int` and the same type, so casting
          `int *` to `colnr_T *` is redundant. Additionally, even if
          they are changed to different types in the future, these casts
          are incorrect as they won't work on big-endian platforms.
Solution: Remove the casts. Also fix two cases of passing false instead
          of 0 to an integer argument (zeertzjq).

related: vim/vim#19672
closes:  vim/vim#19907

18cd55dbc4
2026-04-04 20:49:43 +08:00
zeertzjq
d10dda8a47 vim-patch:9.2.0295: 'showcmd' shows wrong Visual block size with 'linebreak' (#38756)
Problem:  'showcmd' shows wrong Visual block size with 'linebreak' after
          end char (after 7.4.467).
Solution: Exclude 'linebreak' from end position. Also fix confusing test
          function names.

closes: vim/vim#19908

08bd9114c1
2026-04-04 20:49:26 +08:00
bfredl
b64d96ed8d Merge pull request #38741 from dchinmay2/push-qzzkxtlkrquz
build(zig): update version
2026-04-04 10:34:47 +02:00
zeertzjq
164dfa1d5f vim-patch:9.2.0289: 'linebreak' may lead to wrong Visual block highlighting (#38749)
Problem:  'linebreak' may lead to wrong Visual block highlighting when
          end char occupies multiple cells (after 7.4.467).
Solution: Exclude 'linebreak' from the ending column instead of setting
          'virtualedit' temporarily (zeertzjq).

fixes:  vim/vim#19898
closes: vim/vim#19900

23be1889d1
2026-04-04 08:58:17 +08:00
zeertzjq
d769fde8c9 Merge pull request #38738 from zeertzjq/vim-9.2.0267
vim-patch:9.2.0267,af58a9f
2026-04-04 06:24:07 +08:00
zeertzjq
20e46cb38d vim-patch:af58a9f: runtime(doc): adjust :h 'autowrite' and :h 'autowriteall'
- Don't go over 78 columns.
- Change the first "and" to "or", as "or" is used below.
- Change "takes one" to "switches", as "one" may be mistaken as
  referring to the command instead of the user.
- Use backticks in :h 'autowriteall' like in :h 'autowrite'.

closes: vim/vim#19859

af58a9f5e9
2026-04-04 06:04:28 +08:00
zeertzjq
76a917a81e vim-patch:9.2.0267: 'autowrite' not triggered for :term
Problem:  'autowrite' not triggered for :term
Solution: Trigger autowrite for :term command
          (rendcrx)

closes: vim/vim#19855

466b5f531a

Co-authored-by: rendcrx <974449413@qq.com>
2026-04-04 06:04:25 +08:00
Chinmay Dalal
c8a7604307 build(zig): update version 2026-04-03 13:42:03 -04:00
github-actions[bot]
b346b87fb2 docs: update version.c #38625
vim-patch:f4f175332 translation(ru): updated the Russian man page the xxd
vim-patch:e4502b603 translation(ru): updated lang/README.ru.txt
vim-patch:2c976d0de SECURITY.md: clarify the use of AI
vim-patch:9.2.0279: terminal: out-of-bounds write with overlong CSI argument list
vim-patch:9d83ca5ca runtime(preproc_indent): Ignore Swapfiles when loading buffers

Co-authored-by: marvim <marvim@users.noreply.github.com>
2026-04-03 10:41:17 -04:00
zeertzjq
33b9a9dcf1 vim-patch:880cf88: runtime(doc): Various fixes for ft_rust.txt (tw78, grammar, spaces) (#38730)
closes: vim/vim#19887

880cf88ea6

Co-authored-by: Peter Kenny <github.com@k1w1.cyou>
2026-04-03 21:38:44 +08:00
zeertzjq
333e3178ec vim-patch:9.2.0287: filetype: not all ObjectScript routines are recognized (#38731)
Problem:  filetype: not all ObjectScript routines are recognized
Solution: Also detect "%RO" and "iris" patterns inside *.rtn files
          (Hannah Kimura)

closes: vim/vim#19873

863e85e00a

Co-authored-by: Hannah <hannah.kimura@intersystems.com>
2026-04-03 18:26:04 +08:00
zeertzjq
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

ff6f277a4d

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

b7cffc8434
2026-04-03 09:22:26 +00:00
zeertzjq
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

12f6f20552

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](4aaf0e03a9...3c06f323a5)

---
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
zeertzjq
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

7088926316

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