Commit Graph

10622 Commits

Author SHA1 Message Date
Justin M. Keyes
a1c8b81672 feat(normal): normal-mode ZR does :restart
Make it a normal-mode command instead of a default mapping.
2026-04-21 15:54:08 +02:00
Mike J. McGuirk
2551c7a8b1 feat(defaults): map ZR to restart
Problem: No default mapping for :restart.

Solution: Map to ZR in defaults.

Closes: https://github.com/neovim/neovim/issues/38942
2026-04-21 15:54:08 +02:00
zeertzjq
32e249dfa6 vim-patch:9.2.0371: filetype: ghostty config files are not recognized (#39267)
Problem:  filetype: ghostty config files are not recognized
Solution: Detect ghostty configuration files as ghostty filetype,
          include a simple ghostty filetype plugin (Bez Hermoso)

closes: vim/vim#20002

b30803b231

Co-authored-by: Bez Hermoso <bezalelhermoso@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-21 02:24:07 +00:00
zeertzjq
7d3e275b07 vim-patch:1c88aee: runtime: Remove wrong syn oneline keyword from a few syntax files (#39266)
Also:
- drop a few trailing whitespaces
- mark the oneline keyword for :syn keyword as error in the
  Vim syntax script, add tests for it.

closes: vim/vim#20018

1c88aee1fa

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2026-04-21 10:19:17 +08:00
luukvbaal
faa7c15b5a fix(ui2): don't dismiss expanded messages for non-typed key #39247
Problem:  Invalid check for non-typed key to dismiss expanded cmdline.
          Unable to delay the timer that removes a message from the msg
          window.
Solution: Check for empty string instead of nil to determine whether a
          key is typed.
          Restart the timer if it expires while the user is in the msg
          window. Allow entering the msg window with a mouse click.
2026-04-20 11:38:47 -04:00
Luuk van Baal
607fcfb37a fix(ui2): ensure msg window is visible after closing tab
Problem:  After closing a tabpage while the msg window is showing a
          message, it is hidden while the msg window still contains a
          message.
Solution: Unhide the msg window after entering a tabpage and it still
          contains a message.

Co-authored-by: Linykq <yukunlin590@gmail.com>
2026-04-20 14:20:20 +02:00
Justin M. Keyes
2b52acfb8a docs: misc #39207 2026-04-20 07:09:37 -04:00
glepnir
01861c2f95 fix(api): expose fg_indexed/bg_indexed in nvim_get_hl #39210
Problem: fg_indexed/bg_indexed were dropped from nvim_get_hl output due
to a wrong short_keys guard. HL_FG_INDEXED also wasn't cleared in
hl_blend_attrs, and HLATTRS_DICT_SIZE was too small.

Solution: Remove the short_keys guard, clear HL_FG_INDEXED in
hl_blend_attrs, bump HLATTRS_DICT_SIZE to 24, and clarify docs that
these flags mean rgb is an approximation of the cterm palette index.
2026-04-20 05:12:52 -04:00
Justin M. Keyes
c7d4892ce6 Merge #39194 from justinmk/luavimfn 2026-04-20 04:23:54 -04:00
luukvbaal
fe986e5dd0 feat(options): add 'winpinned' to pin a window #39157
Problem:
- Unable to "pin" a window to prevent closing without specifically
  being targeted.
- :fclose closes hidden windows (even before visible windows).

Solution:
- Add 'winpinned' window-local option. When set, window is skipped by
  :fclose and :only. Pin the ui2 cmdline window (which should always be
  visible), so that it is not closed by :only/fclose.
- Skip over hidden (and pinned) windows with :fclose.

Co-authored-by: glepnir <glephunter@gmail.com>
2026-04-19 20:36:55 -04:00
Justin M. Keyes
ea45e6f6ba fix(health): workaround nil vim.system():wait() result
Workaround until https://github.com/neovim/neovim/issues/37922 is fixed.
2026-04-20 02:31:09 +02:00
Justin M. Keyes
919a109951 refactor(excmd): migrate ex_terminal to Lua 2026-04-20 02:31:09 +02:00
Justin M. Keyes
fe7218528d refactor(excmd): migrate ex_checkhealth to Lua 2026-04-20 02:12:05 +02:00
Maria Solano
5f6abd34f5 fix(lsp): notify when maximum created hl groups is reached #39231 2026-04-19 19:05:51 -04:00
Maria Solano
e8b3968774 docs(lsp): description for on_list example #39230 2026-04-19 18:30:45 -04:00
Olivia Kinnear
c6209e5542 feat(excmd): add EXX error codes for :lsp, :log #39135
Also remove the `--add-comments` flag from `xgettext` because
it dumped a bunch of comments from Lua files into the `.pot` files.
2026-04-19 10:40:49 -04:00
Ashley Hauck
4b54bca3df feat(events): trigger MarkSet autocmd in :delmarks #39156
Problem:
`api.nvim_buf_del_mark` already emits a `MarkSet` event with `col` and `line` set to 0. However, `:delmarks` currently emits no events.

Solution:
Change `:delmarks` to emit the same `col==line==0` event.
2026-04-19 07:42:08 -04:00
Jaehwang Jung
88dd492996 fix(lsp): stale codelens after external file change (#39203)
Problem:
Codelens virtual lines remain on stale rows after an external file
change and buffer reload.

Solution:
Clear codelens extmarks and cached row/version state in `on_reload`
before requesting fresh code lenses.
2026-04-18 18:27:02 -07:00
glepnir
b351afb1b1 fix(lsp): show CompletionItem.detail in info popup #38904
Problem: completionItem/resolve response's `detail` field is silently
dropped. Only `documentation` is shown in the popup.

Solution: Prepend `detail` as a fenced code block before `documentation`
in the info popup, skipping if documentation already contains it.
2026-04-18 15:43:20 -04:00
Justin M. Keyes
54398c5874 docs: misc #39045 2026-04-18 15:38:59 -04:00
Jaehwang Jung
97caa88972 fix(lsp): skip codelens refresh redraw for deleted buffer #39193
Problem:
After on_refresh() sends a textDocument/codeLens request, the buffer may
be deleted before the response arrives. The response callback then tries
to redraw that deleted buffer and raises Invalid buffer id error.

Solution:
Check buffer validity before redrawing.

AI-assisted: Codex
Co-authored-by: Yi Ming <ofseed@foxmail.com>
2026-04-18 15:38:09 -04:00
Aditya Malik
2cb240319b docs(events): Lua types for autocmd event-data #38518
Problem:
  No LuaLS types for event-data fields (ev.data). Types are only
  documented ad hoc in scattered locations.

Solution:
  Add runtime/lua/vim/_meta/events.lua defining vim.event.<name>.data
  classes for events that provide ev.data. Reference the types from
  each event's help in autocmd.txt, lsp.txt, and pack.txt.
2026-04-18 13:17:45 -04:00
Evgeni Chasnovski
3a4cc5db0b fix(lua): make vim._with() work with buf=0 and win=0 context #39151
Problem: Using `buf=0`/`win=0` context in `vim._with` should be
  equivalent to using explicit buffer/window identifier respectively.

Solution: Explicitly adjust context in case of `buf=0` or `win=0`.
2026-04-18 12:04:28 -04:00
Justin M. Keyes
6701b45331 refactor(vimfn): full-Lua impl of vim.fn.environ() 2026-04-18 16:57:37 +02:00
Justin M. Keyes
3ebfa2a3cb feat(vimfn): use Lua for more excmds/vimfns
Problem:
Too much boilerplate needed to use Lua to impl an excmd or f_xx
function.

Solution:
- Add `nlua_call_vimfn` which takes the args typval, executes
  Lua, and returns a typval.
- refactor(excmd): lua impl for :log, :lsp
2026-04-18 16:57:37 +02:00
Evgeni Chasnovski
6b9b4a1377 fix(vim.filetype): match() fails if g:ft_ignore_pat is not defined #39158
Problem: Calling `vim.filetype.match({ filename = '...', buf = ... })`
  during startup results in an error due to not yet defined
  `g:ft_ignore_pat`.

Solution: Add a guard to check `g:ft_ignore_pat` related properties only
  if the variable is defined. This also allows to simplify other tests
  which did not depend on `g:ft_ignore_pat` but required it explicitly
  set to work.
2026-04-18 06:50:28 -04:00
zeertzjq
062d0a74b4 Merge pull request #39179 from zeertzjq/vim-6b26afe
vim-patch: django syntax updates
2026-04-18 08:45:40 +08:00
Evgeni Chasnovski
7219b816ea fix(lsp): limit number of created highlight groups (#39133)
* fix(api): allow silencing "Too many highlight groups" error

Problem: Using Lua's `vim.api.nvim_set_hl(0, 'New', {...})` can fail if
  there are too many existing highlight groups. However, this error can
  not be silenced with `pcall`.

Solution: Make it possible to silence in `nvim_set_hl` and
  `nvim_get_hl_id_by_name`.

* fix(lsp): limit number of groups created by `document_color()`

Problem: A file can contain many string colors that would be highlighted
  by an LSP server. If this number crosses 19999 (maximum number of
  allowed highlight groups), there are general issues with creating
  other highlight groups, which can break functionality outside of
  `vim.lsp.document_color`.

Solution: Limit number of highlight groups that are created by
  `vim.lsp.document_color` to 10000 (half of allowed maximum).
  This is not a 100% solution (since there can exist more than 10000
  other highlight groups), but explicitly checking number of groups is
  slow and 10000 should (hopefully) be enough for most use cases.
2026-04-17 17:16:11 -07:00
zeertzjq
09821bc04e vim-patch:68d3129: runtime(django): Removed unsupported template statements and filters by current LTS.
Removed djangoStatement:

- ifequal: Depricated version 4.0.
- endifequal: Depricated version 4.0.
- ifnotequal: Depricated version 4.0.
- endifnotequal: Depricated version 4.0.
- parsed
- trans: Renamed to `translate` in version 4.0.
- blocktrans: Renamed to `blocktranslate` in version 4.0.
- endblocktrans: Renamed to `endblocktranslate` in version 4.0.

Removed djangoFilter:

- fix_ampersands: Removed in version 1.8.
- length_is: Removed in version 5.1.

sources:

- Current LTS is version [5.2](https://www.djangoproject.com/download/#supported-versions).
- Documentation template builtins [5.2](https://docs.djangoproject.com/en/5.2/ref/templates/builtins/#truncatechars-html).
- Documentation template builtins [6](https://docs.djangoproject.com/en/6.0/ref/templates/builtins).
- [Django Deprecation Timeline](https://docs.djangoproject.com/en/6.0/internals/deprecation)

closes: vim/vim#19994

68d3129a05

Co-authored-by: tecis <67809811+tecis@users.noreply.github.com>
2026-04-18 08:08:20 +08:00
zeertzjq
54eefd420d vim-patch:8bcae3c: runtime(django): Add missing djangoStatement get_language_info.
Source: [get_language_info](https://docs.djangoproject.com/en/6.0/topics/i18n/translation/#get-language-info) .

related: vim/vim#19994

8bcae3ca5d

Co-authored-by: tecis <67809811+tecis@users.noreply.github.com>
2026-04-18 08:08:04 +08:00
zeertzjq
26b43af26c vim-patch:6b26afe: runtime(django): Add missing statements and filters.
Added the fallowing.

djangoStatement:

- querystring: Added in version Django 5.2.
- lorem: Added in version Django 1.8.
- verbatim: Added in version Django 1.10.

djangoFilter:

- force_escape: Added in version Django 1.8.
- iriencode: Added in version Django 1.8.
- json_script: Added in version 2.1.
- truncatechars_html: Added in version 1.7.

> According to current documentation the added keywords are supported [Django version 6](https://docs.djangoproject.com/en/6.0/ref/templates/builtins).

related: vim/vim#19994

6b26afea3b

Co-authored-by: tecis <67809811+tecis@users.noreply.github.com>
2026-04-18 08:07:51 +08:00
zeertzjq
eb569a695f vim-patch:450895d: runtime(make): fix wrong highlighting with $ inside double quotes (#39177)
fixes: vim/vim#19986

450895d86b

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Anton Khirnov <anton@khirnov.net>
2026-04-18 00:06:56 +00:00
zeertzjq
674f4b35ab vim-patch:e666597: runtime(doc): make window option description a bit less vague (#39173)
Say explicitly that ":setlocal" sets the local value, while ":set" also
sets the global value.

related: vim/vim#19993

e666597622
2026-04-18 07:28:12 +08:00
Justin M. Keyes
0d4d285bd2 perf(vim.fn): call Lua-implemented vim.fn.xx() directly #39166
Problem:
- Builtin "Vimscript" functions (f_xx) are mostly implemented in C.
  Partly that's because there is some boilerplate required to call out
  to Lua.
- Calls to `vim.fn.foo()` always marshall over the Lua <=> Vimscript
  ("typval") bridge, even if `fn.foo()` is implemented entirely in Lua:
  ```
  Lua => typval => Object => Lua => Object => typval => Lua.
  ```

Solution:
Functions declared in eval.lua with `func_lua` are implemented in
entirely in Lua (`_core/vimfn.lua`).

- `gen_eval.lua` wires `func_lua` entries to `lua_wrapper`, which handles
  the typval conversion for Vimscript callers (slow path).
- `nlua_call()` detects `func_lua` functions and calls the Lua
  implementation directly. This eliminates all conversion overhead for
  Lua callers (fast path).
- Validate at build-time that `func`, `func_float`, and `func_lua` are
  mutually exclusive.
- Migrate `hostname()` as a toy example, to show the idea.
2026-04-17 19:10:20 -04:00
zeertzjq
03193e2963 vim-patch:ab02d65: runtime(gzip): Remove compatibility fall-backs, harden random filename generation (#39165)
ab02d65b1f

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-04-18 06:39:54 +08:00
zeertzjq
fefad0721a test: include test path in summary (#39141)
Ref: https://github.com/neovim/neovim/pull/38486#discussion_r3088483987
2026-04-17 21:20:36 +08:00
zeertzjq
39410ef42b vim-patch:8.2.2440: documentation based on patches is outdated (#39144)
Problem:    Documentation based on patches is outdated.
Solution:   Add changes to documentation in a patch.

853886722c

Trailing space was removed in later patches.
Also fix a few more misplaced error numbers from #8155.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-04-17 09:50:03 +08:00
luukvbaal
f0a8e6f337 fix(ui2): dialog paging is inconsistent #39128
Problem:  - Paging keys in the dialog window consume input when the user
            may not expect it. The dismissable title hint intended to
            mitigate that results in having to press Escape twice to
            abandon the prompt.
          - Mimicked "msgsep" float border is taking up unnecessary
            space when window takes up the entire screen.

Solution: - Use (conventional, albeit less convenient) keys intended
            for scrolling to page the dialog window:
            <(Mousewheel/Page)Up/Down>, <Home/End>.
          - Only set the float top border when separation is actually
            necessary, i.e. window does not reach the first row.
2026-04-16 16:32:08 -04:00
Yi Ming
a61a0bf407 refactor(lsp): provide a default list handler example #39005
Problem:
Difficult for us to provide default handlers for functions like
`vim.lsp.buf.definition`. When users wanted to fine-tune the default behavior,
they don't know how.

Solution:
- Document an example providing `on_list` boilerplate to make it easier for
  users to modify and override.
- Also, considering that the parameters of the previous
  `on_list`(`vim.lsp.ListOpts.OnList`) are compatible with the parameters of
  `setqflist`, remove that custom type in favor of passing
  `vim.fn.setqflist.what`.
2026-04-16 15:15:04 -04:00
altermo
bb2284d75e fix(treesitter): TSNode:id() with NUL byte causes unreliable select() #39134
Problem:
`TSNode:id()` returns the underlying c pointer as a string, which may include
NUL bytes. In PUC Lua, `('%s'):format('\0a\0')` returns `''` and not `'\0a\0'`
(i.e. treats the string as a c-string (which terminates at the NUL byte)).

This resulted in two different nodes being able to have the same id.

Solution:
Use concatenation `..` instead of `string.format()`.
2026-04-16 13:52:20 -04:00
Justin M. Keyes
bc6d946cca test: lint EXX error codes #8155
Problem:
- Choosing a new EXX error code is tedious.
- It's possible to accidentally use an EXX error code for different
  purposes.

Solution:
Add a lint check which requires EXX error codes to have a :help tag.
This also avoids duplicates because `make doc` does `:helptags ++t doc`
which fails if duplicates are found.
2026-04-16 10:48:11 -04:00
Evgeni Chasnovski
42e9d8dfd1 docs(pack): improve "Synchronize across machines" steps #39122
Problem: Sometimes automatic lockfile synchronization after `:restart`
  might fail, like due to bad/absent Internet connection. This would
  remove failed to install entries from the lockfile (since they are not
  on disk and lockfile is meant to lock the latest plugin version on
  disk).

Solution: Document that this should be treated as an unwanted update and
  use steps similar to "Revert plugin after an update" use case.
2026-04-16 10:33:20 -04:00
Evgeni Chasnovski
711f3cc299 docs(diagnostic): severity names are sometimes allowed #39120
Problem: Using severity names (like "ERROR", "WARN") in functions like
  `vim.diganostic.get()` and `vim.diagnostic.config()` is allowed and
  tested for many years now. But documentation about it can be clearer.

Solution: Explicitly mention that severity names are allowed in some
  situations. Ideally, it would also require updating typing for
  `vim.diagnostic.SeverityFilter`, but that looks problematic to do
  robustly.
2026-04-16 10:32:35 -04:00
zeertzjq
3cca237984 vim-patch:e6a84bb: runtime(tar): missing g:tar_secure in tar#Extract() (#39123)
e6a84bb6b0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-16 22:19:48 +08:00
Justin M. Keyes
11a1ec7df3 test: lint naming conventions #39117
Problem:
Naming conventions are not automatically checked.

Solution:
Add a check to the doc generator. Eventually we should extract this
somehow, but that will require refactoring the doc generator...

Note: this also checks non-public functions, basically anything that
passes through `gen_eval_files.lua` and `gen_vimdoc.lua`. And that's
a good thing.
2026-04-16 09:35:58 -04:00
Justin M. Keyes
6b1a918038 Merge #39078 render class dot members as module functions 2026-04-16 05:42:33 -04:00
Yi Ming
37aa66c1a2 feat(docs): render class dot members as module functions
AI-assisted: Codex
2026-04-16 16:50:36 +08:00
Luis Calle
530cfa1323 refactor(lsp): fix typing for LSP methods #39099
Problem
Some variables use the wrong type (ClientToServer instead of ServerToClient)
and some use vaguer types that could be more strict.

Solution
Use the correct types.
2026-04-16 03:57:13 -04:00
zeertzjq
766efe5b51 vim-patch:9.2.0354: filetype: not all Bitbake include files are recognized
Problem:  filetype: not all Bitbake include files are recognized
Solution: Enhance the file detection logic and consider varflags
          (Martin Schwan)

closes: vim/vim#19983

0e02be1919

Co-authored-by: Martin Schwan <m.schwan@phytec.de>
2026-04-16 10:28:01 +08:00
zeertzjq
e7f83fad39 vim-patch:2041478: runtime(bitbake): support forward-slashes in bitbake varflags
Enable syntax highlighting for forward-slashes in Bitbake variables with
varflags. Bitbake allows for forward-slashes in both the variable name
and their potential varflags. E.g. the following should match:

    FOO_BAR[baz] = "foobar"
    FOO_BAR_foo/bar[baz] = "foobar"
    FOO_BAR_foo/bar[baz/bazzer] = "foobar"

Also allow plus-signs in variable names, to be in line with normal
variable names.

related: vim/vim#19983

2041478e2a

Co-authored-by: Martin Schwan <m.schwan@phytec.de>
2026-04-16 10:28:00 +08:00