Commit Graph

35216 Commits

Author SHA1 Message Date
zeertzjq
f807e5c917 test: improve check for N/A tests (#37667)
The previous conditions don't handle the case where an entire file is
N/A, which is the case for autocmd/signal_spec.lua on Windows.
2026-02-02 13:37:29 +08:00
zeertzjq
0566767d7d vim-patch:2e4c98b: runtime(vim): Update base syntax, match Vim9 :unlet command (#37662)
closes: vim/vim#19290

2e4c98b6f3

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-02-01 23:22:51 +00:00
zeertzjq
5da2a4b59a vim-patch:079700e: runtime(doc): Improve the description at :help :cwindow (#37661)
Describe the "height" argument when opening the quickfix window.

See: vim/vim#19302 ("[cl]window" has different behaviour from "[cl]open" about
their argument [height])

related: vim/vim#19302
closes:  vim/vim#19305

079700ee45

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-02-01 23:05:34 +00:00
Christian Clason
619b9a8fd4 build(deps): bump tree-sitter to v0.26.5 2026-02-01 23:20:51 +01:00
zeertzjq
1906da52db fix(lua): close vim.defer_fn() timer if vim.schedule() failed (#37647)
Problem:
Using vim.defer_fn() just before Nvim exit leaks luv handles.

Solution:
Make vim.schedule() return an error message if scheduling failed.
Make vim.defer_fn() close timer if vim.schedule() failed.
2026-02-01 21:29:19 +08:00
Maria Solano
0501c5fd09 fix(lsp): call on_list before reading loclist #37645
Problem:
`on_list` is supposed to replace the default list-handler. With the current order of these `if` statements `on_list` won't be called if `loclist` is true.

Solution:
Change the order of the relevant blocks.
2026-02-01 07:18:16 -05:00
zeertzjq
1355640d6a test(tui_spec): fix overwriting environment on Windows (#37651) 2026-02-01 08:16:09 +00:00
zeertzjq
28c294363f Merge pull request #37646 from zeertzjq/vim-c99aaf4
vim-patch: runtime file updates
2026-02-01 08:51:31 +08:00
zeertzjq
e283a60a69 vim-patch:0195622: runtime(qf): Update quickfix syntax
closes: vim/vim#19296

01956225bc

Co-authored-by: GX <59413576+gx089@users.noreply.github.com>
2026-02-01 08:31:38 +08:00
zeertzjq
c74d5ceda1 vim-patch:dd9f7e6: runtime(doc): Fix some overlength lines
closes: vim/vim#19286

dd9f7e6cbb

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-02-01 08:30:59 +08:00
zeertzjq
b6237de224 vim-patch:c99aaf4: runtime(colors): improve catppuccin colorscheme
- fix readability issue with IncSearch/CurSearch
- add highlights to some of ftplugins distributed with vim

closes: vim/vim#19295

c99aaf4c87

Co-authored-by: Maxim Kim <habamax@gmail.com>
2026-02-01 08:22:07 +08:00
zeertzjq
77162a717a test: wait for uv.pipe_connect() callback (#37640)
Problem:
On Windows, writing to a pipe doesn't work if the pipe isn't connected
yet. This causes an RPC request to a session newly created by connect()
to hang, as it's waiting for a response to a request that never reaches
the server.

Solution:
Wait for uv.pipe_connect() callback to be called when using connect().
2026-02-01 08:14:12 +08:00
zeertzjq
270c7b46af vim-patch:9.1.2123: using NOT with a float returns a float in legacy script (#37639)
Problem:  using NOT with a float returns a float in legacy vim script
          (kennypete)
Solution: Return a number instead of a float (Yegappan Lakshmanan)

fixes:  vim/vim#19282
closes: vim/vim#19289

ecc3faef61

N/A patches:
vim-patch:8.2.1980: Vim9: some tests are not done at the script level
vim-patch:9.1.2122: Vim9: Negating a float doesn't result in a bool

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2026-01-31 13:50:54 +00:00
zeertzjq
7ca3a56258 fix(ui): don't crash if maximum UI count reached (#37636) 2026-01-31 21:09:06 +08:00
zeertzjq
1e6c4ea896 test: add reasons to some skipped tests (#37632) 2026-01-31 00:25:48 +00:00
Shadman
ed4c549ea2 fix(prompt): also store column info in ': mark #36194
Problem:
Currently, : mark is set in start of prompt-line. But more relevant
location is where the user text starts.

Solution:
Store and update column info on ': just like the line info
2026-01-30 12:22:48 -05:00
Harsh Kapse
36db6ff2c1 fix(lsp): use LSP textEdit range for completion start boundary (#37491)
Previously, adjust_start_col returned nil when completion items had
different start position from lsp textEdit range
This caused the completion to fall back to \k*$ which ignores the
non-keyword characters

Changes:
- adjust_start_col: now returns the minimum start postion among all
items instead of nil
- _lsp_to_complete_items - normalizes the items by adding the gap between
  current and minimum start

Fixes: https://github.com/neovim/neovim/issues/37441
2026-01-30 15:34:42 +01:00
zeertzjq
47ce93ad6d vim-patch:9.1.2118: 'cursorline' missing after :diffput to empty buf (#37628)
Problem:  'cursorline' and part of 'statusline' are missing after
          :diffput to an empty buffer.
Solution: Make sure the cursor doesn't go beyond the last line after
          :diffput (zeertzjq)

related: neovim/neovim#37621
closes:  vim/vim#19281

ce1e562fda
2026-01-30 20:09:33 +08:00
zeertzjq
ebfbe4db49 vim-patch:9.1.2116: crash when using 'tagfunc' (#37627)
Problem:  crash when using 'tagfunc' (Rodrigo Queipo)
Solution: Do not add the user_data to the 'info' dictionary when called
          for insert mode completion (the TAG_INS_COMP flag is set).
          Completion should not depend on the state of a previous tag
          jump. (Yasuhiro Matsumoto)

fixes:  vim/vim#19255
closes: vim/vim#19284

57b577df32

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-01-30 11:41:02 +00:00
Kevin Goodsell
5e1a3df5ae vim-patch:9.1.2119: tests: Test_language_cmd fails on OpenBSD (#37503)
Problem:  tests: Test_language_cmd fails on OpenBSD because the test
          uses an invalid locale name and expects the command to produce
          an error. OpenBSD accepts (almost) any locale name as valid by
          design, so the :lang command succeeds and the test fails.
Solution: Slightly update the "bad" locale name to make it something
          that OpenBSD considers invalid by adding a dot (but not ending
          with ".UTF-8"). Maintain the original two underscores in the
          name because that ensures Windows will also see it as invalid
          (Kevin Goodsell).

closes: vim/vim#19280

371583642a
2026-01-30 18:58:37 +08:00
zeertzjq
a60d5f863e vim-patch:b817536: runtime(tera): update syntax files to support many more tera code (#37622)
This includes macros, keys etc. which were not highlighted before.

closes: vim/vim#19276

b817536b8f

Co-authored-by: MuntasirSZN <muntasir.joypurhat@gmail.com>
2026-01-30 00:08:49 +00:00
Justin M. Keyes
52cd9dcff2 Merge #37617 from echasnovski/pack-clearer-lockfile-sync 2026-01-29 16:55:20 -05:00
luukvbaal
1a3d3b77bb fix(ui): no empty message for substitution match with ext_messages #37600
Problem:  Empty message is emitted when a match is found.
Solution: Don't emit it with ext_messages enabled.
2026-01-29 16:51:58 -05:00
Evgeni Chasnovski
164cab405b test(pack): cover that events work when installing from the lockfile 2026-01-29 16:25:02 +02:00
Evgeni Chasnovski
1aa81290a4 docs(pack): clarify caveats about installing based on the lockfile 2026-01-29 16:24:33 +02:00
zeertzjq
19a3b67789 fix(process): avoid unexpected behavior when PTY chdir failed (#37614)
Problem:  Unexpected behavior after PTY child process fails to chdir(),
          as it then thinks it's the parent process.
Solution: Exit the child process instead of returning.
2026-01-29 22:02:24 +08:00
zeertzjq
484f455402 test(terminal): status is -1 in TermClose if buffer is deleted (#37609) 2026-01-29 08:29:49 +00:00
zeertzjq
4e4e1b09d3 refactor(terminal): fix coverity warning (#37613)
*** CID 642984:         Null pointer dereferences  (FORWARD_NULL)
    /src/nvim/terminal.c: 571             in terminal_open()
    565
    566       if (term->sb_buffer != NULL) {
    567         // If scrollback has been allocated by autocommands between terminal_alloc()
    568         // and terminal_open(), it also needs to be refreshed.
    569         refresh_scrollback(term, buf);
    570       }
    >>>     CID 642984:         Null pointer dereferences  (FORWARD_NULL)
    >>>     Passing "term" to "refresh_screen", which dereferences null "term->sb_buffer".
    571       refresh_screen(term, buf);
    572       set_option_value(kOptBuftype, STATIC_CSTR_AS_OPTVAL("terminal"), OPT_LOCAL);
    573
    574       if (buf->b_ffname != NULL) {
    575         buf_set_term_title(buf, buf->b_ffname, strlen(buf->b_ffname));
    576       }
2026-01-29 05:16:41 +00:00
zeertzjq
b40880f88f fix(terminal): heap UAF if buffer deleted during TermRequest (#37612)
Problem:  Heap UAF if a terminal buffer is deleted during TermRequest in
          Normal mode.
Solution: Increment terminal refcount before triggering TermRequest, and
          destroy the terminal if the buffer is closed during that.
2026-01-29 13:02:36 +08:00
zeertzjq
e77a69c6e9 Merge pull request #37610 from zeertzjq/vim-f3055ea
vim-patch: colorscheme updates
2026-01-29 09:50:54 +08:00
zeertzjq
4e52a2d386 vim-patch:97d1255: runtime(colors): Update colorscheme and add TitleBar/TitleBarNC
closes: vim/vim#18513

97d1255558

Co-authored-by: Maxim Kim <habamax@gmail.com>
2026-01-29 09:27:42 +08:00
zeertzjq
d1b8b3b450 vim-patch:b1b8050: runtime(colors): update colorschemes:
- Add PreInsert (darkblue, habamax, lunaperche, wildcharm, retrobox).
- Update QuickFixLine (habamax, lunaperche, wildcharm, retrobox) - make
  it foreground transparent in GUI.
- Make Todo in wildcharm just bold.

closes: vim/vim#18304

b1b80506ce

Co-authored-by: Maxim Kim <habamax@gmail.com>
2026-01-29 09:24:29 +08:00
zeertzjq
17555de267 vim-patch:f3055ea: runtime(colors): Update colorschemes
- all colorschemes were ported to colortemplate v3
- gui versions of habamax, lunaperche, wildcharm, retrobox colorschemes
  have different Diff, Visual, Search and IncSearch colors compared to non-gui.
- habamax Search was changed to green instead of blue to better distinct
  it with Visual (also bluish in gui)

closes: vim/vim#18061

f3055eac84

Co-authored-by: Maxim Kim <habamax@gmail.com>
2026-01-29 09:23:01 +08:00
zeertzjq
63ecf6160a Merge pull request #37608 from zeertzjq/vim-c979211
vim-patch: runtime file updates
2026-01-29 09:00:39 +08:00
zeertzjq
3739376af7 vim-patch:663d809: runtime(rust): Fix Rust indentation when string contains "if"
indent/rust.vim behaves incorrectly when a string literal contains the
substring "if".

For example, in this code:

    let x = "
                motif
    ";
    struct X {
                }

indent/rust.vim thinks that the closing "}" should line up with "motif".

This patch fixes the issue by checking whether the "if" is in a string
literal or comment before considering it to be a match for a subsequent
brace (and also by requiring it to start on a word boundary).

Add an indent test to ensure this does not regress.

closes: vim/vim#19265

663d809194

Co-authored-by: taylor.fish <contact@taylor.fish>
2026-01-29 08:23:15 +08:00
zeertzjq
bfb30f7599 vim-patch:427fa3e: runtime(doc): 'ignorecase' affects character classes in the old engine
fixes: vim/vim#19230

427fa3e1e4

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-01-29 08:22:51 +08:00
zeertzjq
80788dc9db vim-patch:b73565d: runtime(make): Declare syntax file orphaned
closes: vim/vim#19267

b73565d89d

Co-authored-by: Roland Hieber <rohieb@rohieb.name>
2026-01-29 08:22:15 +08:00
zeertzjq
78961f0bb4 vim-patch:c979211: runtime(8th): Update syntax script
closes: vim/vim#19261

c979211675

Co-authored-by: Ron Aaron <ron@aaron-tech.com>
2026-01-29 08:21:45 +08:00
zeertzjq
a8a097d178 vim-patch:9.1.2112: long statusline may crash if using singlebyte encoding (#37605)
Problem:  long statusline may crash if using singlebyte encoding
          (fizz-is-on-the-way)
Solution: Drop the non-mbyte codepath and always use the mbyte code
          (zeertzjq)

3f7be0d7e1
2026-01-28 23:30:14 +00:00
Phạm Bình An
c7c5455da1 vim-patch:1e54023: runtime(doc): clarify vim.eval behavior with Vim special variables (#37369)
Problem:  The behavior of vim.eval() with Vim special variables is not
          clearly documented. It is (partly) the reason why Nvim
          Python's vim.eval gives different output when evaluating
          v:true and v:false
Solution: Document it (Phạm Bình An)

closes: vim/vim#19157

1e54023673
2026-01-29 07:19:20 +08:00
Daniel Nylander
41336a3590 fix(messages): swedish translation #37395 2026-01-28 11:35:23 -05:00
zeertzjq
97d9b85bf9 fix(terminal): wrong scrollback with BufFile* autocommand (#37601)
Problem:  Wrong terminal scrollback if BufFile* autocommand drains PTY
          output but doesn't process the pending refresh.
Solution: Refresh scrollback before refreshing screen in terminal_open()
          if scrollback has been allocated.
2026-01-28 23:32:58 +08:00
Justin M. Keyes
75114fe7bb Merge #37428 vim.pack tests 2026-01-28 06:48:57 -05:00
phanium
babdab2f70 perf(filetype): vim.filetype.get_option cache miss when option value is false #37593
Problem: when option value is false, it's treated as invalid
then trigger FileType event again

Solution: use cached false value
2026-01-28 05:58:00 -05:00
Yochem van Rosmalen
f7041625f1 refactor(lua): use vim.fs instead of fnamemodify
Although powerful -- especially with chained modifiers --, the
readability (and therefore maintainability) of `fnamemodify()` and its
modifiers is often worse than a function name, giving less context and
having to rely on `:h filename-modifiers`. However, it is used plenty in
the Lua stdlib:

- 16x for the basename: `fnamemodify(path, ':t')`
- 7x for the parents: `fnamemodify(path, ':h')`
- 7x for the stem (filename w/o extension): `fnamemodify(path, ':r')`
- 6x for the absolute path: `fnamemodify(path, ':p')`
- 2x for the suffix: `fnamemodify(path, ':e')`
- 2x relative to the home directory: `fnamemodify(path, ':~')`
- 1x relative to the cwd: `fnamemodify(path, ':.')`

The `fs` module in the stdlib provides a cleaner interface for most of
these path operations: `vim.fs.basename` instead of `':t'`,
`vim.fs.dirname` instead of `':h'`, `vim.fs.abspath` instead of `':p'`.
This commit refactors the runtime to use these instead of fnamemodify.

Not all fnamemodify calls are removed; some have intrinsic differences
in behavior with the `vim.fs` replacement or do not yet have a
replacement in the Lua module, i.e. `:~`, `:.`, `:e` and `:r`.
2026-01-28 10:57:39 +00:00
Josh Cooper
9988d7142d fix(types): add missing @return annotations 2026-01-28 10:56:36 +00:00
zeertzjq
1f0dbfea2f fix(tui): log chdir failure properly #37591 2026-01-28 05:44:17 -05:00
ashab-k
027b7d6bbb fix(ui): :intro not displayed with ui2 #37472
Problem:
The :intro  fails to display in  ui2 because wait_return(true) triggers a full
redraw. Furthermore statuslines are visible when using :intro

Solution:
Replace wait_return() with plain_vgetc(). This works with old and ui2 while also removing the unnecessary statusline and "press ENTER" prompt.
Updates tests to work with new behaviour.

Signed-off-by: ashab-k <ashabkhan2000@gmail.com>
2026-01-27 18:25:36 -05:00
Phạm Bình An
3e6db5b2ec fix(termdebug): use mark : to get prompt line in prompt buffer #37336
Problem:
- Nvim supports multi-line input in prompt buffer, so line(`$`) is not
  always the prompt line.

Solution:
- Use `line("':")` to get the prompt line.
2026-01-27 18:19:38 -05:00
phanium
fd45bc8cab fix: lsp.enable() don't work correctly inside FileType event #37538
Problem:
Two cases lsp.enable() won't work in the first FileType event
1. lsp.enable luals inside FileType or ftplugin/lua.lua, then:
```
nvim a.lua
```

2. lsp.enable luals inside FileType or ftplugin/lua.lua, then:
```
nvim -> :edit a.lua -> :mksession! | restart +qa! so Session.vim
```

Solution:
Currently `v:vim_did_enter` is used to detected two cases:
1. "maunally enabled" (lsp.enable() or `:lsp enable`)
2. "inside FileType event"

To detect 2. correctly we use did_filetype().
2026-01-27 17:59:36 -05:00