Commit Graph

35198 Commits

Author SHA1 Message Date
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
zeertzjq
6291256868 fix(process): avoid buffering unnecessary UI event with PTY CWD (#37582)
Problem:
Calling os_chdir() to change the child processes' CWD may cause some
unnecessary UI events to be buffered. These UI events don't go anywhere
as execvp() is called before flushing the UI buffer.

Solution:
Use uv_chdir() instead of os_chdir(). Also fix getting error string
incorrectly. Add test for the current behavior.
2026-01-28 06:50:49 +08:00
zeertzjq
6a28835320 vim-patch:0f3b7d2: runtime(doc): fix missing code block marker in ft-python-syntax (#37588)
related: vim/vim#18922
closes:  vim/vim#19261

0f3b7d2563
2026-01-28 06:50:24 +08:00
zeertzjq
df21ac729c fix(terminal): losing output if BufFile* poll for events (#37580)
Problem:  Terminal loses output if a BufFilePre or BufFilePost autocmd
          polls for events.
Solution: Rename the buffer after allocating the terminal instance. Also
          fix buffer getting wrong name if BufFilePre uses NameBuff.
2026-01-28 06:21:28 +08:00
Phạm Bình An
d96a88252e docs: misc #37357
Problem:
- According to [pipx
  documentation](https://pipx.pypa.io/stable/docs/#pipx-install), `pipx
  install` doesn't have --upgrade argument. Running `pipx install
  --upgrade pynvim` results in an error "unrecognized arguments:
  --upgrade"
- In file if_pyth.txt:317, it says "Implementation is ... written in C".
  This is not true for Nvim, since find_module logic of Nvim's Python
  interface is implemented in Python.
  (fdaae821a9/pynvim/plugin/script_host.py (L217))
- $NVIM_LISTEN_ADDRESS has been deprecated.
- `:Next` is a core command, not termdebug plugin command. Termdebug
  uses `:Over` to send command `next` to gdb

Solution:
- Just use `pipx install pynvim`
2026-01-27 17:14:57 -05:00
Olivia Kinnear
34815777b2 fix(lsp): remove side-effects if vim.lsp.enable() raises an error (#37571)
Problem:
If `vim.lsp.enable()` fails with an error, either because `'*'` is one
of the provided names or because there is an error in a config,
`vim.lsp.enable()` will still have side-effects:
- All names before the one that encountered an error will still be added
  to `lsp._enabled_configs`, but the autocommand will not get added or
  run.
- Any name which makes `vim.lsp.config[name]` error will be added to
  `lsp._enabled_configs`, causing all future calls to `vim.lsp.enable()`
  to fail. This will also break `:che vim.lsp`.

Solution:
- Check all names for errors before modifying `lsp._enabled_configs`.
- Check `vim.lsp.config[name]` does not raise an error before enabling
  the name.
2026-01-27 13:17:45 -08:00
luukvbaal
1d57374c41 fix(ui): textlock still causes issues for UI callbacks #37513
Problem:  There are still ways to run into textlock errors with
          vim.ui_attach callbacks trying to display a UI event.
Solution: Disregard textlock again during vim.ui_attach() callbacks
          (also when scheduled). Partially revert 3277dc3b; avoiding
          to flush while textlock is set is still helpful.
2026-01-27 09:30:37 -05:00
Justin M. Keyes
c2ecc9ca41 Merge #37309 :checkhealth vim.pack 2026-01-27 09:19:46 -05:00
phanium
dfa5d79d05 fix: misc typos #37471 2026-01-27 09:18:02 -05:00
glepnir
ae93639ec4 fix(health): use FileType autocmd for bug report winbar #37486
Problem: In float mode, vim.schedule() may run before filetype is set,
so winbar is not shown.

Solution: Use FileType autocmd to ensure winbar is set after filetype.
Also use type=Bug in URL.
2026-01-27 09:06:50 -05:00
jdrouhard
8ed68fda50 feat(lsp): semantic token range improvements #37451
* cache all tokens from various range requests for a given document
  version
  - all new token highlights are merged with previous highlights to
    maintain order and the "marked" property
  - this allows the tokens to stop flickering once they've loaded once
    per document version
* abandon the processing coroutine if the request_id has changed instead
  of relying only on the document version
  - this will improve efficiency if a new range request is made while a
    previous one was processing its result
* apply new highlights from processing coroutine directly to the current
  result when the version hasn't changed
  - this allows new highlights to be immediately drawable once they've
    processed instead of waiting for the whole response to be processed
    at once
* rpc layer was changed to provide the request ID back in success
  callbacks, which is then provided as a request_id field on the handler
  context to lsp handlers
2026-01-27 08:56:52 -05:00
skewb1k
8c63d84be1 feat(health): check vim.ui.open() tool #37569
Problem:
`:checkhealth` does not report when no `vim.ui.open()` handler is
available.

Solution:
Factor command resolution into `_get_open_cmd()` and reuse it from
`:checkhealth` to detect missing handlers.
2026-01-27 08:51:00 -05:00
github-actions[bot]
76c77bd114 docs: update version.c #37545
vim-patch:9.1.1988: osc52 package can be further improved
vim-patch:5fb29bb7e runtime(osc52): Update documentation, send DA1 query when loading package
vim-patch:e6a11d45e runtime(osc52): A few minor fixes
vim-patch:1d4fe8905 CI: Add C preproc indentation check to CI
vim-patch:a5ba252f0 runtime(doc): Tweak tag lines in vim9.txt
vim-patch:c035f518c CI: check encoding of runtime files with utf-8 name
2026-01-27 08:05:30 -05:00
zeertzjq
d4360596b5 vim-patch:b424349: runtime(colors): include new catppuccin colorscheme (#37570)
closes: vim/vim#19258

b42434915b

Co-authored-by: Maxim Kim <habamax@gmail.com>
2026-01-27 19:51:10 +08:00
Olivia Kinnear
c28113dd9d fix(health): add back vim.cmd.redraw() call (#37576)
Was erroneously removed by #37462 during rebase.
2026-01-27 08:54:27 +01:00
zeertzjq
b88b7f9591 fix(terminal): wrong colors with nvim_open_term() in non-curbuf (#37579)
Problem:  Wrong colors with nvim_open_term() in non-current buffer.
Solution: Pass the buffer to get_config_string().
2026-01-27 06:59:23 +00:00
zeertzjq
a626f783f8 Merge pull request #37578 from zeertzjq/term-title
Fix two other possible terminal crashes
2026-01-27 13:49:32 +08:00
zeertzjq
9540e7470b fix(terminal): possible heap-use-after-free during Nvim exit
Usually, terminal_close() calls refresh_terminal(), which allocates the
scrollback buffer, and term_may_alloc_scrollback() in terminal_open()
won't dereference the buffer. However, refresh_terminal() is not called
during Nvim exit, in which case a heap-use-after-free may happen if
TermOpen wipes buffer. Check for non-NULL buf_handle to avoid that.
2026-01-27 13:12:15 +08:00
zeertzjq
b4039ec0b0 fix(terminal): don't allow b:term_title watcher to delete buffer 2026-01-27 12:45:49 +08:00