5358 Commits

Author SHA1 Message Date
Olivia Kinnear
29494f042c fix(ex): error handling for :lsp #37061 2025-12-25 03:19:12 -05:00
zeertzjq
20c96f1515 vim-patch:2006415: runtime(doc): add reference to searchcount() function
2006415016

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-24 08:53:31 +08:00
zeertzjq
0981d4e871 vim-patch:6d211bc: runtime(doc): Improve :catch documentation
fixes: vim/vim#18984

6d211bc4f0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-24 08:52:21 +08:00
zeertzjq
e1aceb0068 vim-patch:e09ff34: runtime(ty): include ty compiler plugin (#37066)
closes: vim/vim#18960

e09ff34129

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-12-22 08:13:20 +08:00
Justin M. Keyes
4485e715fb fix(options): deprecate 'gdefault', 'magic' 2025-12-20 22:07:27 -05:00
Justin M. Keyes
060993e438 docs: misc, lsp 2025-12-20 22:07:27 -05:00
Bryan Turns
bef68ba266 docs(lua): iInconsistent vim.keymap param name #37026
Problem: vim.keymap.del has 'modes' as it's first argument while vim.keymap.set
has 'mode' as it's first argument despite both 'mode' and 'modes' taking in the
same type input of String or String[].

Solution: Updated vim.keymap.set docs to refer to it's first argument
as 'modes'.
2025-12-20 19:26:44 -05:00
zeertzjq
9b55f037d2 vim-patch:64799a5: runtime(doc): clarify the behavior of CTRL-Z
fixes: vim/vim#18975

64799a5080

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-21 07:12:38 +08:00
zeertzjq
03aef8fd2a vim-patch:fe8c8b1: runtime(doc): fix outdated :function help
Since patch 7.4.264 a leading "g:" is skipped.

closes: vim/vim#18976

fe8c8b1e85
2025-12-21 07:12:38 +08:00
Sean Dewar
eac2f0443e feat(tag): respect jumpoptions=view when popping tagstack (#37021)
Problem: jumpoptions=view has no effect when popping from the tagstack.
Solution: make it work.
2025-12-19 23:32:09 +00:00
zeertzjq
c08139d790 fix(lua): don't remove first char of non-file stacktrace source (#37008) 2025-12-18 08:09:16 +08:00
Olivia Kinnear
bd225422a5 fix(lsp): tests for :lsp, rename start/stop
- Rename :lsp start/stop to enable/disable
- Move lua section of `:lsp` to `vim/_core`
- Add tests
2025-12-16 13:46:08 -05:00
brianhuster
63abb1a88f feat(lsp): builtin :lsp command
Problem:
- Despite [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)
  claims to be a "data-only" plugin, in fact it still provides some
  user-facing commands because they haven't been upstreamed to Nvim.

Solution:
- Upstream `:LspRestart`, `:LspStart` and `:LspStop` commands as `:lsp
  restart`, `:lsp start` and `:lsp stop` respectively.

Co-authored-by: glepnir <glephunter@gmail.com>
2025-12-16 13:46:04 -05:00
zeertzjq
1d22b05f8d docs: update support.txt (#36903) 2025-12-16 12:55:32 +08:00
Justin M. Keyes
d5cfca5b76 feat(docs): numbered listitems 2025-12-15 13:55:15 -05:00
Justin M. Keyes
31dfecb458 docs: misc, editorconfig
fix https://github.com/neovim/neovim/issues/36858
2025-12-15 13:55:15 -05:00
Riley Bruins
976a47e81b Revert "refactor(treesitter): use scratch buffer for string parser" #36964
This reverts commit 2a7cb32959.
2025-12-15 02:09:36 -05:00
Justin M. Keyes
981ea41abb feat(tui): ghostty builtin terminfo #36963
Problem:
The builtin terminfo defs don't include xterm-ghostty, so features like
`kTerm_set_underline_style` are missing when building without unibilium.

Solution:
- Add ghostty to `gen_terminfo.lua`.
  - Note: The ncurses defs are somewhat different than what ghostty ships.
- Special-case ghostty in `terminfo_from_builtin`.
2025-12-15 02:07:51 -05:00
zeertzjq
1bde5a91c4 vim-patch:bfb9f5c: runtime(doc): Rename NoDefaultCurrentDirectoryInExePath tag (#36921)
- Add leading "$" to match other environment variable tags.
- Clarify :help $NoDefaultCurrentDirectoryInExePath.

closes: vim/vim#18895

bfb9f5c40e

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-12-12 09:13:15 +08:00
zeertzjq
5a83f23430 vim-patch:98a0cbf: patch 9.1.1971: crash with invalid positional argument 0 in printf() (#36919)
Problem:  crash with invalid positional argument 0 in printf()
Solution: Reject positional arguments <= 0.

closes: vim/vim#18898

98a0cbf05b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-12 08:14:58 +08:00
skewb1k
b87bdef2a8 fix(lua): relax vim.wait() timeout validation #36900
Problem:
After bc0635a9fc `vim.wait()` rejects floats
and NaN values.

Solution:
Restore the prior behavior, while still supporting `math.huge`. Update
tests to cover float case.
2025-12-10 09:44:05 -05:00
ymich9963
d2e445e1bd docs(options): shell-powershell #36881
Problem:
Current options for powershell and pwsh had mistakes and rationale
behind them was not clear.

Solution:
Update the suggested options by splitting up powershell and pwsh, as
well as ensuring that all options work and rationale is documented and
discussed.
2025-12-10 00:57:16 -05:00
zeertzjq
747cf30c37 vim-patch:9.1.1965: q can accidentally start recording at more prompt (#36879)
Problem:  When exiting at the end of the more prompt (at the hit enter
          prompt) by hitting q the recording mode will be started.
          (Jakub Łuczyński)
Solution: Don't add the q key to the typeahead buffer
          in the function wait_return (Bjoern Foersterling)

fixes: vim/vim#2589
closes: vim/vim#18889

ecce3497fa

Co-authored-by: Bjoern Foersterling <bjoern.foersterling@gmail.com>
2025-12-09 22:25:47 +08:00
zeertzjq
3bc9a5b5d2 vim-patch:9.1.1963: diff: missing diff size limit for xdiff (#36877)
Problem:  diff: missing diff size limit for xdiff
Solution: Impose file size limit for internal diff (xdiff)
          (Yee Cheng Chin).

Git imposes a hard cap on file size for content that it passes to xdiff
(added to Git in dcd1742e56e, defined in xdiff-interface.h), due to
integer overflow concerns in xdiff. Vim doesn't specify such a limit
right now, which means it's possible for a user to diff a large file
(1GB+) and trigger these overflow issues.

Add the same size limit (1GB minus 1MB) to Vim and simply throws an
error when Vim encounters files larger than said limit. For now, reuse
the same error message regarding internal diff failures. There is no
need to add the same limit for external diff as it's up to each tool to
error check their input to decide what is appropriate or not.

closes: vim/vim#18891

4af6d9755c

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-12-09 22:25:18 +08:00
zeertzjq
58d5d97719 vim-patch:98ef843: runtime(rust): use textwidth=100 for the Rust recommended style (#36875)
The help text here said 99 was the recommended style for the standard
library, but I can't find a citation for this anywhere. In contrast the
Rust Style Guide hosted on rust-lang.org
[says](https://doc.rust-lang.org/stable/style-guide/#indentation-and-line-width)
the maximum line width is 100, and rustfmt
[agrees](37aa2135b5/src/tools/rustfmt/src/config/options.rs (L570)).

Having the two disagree causes an annoying off-by-one error in vim: if
you configure vim to highlight too-long lines then it will occasionally
complain about a line that rustfmt refuses to fix.

closes: vim/vim#18892

98ef8433b6

Co-authored-by: Aaron Jacobs <jacobsa@google.com>
2025-12-09 20:42:12 +08:00
zeertzjq
c24cc4c352 vim-patch:b22c145: runtime(doc): document change in Windows behavior for patch 9.1.1947 (#36874)
closes: vim/vim#18886

b22c145c22

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-09 20:41:49 +08:00
Mathias Fußenegger
c5d4050586 Revert "feat(lsp): support version in textDocument/publishDiagnostics #36754" (#36865)
This reverts commit 03d6cf7aae.

See https://github.com/neovim/neovim/pull/36754#issuecomment-3626115697
The change was supposed to avoid showing stale diagnostics but had the
opposite effect.
2025-12-09 13:29:21 +01:00
zeertzjq
2f9f77cd72 vim-patch:9.1.1962: filetype: Erlang application resource files are not recognized (#36868)
Problem:  filetype: Erlang application resource files are not recognized
Solution: Add content-based filetype detection for application resource
          files matching extension '*.app' (Doug Kearns)

related: vim/vim#18835
closes:  vim/vim#18842

cf5c255260

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-12-09 09:08:09 +08:00
Justin M. Keyes
0bb5bc5557 refactor: clint.py => clint.lua
Problem:
`clint.py` is the last python in our codebase, and beyond that it needs
some cleanup. And it lacks tests, so modifying it can be painful.

Also, we need a way to add ad-hoc lint rules for *Lua*, so it will help
to have our ad-hoc rules for C in the same language (the scripts may
share functions/techniques): https://github.com/neovim/neovim/issues/28372

Solution:
- convert to `clint.lua` (mostly AI-generated, but it now has test
  coverage, unlike `clint.py`)
- drop rules that are no longer needed:
  - "readability/multiline_string"
    - technially still relevant, but very uncommon so doesn't really matter.
  - "--line-length"
    - Not used in the old clint.py, nor the new clint.lua.
  - "comment whitespace" check
    - It is enforced by uncrustify.
  - "TODO" check
    - The `-google-readability-function-size` clang-tidy rule enforces
      "TODO(user)" format. (It was already enabled long ago.)
2025-12-08 01:43:02 -05:00
zeertzjq
69f4fd84aa vim-patch:9.1.1949: :stag does not use 'swichtbuf' option
Problem:  :stag does not use 'swichtbuf' option, though the
          documentation states differently
          (Christian Brabandt)
Solution: Respect 'switchbuf' option (Yegappan Lakshmanan).

related: vim/vim#18845
closes: vim/vim#18856

efc7509be2

Cherry-pick some test_tagjump.vim changes from patches 9.0.{0363,0767}.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-12-08 08:09:17 +08:00
Nathan Smith
551bb63d44 feat(events): MarkSet event, aucmd_defer() #35793
Problem:
- Can't subscribe to "mark" events.
- Executing events is risky because they can't be deferred.

Solution:
- Introduce `MarkSet` event.
- Introduce `aucmd_defer()`.

Helped-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-12-07 15:13:31 -05:00
Justin M. Keyes
ebb7c38ca2 docs: misc
fix https://github.com/neovim/neovim.github.io/issues/419

Co-authored-by: Rob Pilling <robpilling@gmail.com>
2025-12-06 20:33:02 -05:00
Tristan Knight
0f3e3c87b7 feat(lsp): support dynamic registration for diagnostics (#36841) 2025-12-06 15:55:07 -08:00
Tristan Knight
9e9cdcaa18 refactor(lsp): unify capability checks and registration #36781
Problem:
Our LSP type system didnt have a concept of RegistrationMethods, this is where the method to dynamically register for a capability is sent to a different method endpoint then is used to call it. Eg `textDocument/semanticTokens` rather than the specific full/range/delta methods

Solution:
Extended generator to create `vim.lsp.protocol.Methods.Registration` with these registration methods. Also extend `_request_name_to_client_capability` to cover these methods. Adjust typing to suit
2025-12-06 18:31:11 -05:00
Olivia Kinnear
4e1644d4d3 feat(spell): opt-out of confirm when downloading spellfiles #36836 2025-12-06 17:20:02 -05:00
Justin M. Keyes
d6bee7e407 test: skip noisy "terminal mode unavailable" logs #36794
Problem:
Every CI log has a lot of noise at the end, which makes it harder to
find relevant test failures:

    Running tests from test/functional/terminal/tui_spec.lua
    ...
    T5831 TUI bg color queries the terminal for background color:
    T5832 TUI bg color triggers OptionSet from automatic background processing:
    T5833 TUI bg color sends theme update notifications when background changes #31652:
    ...
    Running tests from test/functional/ui/output_spec.lua
    ...
    WRN 2025-12-02T03:36:47.304 ui/c/T5831.28003.0 tui_handle_term_mode:223: TUI: terminal mode 2026 unavailable, state 0
    WRN 2025-12-02T03:36:47.359 ui/c/T5832.28006.0 tui_handle_term_mode:223: TUI: terminal mode 2048 unavailable, state 0
    WRN 2025-12-02T03:36:47.414 ui/c/T5833.28009.0 tui_handle_term_mode:223: TUI: terminal mode 2048 unavailable, state 0

Solution:
- Skip logging in test-mode.
    - This can be reverted later, when these logs are changed to "INFO"
      level, per this TODO comment:
      ```
      // TODO(bfredl): This is really ILOG but we want it in all builds.
      // add to show_verbose_terminfo() without being too racy ????
      WLOG("TUI: terminal mode %d unavailable, state %d", mode, state);
      ```
2025-12-05 16:04:24 -05:00
Pig Fang
02067a9892 feat(lsp): support diagnostic refresh request 2025-12-05 15:51:46 +00:00
Olivia Kinnear
903335a6d5 feat(lsp): Client:stop() defaults to exit_timeout #36783
Problem:
If a `vim.lsp.config` explicitly sets `exit_timeout`, that indicates the
config wants that behavior for most usages of `:stop()`.

Solution:
Update `:stop()` to use `force=exit_timeout` if `force` was not
explicitly passed.
2025-12-04 22:50:00 -05:00
zeertzjq
a8a0bba2f8 fix(ui): close outdated cmdline pum on redraw (#36815) 2025-12-05 00:23:22 +00:00
zeertzjq
e8fdc7ef9a vim-patch:9.1.1944: getwininfo() does not return if statusline is visible (#36828)
Problem:  gewininfo() does not return if statusline is visible
Solution: Add status_height to the dict items returned by
          getwininfo() (Hirohito Higashi)

closes: vim/vim#18841

a04ab5f04c

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-12-05 07:38:05 +08:00
zeertzjq
bfe007a187 vim-patch:9.1.1948: Windows: Vim adds current directory to search path
Problem:  Windows: Vim always adds the current directory to search path.
          This should only happen when using cmd.exe as 'shell'. For
          example, powershell won't run binaries from the current
          directory.
Solution: Only add current directory to system path, when using cmd.exe
          as 'shell'.

related: vim/vim#10341
related: 083ec6d9a3b7

4d87c9742a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-04 11:54:27 +08:00
zeertzjq
ac3e2ca675 vim-patch:9.1.1947: [security]: Windows: Vim may execute commands from current directory
Problem:  [security]: Windows: Vim may execute commands from current
          directory (Simon Zuckerbraun)
Solution: Set the $NoDefaultCurrentDirectoryInExePath before running
          external commands.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-g77q-xrww-p834

083ec6d9a3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-04 11:54:26 +08:00
Olivia Kinnear
e62dd13f83 fix(lsp): default ClientConfig.exit_timeout to false #36811 2025-12-03 00:58:46 -05:00
zeertzjq
832ce0ac4b vim-patch:c3cfdef: runtime(doc): clarify the use of v:errormsg (#36789)
fixes: vim/vim#18825

c3cfdefdee

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-02 00:38:18 +00:00
Olivia Kinnear
acfb9bc614 feat(lsp): graduate ClientConfig exit_timeout #36750
Problem:
The `flags` field calls its sub-fields "experimental".
But `exit_timeout` is now used for multiple purposes.

Solution:
Graduate `exit_timeout` to a top-level ClientConfig field.
2025-11-30 21:41:43 -05:00
fredizzimo
6ebeb07c56 feat(api): experimental nvim__exec_lua_fast #35758
Problem:
Remote UIs can't execute lua code when a blocking prompt is waiting for
input. This is needed when implementing IME pre-edit for example.

Solution:
Add an `nvim__exec_lua_fast` experimental API function, which is allowed
to run instead of being queued until after the message has been shown.
2025-11-30 19:27:02 -05:00
zeertzjq
8c1327a622 vim-patch:49f731d: runtime(doc): Improve :help :catch command specification (#36758)
The pattern argument is optional.  See :help :sort for another example.

closes: vim/vim#18834

49f731d243

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-11-30 18:55:38 +08:00
Olivia Kinnear
12d4c624bb feat(ex_cmds): consistent :restart behavior (#36723) 2025-11-30 02:14:28 -08:00
Riley Bruins
03d6cf7aae feat(lsp): support version in textDocument/publishDiagnostics #36754
This commit makes it so that push diagnostics received for an outdated
document version are ignored.
2025-11-29 23:38:11 -05:00
Olivia Kinnear
a4b2192690 feat(lsp): lsp.enable() auto-escalates forced shutdown #36458
Problem:
LSP server may not exit even after the client was stopped/disabled via enable(false).

Solution:
Automatically force-stop after a timeout, unless `client.flags.exit_timeout = false`.
2025-11-29 14:36:29 -05:00