Commit Graph

35979 Commits

Author SHA1 Message Date
nameearly
49133b4f77 refactor(typval.c): fix wrong argument to macro (#38813)
(cherry picked from commit eb9be11da8)
2026-04-06 04:32:05 +00:00
zeertzjq
bf084967d7 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>
(cherry picked from commit 4aa8969d29)
2026-04-06 02:39:21 +00:00
Justin M. Keyes
f92a68d4bc docs: statusline
fix https://github.com/neovim/neovim/issues/38670

(cherry picked from commit 6b796696c3)
2026-04-06 01:24:32 +00:00
Justin M. Keyes
eac20cd17f docs: bump minimum required Win 10 to version 2004
see https://github.com/neovim/neovim/issues/32367#issuecomment-4188641644

(cherry picked from commit 57457f227d)
2026-04-06 01:24:32 +00:00
Evgeni Chasnovski
35a9bf8785 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.
(cherry picked from commit 157c7bccb0)
2026-04-06 01:18:37 +00:00
Elijah Koulaxis
d660233edf 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()`

(cherry picked from commit bba48ee1b0)
2026-04-05 23:47:51 +00:00
Yi Ming
c692e848e9 fix(lsp): do not respond to codelens refresh if a request is already scheduled (#38801)
(cherry picked from commit 909fc0b992)
2026-04-05 21:15:28 +00:00
Tom Ampuero
6cb439ac9e 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.

(cherry picked from commit 6d420feaef)
2026-04-05 20:32:59 +00:00
Yochem van Rosmalen
e7a07364ad 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.

(cherry picked from commit 398ee83f4f)
2026-04-05 19:24:57 +00:00
Evgeni Chasnovski
fdf94493cf 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.
(cherry picked from commit 3cba8df041)
2026-04-05 17:44:08 +00:00
zeertzjq
4bf170d79d 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.

(cherry picked from commit 9705a1c13b)
2026-04-05 15:55:29 +00:00
luukvbaal
bac7c3a996 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.
(cherry picked from commit 2663f51890)
2026-04-05 14:10:13 +00:00
dundargoc
38b5cfc74a build(cmake): allow ignoring deps sha
Followup to 39335d6a7d.

(cherry picked from commit bebf949f1f)
2026-04-05 11:30:43 +00:00
zeertzjq
415626d46d 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.

(cherry picked from commit 9927d9259d)
2026-04-04 14:25:27 +00:00
zeertzjq
6ef5f59be6 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.
(cherry picked from commit e20c4ea966)
2026-04-04 13:27:26 +00:00
zeertzjq
58cc2fdc5f 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
(cherry picked from commit d7ef77d175)
2026-04-03 09:52:07 +00:00
zeertzjq
304c0ac9f9 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>
(cherry picked from commit 3cb79189f3)
2026-04-02 23:23:05 +00:00
zeertzjq
d7898dc1e6 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>

(cherry picked from commit 596a7a32f3)
2026-04-02 15:09:15 +00:00
altermo
9f16ad8ca3 fix(treesitter): select reset to "v" visualmode()
(cherry picked from commit facc21cc63)
2026-04-02 13:49:39 +00:00
zeertzjq
8a79d3a3bb feat(:restart): reattach all UIs (#38683)
This is quite easy since [command] is now only executed once on UIEnter.
2026-04-02 21:45:04 +08:00
zeertzjq
e5792f6353 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.
(cherry picked from commit f2cdf73afc)
2026-04-01 23:42:23 +00:00
zeertzjq
3e2ce64f88 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>
(cherry picked from commit 0851ac2706)
2026-04-01 22:54:26 +00:00
Justin M. Keyes
0142453543 backport: docs: misc #38692 2026-04-01 17:08:38 -04:00
Luis Calle
3de423eb20 perf(vim.pos): use nvim_buf_line_count instead of fetching all lines #38686
(cherry picked from commit 79a2235fd1)
2026-04-01 19:50:47 +00:00
phanium
dee6d2ad97 fix(ui2): vim.on_key should return nil instead of false (#38668)
(cherry picked from commit a2d9863c27)
2026-04-01 13:34:04 +00:00
zeertzjq
10bd554c0f vim-patch:82ebaa7: runtime(racket): Make visual K mapping more robust for shell injection (#38677)
fyi @benknoble

82ebaa79b0

Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit a0fcf32ad5)
2026-04-01 12:07:53 +00:00
zeertzjq
04fabbf32d 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).

8c8772c6b3
(cherry picked from commit 65e2218585)
2026-04-01 10:21:24 +00:00
zeertzjq
c084ab9f57 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

75661a66a1

Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit c7604323e3)
2026-04-01 01:52:31 +00:00
neovim-backports[bot]
dd85c13382 vim-patch: runtime file updates (#38659)
* vim-patch:e551e71: runtime(tera): use fnameescape() when loading separate syntax files

e551e71d7e

Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit ec1bea9c05)

* vim-patch:374f06f: runtime(racket): Use shellescape() to harden the K mapping

fyi: @benknoble

374f06ffd8

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Michał Majchrowicz <mmajchrowicz@afine.com>
(cherry picked from commit d29db48e0a)

---------

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Michał Majchrowicz <mmajchrowicz@afine.com>
2026-03-31 20:41:46 -04:00
neovim-backports[bot]
131a3cacb3 fix(ui2): prevent flicker when entering pager from expanded cmdline (#38662)
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.
(cherry picked from commit 75e5e37942)

Co-authored-by: luukvbaal <luukvbaal@gmail.com>
2026-03-31 20:41:20 -04:00
neovim-backports[bot]
794ce7a9d2 docs: misc (#38661)
docs: misc (#38578)

(cherry picked from commit a89d7dcb91)

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2026-03-31 20:40:33 -04:00
zeertzjq
90b4f02b44 vim-patch:068c060: runtime(rustfmt): not correctly escaping directory names (#38597)
Problem:  runtime(rustfmt): not correctly escaping directory names
Solution: Use fnamescape() (Michał Majchrowicz)

068c0604c9

Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit cbe142d3a4)
2026-03-31 23:03:27 +00:00
Tomas Janousek
60a24d707c fix(termkey): use terminfo for (shift+)left/right keys
Problem:
Since neovim 0.12, shift + arrow keys no longer works in rxvt-unicode
(TERM=rxvt-unicode-256color).

Solution:
Re-add `left` and `right` to `wanted_termkeys` so they're read from
terminfo instead of being handled by driver-csi. There seems to be quite
a few other terminals that define kLFT in terminfo.src and these are
likely to be affected as well.

Fixes: https://github.com/neovim/neovim/issues/38571
Fixes: 4b678a499c ("refactor(termkey): make termkey use internal terminfo properly")
(cherry picked from commit c4283caa17)
2026-03-31 22:45:08 +00:00
Tomas Janousek
8e490e70ed revert: "fix(scripts): gen_terminfo clears Windows terminfo definitions #36736"
Problem:
`gen_terminfo.lua`'s output is unpredictable and depends on the system
ncurses version.

Invoking `tic` on `scripts/windows.ti` alone makes it use the system
terminfo definitions for the `use=…` fragments in `windows.ti` such as:

    use=xterm+256color, use=xterm+sl, use=xterm-new

This is particularly problematic on Debian, as they build ncurses with
`--with-xterm-kbs=del` [1], and thus some of the windows entries end up
with different definitions for `kTermKey_left`, which is almost
certainly not desired.

[1]: 2d238cf387/debian/rules (L149)

Solution:
This reverts commit 9f90992934.

(cherry picked from commit 7150ae0150)
2026-03-31 22:45:08 +00:00
Yi Ming
8f7cbf6d66 fix(lsp): use winresetview() to avoid switching to normal mode (#38641)
(cherry picked from commit e31bfb81ce)
2026-03-31 16:54:30 +00:00
luukvbaal
32ca1aae88 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'.
(cherry picked from commit cd2a27507a)
2026-03-31 16:02:26 +00:00
Justin M. Keyes
f7b4eb5e0b docs: misc #38635 2026-03-31 09:26:35 -04:00
luukvbaal
14ee84e7a5 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.

(cherry picked from commit 1685ced335)
2026-03-31 13:25:43 +00:00
altermo
2d9619fac7 fix(treesitter): select with node ending with unicode char (#38557)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
(cherry picked from commit 1bcf2d7f90)
2026-03-31 05:28:17 +00:00
zeertzjq
b2702913b9 fix(defaults): check for TUI on non-stdio channel on startup (#38581)
(cherry picked from commit da58fe8fd2)
2026-03-31 03:41:44 +00:00
zeertzjq
a4df02aa03 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 --}                                    |

(cherry picked from commit 96d6042689)
2026-03-31 03:15:55 +00:00
zeertzjq
05ac4460f7 test(tui_spec): unskip a few more tests on Windows (#38618)
(cherry picked from commit bc272cc36f)
2026-03-31 02:12:29 +00:00
zeertzjq
8b3f3113c4 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.

(cherry picked from commit a3a48392c5)
2026-03-30 23:25:47 +00:00
Christian Clason
d83141c0f2 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.
(cherry picked from commit e508aa0fa8)
2026-03-30 17:22:14 +00:00
Ayush Goyal
b924afb36b 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>
(cherry picked from commit f50e7d8205)
2026-03-30 17:10:38 +00:00
skewb1k
edf4f5689d docs: fix syntax errors in examples #38606
(cherry picked from commit 2dce2af768)
2026-03-30 16:33:20 +00:00
Maria Solano
f2764a596d fix(lsp): reset document color processed version on clear (#38582)
(cherry picked from commit 92a667c07f)
2026-03-30 01:37:09 +00:00
Justin M. Keyes
ffd544f153 ci(lintcommit): allow "NVIM vx.y.z" commit message #38563
(cherry picked from commit 844f2d2e13)
2026-03-29 23:27:18 +00:00
zeertzjq
ad0adbb1b2 revert: "refactor(process): don't read from PTY master using uv_pipe_t" (#37401)
This reverts commit 75c8f75501.

(cherry picked from commit 9c15a382de)
2026-03-29 22:37:47 +00:00
Marcus Caisey
2eb14c54bc fix(lsp): highlight snippet preview when server can't completionItem/resolve (#38534)
Problem:
The snippet preview is not being highlighted by treesitter for
completion items from servers which don't support
`completionItem/resolve` (like gopls). This was broken by #38428.

Solution:
Call `update_popup_window` after updating the completion item with the
snippet preview.

I've added assertions to the `selecting an item triggers
completionItem/resolve + (snippet) preview` test case which covers the
snippet preview being shown since no tests failed when I removed the
`nvim__complete_set` call which actually populates the preview on this
codepath.
2026-03-29 14:48:11 -07:00