Commit Graph

35657 Commits

Author SHA1 Message Date
Justin M. Keyes
4fb0f95330 Merge #38196 ci: fix issues flagged by Zizmor 2026-03-10 06:47:18 -04:00
zeertzjq
c1dcb8dac2 vim-patch:9.2.0131: potential buffer overflow in regdump() (#38217)
Problem:  Potential buffer overflow in regdump()
Solution: Add the size to the compiled regular expression and ensure we
          don't read over the limit.

Note: this is not a security issue, because regdump() is typically not
compiled in any version of Vim, so should not affect anybody.

supported by AI claude.

9360647715

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-03-10 10:47:07 +08:00
Daniel Hast
ed767a6a69 ci: ignore known Zizmor findings
This avoids false positives from existing uses of `GITHUB_ENV` and
`pull_request_target` that are safe, as well as from cache usage in a
workflow that doesn't produce release artifacts.
2026-03-09 21:40:50 -04:00
Daniel Hast
3572bf7e16 ci: eliminate template expansion in code contexts
Replace all template expansions in code contexts with environment
variable substitutions. Template expansion in code contexts can be a
source of code injection vulnerabilities; for more info, see:
https://docs.zizmor.sh/audits/#template-injection
2026-03-09 21:40:39 -04:00
Daniel Hast
755087f8ef ci: set default permissions for workflows
The default workflow permissions are overly broad; setting permissions
explicitly at the workflow level ensures excessive permissions are not
unintentionally granted to jobs. For details, see:
https://docs.zizmor.sh/audits/#excessive-permissions
2026-03-09 21:36:20 -04:00
Daniel Hast
63844b7904 ci: don't persist git credentials on disk
Set `persist-credentials: false` for all uses of `actions/checkout`.
This prevents git credentials from being stored on disk, and fixes the
following Zizmor audit:
https://docs.zizmor.sh/audits/#artipacked
2026-03-09 21:36:20 -04:00
Daniel Hast
d1314018cc ci: pin third-party action dependencies to commit hashes
This improves CI security by ensuring that action dependencies cannot be
changed by upstream repositories without updating the use of the
dependency in this repo.

Official GitHub-maintained actions are excluded from this requirement
and are left pinned by a tag instead of a commit hash. This action
dependency pinning policy is codified in `.github/zizmor.yml` so that
Zizmor (a static analysis tool for GitHub Actions) doesn't flag these as
unpinned dependencies.

Also add cooldown timer for Dependabot. This fixes these two Zizmor
audits:
* https://docs.zizmor.sh/audits/#dependabot-cooldown
* https://docs.zizmor.sh/audits/#unpinned-uses
2026-03-09 21:36:20 -04:00
zeertzjq
9734a6ce47 vim-patch:9.2.0130: missing range flags for the :tab command (#38216)
Problem:  :tab accepts a tab address range but doesn't specify this in
          the command specification.
Solution: Add EX_RANGE and EX_ZEROR to the command specification and use
          ADDR_TABS (Doug Kearns).

As command modifers are handled separately before these flags are tested
in the ex-command parser they have no effect.  However, it's better to
use an accurate description and the command specification table has uses
in other areas like runtime file generation for the Vim filetype.

closes: vim/vim#19100

49b8d9903b

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-03-10 09:15:52 +08:00
zeertzjq
29fa072b34 vim-patch:partial:9.2.0126: String handling can be improved (#38214)
Problem:  String handling can be improved
Solution: Pass string length where it is known to avoid strlen() calls,
          do a few minor refactors (John Marriott).

This commit changes some calls to function `set_vim_var_string()` to pass
the string length where it is known or can be easily calculated.

In addition:
In `evalvars.c`:
  * In function `set_reg_var()` turn variable `regname` into a C string
    because that is how it used.
  * Small cosmetics.
In `option.c`:
  * Slightly refactor function `apply_optionset_autocmd()` to move some
    variables closer to where they are used.
In `getchar.c`:
  * Slightly refactor function `do_key_input_pre()`:
    -> change call to `dict_add_string()` to `dict_add_string_len()` and
       pass it the length of `buf`.
    -> only call `get_vim_var_string()` once.
In `message.c`:
  * Use a `string_T` to store local variable `p`.
In `normal.c`:
  * Move some variables closer to where they are used.

closes: vim/vim#19618

727f6e2686

Co-authored-by: John Marriott <basilisk@internode.on.net>
2026-03-10 09:13:30 +08:00
luukvbaal
a81b059a45 fix(messages): non-fast and append for "shell_*" kinds #38188
Problem:  vim.ui_attach() is unable to display streamed shell output,
          and will display it as individual messages.
          Unwanted newlines in "shell_ret" message.
Solution: Treat the "shell_*" kinds as non-fast and set msg_show->append
          for the streamed stdout/err messages.
          Remove leading newline from (translated) message with
          ext_messages, remove trailing newline altogether.
2026-03-09 19:24:01 -04:00
Stefan Novaković
bffca6e26b feat(extmark): support end_col=-1 if strict=false #28169
Problem:
There is an inconsistency between extmarks/highlights regarding the
`end_col` param.

Solution:
Allow end_col=-1 to mean "end of line" (if strict=false).

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-03-09 19:20:25 -04:00
Justin M. Keyes
dce8bdd247 Merge #38117 from noib3/fix-lua-lints-in-src 2026-03-09 18:16:01 -04:00
Riccardo Mazzarini
92b2a26772 fix: resolve all remaining LuaLS warnings in src/ 2026-03-09 21:47:15 +01:00
Riccardo Mazzarini
9204b7541d fix: silence LuaLS's no-unknown warnings in src/ 2026-03-09 21:47:15 +01:00
Riccardo Mazzarini
7fdf9f7399 fix: define vim.mpack
We define vim.mpack so that LuaLS doesn't emit undefined-field warnings
when using it, annotated with @nodoc to skip doc generation.
2026-03-09 21:47:13 +01:00
Riccardo Mazzarini
71829510b9 refactor: make LuaLS run diagnostics on all files in src/
Not just files open in an editor
2026-03-09 21:26:11 +01:00
Justin M. Keyes
3b94ab296f Merge #38206 nvim_win_set_config 2026-03-09 15:56:24 -04:00
rok
c4c2112b5d fix(runtimepath): crash in :packadd splice optimization #38129
Problem:
After #37722 splice optimization for :packadd, nvim crashes with SIGSEGV
on startup while running `runtime! lua/xxx/*` and sourced file executes
multiple `:packadd`.

Solution:
While `do_in_cached_path` is executing, it doesn't expect reference to
runtime_search_path changes. But when callback is called, and
add_pack_dir_to_rtp does 'splice' it may trigger realloc, and change
address. Check runtime_search_path_ref to prevent ref held by
do_in_cached_path changes.
2026-03-09 15:22:48 -04:00
Justin M. Keyes
de4f4dc807 Merge #37985 fix(lsp): adjust codelens position by range, ensure first-line visibility 2026-03-09 14:48:30 -04:00
Sean Dewar
4362132b10 fix(api): don't re-apply minimal style if unchanged #38152
Problem: nvim_win_set_config with style=minimal re-applies option values even if
the new style is unchanged from the old. This may be undesirable after #38122.

Solution: don't bother in this case.

See https://github.com/neovim/neovim/pull/38122#issuecomment-3996994189.
A reversal of https://github.com/neovim/neovim/pull/22865#discussion_r1161598973
so its associated test has been updated.
2026-03-09 14:28:36 -04:00
Evgeni Chasnovski
47dedb55fc docs(pack): simpify update() docs, fix directory path #38194
Problem: Documentation of `vim.pack.update()` contains a lot of text
 inside nested list. This might be a bit confusing to parse for humans
 and definitely confusing to parse for neovim.io.

 The description of `vim.pack` directory is not correct for Windows.

Solution: Move description of confirmation buffer in a separate
  "subsection".

  Use '"data" standard path' instead of '$XDG_DATA_HOME/nvim' when
  documenting directory. Also use `|standard-path|` tag to link to
  standard path section instead of `|stdpath()|`.
2026-03-09 12:49:01 -04:00
github-actions[bot]
1684ff9ded docs: update version.c #38084
vim-patch:9.2.0062: Using the wrong field with DAP channel mode
vim-patch:9.2.0064: popup: opacity feature causes flickering
vim-patch:9.2.0071: Vim9: lambda function deleted on re-sourcing
vim-patch:9.2.0082: Patch v9.2.0052 was wrong
vim-patch:9.2.0084: Vim9: isn_get_calltype() can be improved
vim-patch:a6550d571 translation: regenerate po/vim.pot after v9.2.0083
vim-patch:9.2.0086: Coverity complains that ScreenLines can be NULL
vim-patch:9.2.0087: popup: redrawing can be improved when moving popups
vim-patch:5a4291d34 runtime(osc52): Omit paste from the osc52 provider when g:osc52_disable_paste is enabled
vim-patch:93cb5e544 translation: regenerate po/vim.pot after v9.2.0088
vim-patch:9166f1c09 translation: regenerate po/vim.pot after v9.2.0093
vim-patch:f7a568ebe runtime(syntax-tests): regenerate dump files (after v9.2.0093)
vim-patch:22c62e269 runtime(syntax-tests): regenerate dump files (after v9.2.0110)
vim-patch:bd77d327d runtime(doc): remove thoughts of generics for a function
vim-patch:9.2.0114: MS-Windows: terminal output may go to wrong terminal
vim-patch:49b81793f runtime(docs): Update CONTRIBUTING.md and mention #vim on libera
vim-patch:9.2.0123: GTK: using deprecated gdk_pixbuf_new_from_xpm_data()

Co-authored-by: marvim <marvim@users.noreply.github.com>
2026-03-09 11:35:38 -04:00
glepnir
69419f8b3e fix(completion): CompleteDone reason="discard" when candidate text remains #38169
Problem: CompleteDone fires with reason="discard" even when the candidate
text was inserted and left in the buffer, because reason was determined
solely by the terminating keycode (Ctrl-Y).

Solution: Check compl_used_match to detect whether inserted
text remains in the buffer, and set reason="accept" accordingly.
2026-03-09 07:58:13 -04:00
Yi Ming
d53d542359 fix(lsp): stop and close timer when Capability is destroyed 2026-03-09 11:40:08 +00:00
Sean Dewar
0ee8323f2b fix(api): unnecessary errors when not moving split
Problem: nvim_win_set_config may raise unnecessary errors when not moving a
split.

Solution: skip checks related to moving when only maybe resizing a split.
2026-03-09 00:51:34 +00:00
Sean Dewar
e13e850517 fix(api): redraw after setting minimal style
Problem: No explicit redraw after setting style=minimal in nvim_open_win or
nvim_win_set_config, which may cause it to appear like it's not set.

Solution: call changed_window_setting after applying the style, which should be
enough for these options.
2026-03-09 00:23:08 +00:00
Daniel Müller
61f166ec40 fix(textformat): don't swallow "space" with auto-formatting enabled (#38181)
vim-patch:9.2.0124: auto-format may swallow white space

Problem:  With auto paragraph formatting enabled, when a user makes an
          attempt to add a new word before the end of a line and with
          the following space bringing the line width over 'textwidth',
          the space ends up just getting swallowed by the editor.
Solution: Detect such a constellation and do not auto-format in that
          case (Daniel Müller).

closes: vim/vim#19593

24fd698045
2026-03-08 23:58:14 +00:00
zeertzjq
9a9b9c581c vim-patch:9.2.0121: patch memory leak in list_extend_func() in list.c (#38205)
Problem:  memory leak in list_extend_func() in list.c
Solution: Free l1 on early return (Huihui Huang)

closes: vim/vim#19572

7ed37dc534

Co-authored-by: Huihui Huang <625173@qq.com>
2026-03-09 07:44:20 +08:00
zeertzjq
60b997b71d vim-patch:2c1269f: runtime(zip): Make ZipUpdatePS() check that shell is powershell (#38204)
fixes: vim/vim#19576

2c1269f0d3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-03-09 07:44:04 +08:00
zeertzjq
4d3bd0bfdc Merge pull request #38203 from zeertzjq/vim-9.2.0120
vim-patch:9.{1.1484,2.0120,2.0125}
2026-03-09 07:38:49 +08:00
zeertzjq
f21c56da84 vim-patch:9.2.0125: tests: test_textformat.vim leaves swapfiles behind
Problem:  tests: test_textformat.vim leaves swapfiles behind
Solution: Close open buffer using :bw! instead of :close!

271f4fe47b

N/A patches:
vim-patch:9.2.0122: Vim still supports compiling on NeXTSTEP
vim-patch:bab7619: runtime(doc): Update intro.txt about Neovim

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-03-09 07:05:47 +08:00
zeertzjq
f1e65bde02 vim-patch:9.2.0120: tests: test_normal fails
Problem:  tests: test_normal fails
Solution: Ensure the terminal width is 40 columns and also
          check for existence of the tr.mo file

closes: vim/vim#19608

123a1e6410

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-03-09 07:05:47 +08:00
zeertzjq
504327020d vim-patch:9.1.1484: tests: Turkish locale tests fails on Mac
Problem:  tests: Turkish locale tests fails on Mac
          (after v9.1.1480)
Solution: skip the test Test_pos_percentage_in_turkish_locale() on Mac

223189389a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-03-09 07:05:46 +08:00
Sean Dewar
137d5ab01d fix(api): merge split window config only on success
Problem: nvim_win_set_config may merge configs despite failing to configure a
split, and without applying necessary side-effects (like setting style=minimal
options). Plus, autocommands may apply a different config after the merge,
causing side-effects to apply for an outdated config.

Solution: merge configs last, only on success. Include fields only relevant to
splits. Properly set _cmdline_offset for splits.

Maybe better to disallow _cmdline_offset for splits instead, as the pum is
relative to cmdline_row anyway? (I didn't want to change behaviour too much)

Also use expect_unchanged in an unrelated test to quash a warning.
2026-03-08 19:41:33 +00:00
Sean Dewar
65a1709112 refactor(api): move split handling logic out
It was getting unwieldy.
2026-03-08 19:41:33 +00:00
Sean Dewar
f5d03ec930 fix(api): style=minimal not applied immediately for unmoved split
Problem: nvim_win_set_config with style="minimal" does not take immediate effect
when a split is not moved.

Solution: don't skip nvim_win_set_config's epilogue when only a resize may be
needed. De-duplicate resize logic and remove unnecessary redraw. (win_set*_win
already handles that)
2026-03-08 19:41:33 +00:00
altermo
72d3a57f27 feat(treesitter): incremental selection
Co-authored-by: György Andorka <gyorgy.andorka@protonmail.com>
2026-03-08 11:07:49 +01:00
Yi Ming
40dc2d02a8 fix(lsp): ensure the codelens on the first line is visible 2026-03-08 11:32:50 +08:00
Yi Ming
378435968f fix(lsp): adjust codelens position based on the server-provided range 2026-03-08 10:42:38 +08:00
Christian Clason
e8e694d837 build(deps): bump libuv to v1.52.1 2026-03-07 19:49:10 +01:00
Christian Clason
908591c61c refactor(lua): adapt to Stylua 2.4.0 2026-03-07 18:23:35 +01:00
zeertzjq
60389e1c0e vim-patch:e948fea: runtime(sed): Update syntax, support more GNU address extensions (#38193)
- Support all GNU address extensions.
- Fix some bugs related to erroneous matching of pattern delimiters in
  bracket expressions.

closes: vim/vim#19587

e948fea640

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-03-07 19:02:29 +08:00
Stefan VanBuren
d8e03d5d5a fix(treesitter): escape hyphen in lua pattern
Ref: https://github.com/neovim/neovim/pull/38140#discussion_r2897235978
2026-03-07 11:08:34 +01:00
zeertzjq
f1c82be1a1 test(shell-test): call tcdrain() on stdout and stderr on exit (#38177)
Similar to #38154, shell-test also has the same problem on FreeBSD:

FAILED
1 test, listed below:
FAILED
test/functional/terminal/ex_terminal_spec.lua @
237:
:terminal (with fake shell) executes a given command through the shell
test/functional/terminal/ex_terminal_spec.lua:239: Row 1 did not match.
Expected:
  |*^ready $ echo hi                                   |
  |*                                                  |
  |*[Process exited 0]                                |
  |                                                  |
Actual:
  |*^                                                  |
  |*[Process exited 0]                                |
  |*                                                  |
  |                                                  |
To print the expect() call that would assert the current screen state, use
screen:snapshot_util(). In case of non-deterministic failures, use
screen:redraw_debug() to show all intermediate screen states.
Snapshot:
screen:expect([[
  ^                                                  |
  [Process exited 0]                                |
                                                    |*2
]])
stack traceback:
	test/functional/ui/screen.lua:909: in function '_wait'
	test/functional/ui/screen.lua:537: in function 'expect'
	test/functional/terminal/ex_terminal_spec.lua:239: in function <test/functional/terminal/ex_terminal_spec.lua:237>

Running the test repeatedly somehow doesn't trigger the problem, but as
mentioned in #36792 a similar problem has also happened previously.
2026-03-07 11:28:35 +08:00
luukvbaal
b6c020eb59 fix(ui2): ensure expanded cmdline is closed after :<Esc> (#38187)
Problem:  Expanded cmdline is left open after entering the cmdline again
          without entering a command that emits another message (after 301c7065).
Solution: Wait for msg_show to reinstate the vim.on_key() handler.
          If there was no message close the expanded cmdline.
2026-03-07 00:40:01 +00:00
Marc Jakobi
34a59e30db docs(api): clarify nvim_win_set_buf documentation #37201 2026-03-06 13:34:47 -05:00
luukvbaal
301c7065ca fix(ui2): only highlight Ex command lines in the cmdline #38182
Problem:  Prompts and message text (in block mode) in the cmdline are
          parsed and highlighted as if it is Vimscript.
          Entering the cmdline while it is expanded can work more like
          it does with UI1, where the press enter prompt is replaced
          and previous messages stay on the message grid, while
          subsequent messages are placed below it.
Solution: Highlight manually with string parser on lines starting with ':'.
          Spoof cmdline block mode when the cmdline is entered while it
          is expanded.
2026-03-06 13:29:20 -05:00
Yochem van Rosmalen
ac6cf5b03b fix(gen): alias /doc/user/helptag.html to /doc/user/helptag/ #38156
Problem:
helptag.html is used to search for the online help documentation of a
specified tag. The previous URL was `/doc/user/helptag.html` but that
switched to `/doc/user/helptag/` in
https://github.com/neovim/neovim.github.io/pull/437. The alias of the
.html page was added to all other doc pages but forgotten for the
helptag.html page

Solution:
Add the alias to the helptag.html page too
2026-03-06 13:20:40 -05:00
luukvbaal
fde1c07891 fix(cmdline): cmdline_block events for :lua debug.debug() #38171
Problem:  :lua debug.debug() is missing cmdline_block events.
Solution: Emit cmdline_block_show/append/hide events for :lua
          debug.debug().
2026-03-06 13:17:12 -05:00
luukvbaal
6275f533d1 fix(ui2): immediately open target windows on new tabpage (#38170)
Problem:  Previous tests for this relied on other events opening the
          targets, which are not guaranteed to happen.
Solution: Open target windows when entering a new tabpage.
2026-03-06 17:32:17 +01:00