10440 Commits

Author SHA1 Message Date
Maria Solano
9c5d8b475e docs(lsp): add init_options to Copilot example #38502
Problem:
When following this example from our docs the Copilot LSP won't attach.

Solution:
Add `init_options` as done by [`nvim-lspconfig`](1a6d692067/lsp/copilot.lua (L112-L121)).
2026-03-27 12:33:31 -04:00
Shadman
a940b77cb2 feat(prompt): prompt_appendbuf() appends to prompt buffer #37763
Problem:
Currently, we recommend always inserting text above prompt-line in
prompt-buffer. This can be done using the `:` mark. However, although
we recommend it this way it can sometimes get confusing how to do it
best.

Solution:
Provide an api to append text to prompt buffer. This is a common
use-case for things using prompt-buffer.
2026-03-27 07:39:09 -04:00
Evgeni Chasnovski
0fa96585dc fix(pack): set source in progress report #38511
Problem: Progress reports via `nvim_echo()` gained an ability to set
  `source` and `vim.pack` doesn't currently set one.

Solution: Set `source` to 'vim.pack'. Ideally, the title then can be
  something else more informative (like "update", "download", etc.), but
  it is used when showing progress messages. So it has to be "vim.pack"
  in this case.
2026-03-27 07:36:06 -04:00
Shadman
4b643d7068 feat(progress): set Progress-event pattern to "source" #38495
Problem:
Currently, there's no way to distinguish progress messages coming from
different sources. Nor can Progress event be easily filtered based on
source.

Solution:
- Add "source" field to nvim_echo-opts.
- The Progress event pattern is now defined by the "source" field.
- Include the "title" as ev.data.
- Unrelated change: set force=false to disable nesting.
2026-03-27 06:24:14 -04:00
zeertzjq
925e9e8722 vim-patch:c84526d: runtime(amiga): revamp syntax highlighting and add new maintainer (#38503)
closes: vim/vim#19825

c84526dd29

Co-authored-by: Ola Söder <rolfkopman@gmail.com>
2026-03-27 09:17:47 +08:00
phanium
ae2829ee35 fix(ui2): ENTER may focus pager in insert/terminal mode #38497
fix(ui2): prevent <CR> from focusing pager in insert/terminal mode

Problem:  <CR> in insert/terminal mode can focus pager unexpectedly.
Solution: Don't enter the pager when <CR> is pressed during expanded
          cmdline in insert/terminal mode.
2026-03-26 13:42:46 -04:00
luukvbaal
d80d7a3eb4 fix(ui2): no paging in dialog below expanded cmdline #38489
Problem:  When entering the cmdline below expanded messages, those
          messages are moved to the dialog window. The dialog window
          supports paging but that is unexpected in this situation where
          it just serves to keep (some of, exactly those that were
          visible before the cmdline was entered) the messages visible.
          Wrong highlight group for dialog "more" message.
Solution: Don't create the `vim.on_key()` dialog pager callback after
          entering the cmdline below expanded messages.
          Use the MsgMore highlight group for the paging hint title.
2026-03-26 05:55:23 -04:00
Shadman
3e6d5875ca refactor(progress): simplify progress-status format #38491
Problem:
Currently we are using
if 1 item then
  {title}: {percent}%
else
  Progress: {AVG}%({N})
dropping {title} and Progress text saves up space in statusline plus makes the format consistent, less jumping around.

Solution:
Use `{AVG}%({N})` for all cases.
2026-03-26 05:47:16 -04:00
Lewis Russell
ea878f456a fix(treesitter): ignore stale fold refresh callbacks
Problem:

The fold refresh path for foldminlines/foldnestmax creates a new
FoldInfo and starts an async parse. If FileType or BufUnload re-enters
before that callback returns, foldinfos[bufnr] can be cleared or
replaced. The callback then indexes a stale slot and raises an "attempt
to index a nil value" error.

Solution:

Capture the FoldInfo created for the refresh and carry that object
through the async callback. Before calling foldupdate(), verify that the
buffer still points at the same FoldInfo generation; otherwise ignore
the stale callback.

AI-assisted: Codex

Fixes #38461
2026-03-25 16:12:52 +00:00
glepnir
4d04d0123d feat(api): nvim_set_hl{update:boolean} #37546
Problem: nvim_set_hl always replaces all attributes.

Solution: Add update field. When true, merge with existing
attributes instead of replacing. Unspecified attributes are preserved.
If highlight group doesn't exist, falls back to reset mode.
2026-03-25 06:01:50 -04:00
altermo
170ff4b244 refactor(treesitter): use same visual-select as lsp #38475
Problem
treesitter select over-complicates visual selection.

Solution
make it use same visual selection logic as lsp.
2026-03-25 05:20:42 -04:00
zeertzjq
6dfcb2b784 vim-patch:9.2.0237: filetype: ObjectScript routines are not recognized (#38479)
Problem:  filetype: ObjectScript routines are not recognized
Solution: Add ObjectScript routines detection for .mac, .int, and .inc
          files (Hannah Kimura)

Reference:
https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GORIENT_ch_intro#GORIENT_intro_routines

closes: vim/vim#19805

25f6539645

Co-authored-by: Hannah Kimura <hannah.kimura@intersystems.com>
2026-03-25 01:02:04 +00:00
zeertzjq
ecc2414eae vim-patch:955c02d: runtime(sh): Distinguish parts of function definitions
- Highlight keywords "function" and "namespace" with
  the "Keyword" group ("shFunctionKey").
- Highlight function body delimiters "{" and "}" with the
  "Delimiter" group ("shFunctionExprRegion").
- Highlight function body delimiters "(" and ")" with the
  "Operator" group ("shFunctionSubShRegion").
- Also, follow one style in folding all supported variants
  of function bodies for grouping commands too by enclosing
  a delimited function body, e.g. "{" and "}", in a fold and
  leaving its function header, e.g. "function f()", out of
  it when the header is written on a separate line.

To restore previous colouring, add to "after/syntax/sh.vim":
------------------------------------------------------------
hi link shFunctionKey Function
hi link shFunctionExprRegion Function
hi link shFunctionSubShRegion Function
------------------------------------------------------------

fixes:  https://github.com/vim/vim/pull/19638#issuecomment-4052635546
closes: vim/vim#19638

955c02dff7

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2026-03-25 07:38:22 +08:00
zeertzjq
cedafc86df vim-patch:9c0d057: runtime(sh): Improve the matching of function definitions
- Drop the remaining undefined "shFunctionStart" references
  (gone in v7.2b.000, c236c16d0).
- Revise nestable contexts where function definitions are
  supported:
  * Stop looking for function definitions in arithmetic
    expressions.
  * Recognise function definitions enclosing other function
    definitions.
- In addition to grouping commands "{}" and "()", also match
  other compound commands (e.g. "if"; see "shFunctionCmd*")
  whenever these commands are supported as complete function
  bodies.
- Balance body delimiters "(" and ")" for "shFunctionFour"
  in Bash; match such function bodies whenever the use of
  the function parameter list "()" token is optional, i.e.
  when the "function" reserved word is present.
- Enable the use of "shFunctionFour" definitions.
- Do not claim optional leading whitespace characters before
  a matched function definition.
- Prefer patterns with ASCII atoms (e.g. "\h") to equivalent
  collections (e.g. "[A-Za-z_]") for speed.
- Accommodate word-boundary assertions in function name
  patterns to names that may start and/or end with supported
  non-word characters, e.g. "@test:".
- Match more valid function names in Bash: non-ASCII names,
  non-word names.
- Allow for function names with "do", "done", etc. prefixes;
  confine these name checks to "shDoError" and "shIfError".

fixes:   vim/vim#19619
related: vim/vim#19638

References:
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_09_04
https://gitweb.git.savannah.gnu.org/gitweb/?p=bash.git;a=blob_plain;f=doc/bash.html;hb=637f5c8696a6adc9b4519f1cd74aa78492266b7f
https://web.archive.org/web/20151105130220/http://www.research.att.com/sw/download/man/man1/ksh88.html
https://web.archive.org/web/20151025145158/http://www2.research.att.com/sw/download/man/man1/ksh.html
http://www.mirbsd.org/htman/i386/man1/mksh.htm

9c0d057e3d

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Co-authored-by: Johnothan King <johnothanking@protonmail.com>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-03-25 07:38:21 +08:00
Justin Mayhew
b02d1303b8 fix(pack): add trailing newline to lockfile #38469
Problem: JSON files should end with a trailing newline so that Unix
  tools work as expected, Git doesn't report "No newline at end of file"
  and to avoid noise in diffs from editors and other tools adding the
  missing newline.

Solution: Add trailing newline.
2026-03-24 13:23:17 -04:00
luukvbaal
b2adfe775d fix(ui2): show messages in dialog window when entering expanded cmdline #38465
Problem:  - With expanded messages exceeding cfg.msg.cmd.height, entering
            the cmdline scrolls to the bottom and expands to the full "cmd"
            buffer text height.

          - Cursor in the pager is not always at the last message and at
            the bottom of the window when appending to the pager.

          - unreliable test: messages2_spec: "closed msg window timer removes
            empty lines".
Solution: - Achieve separation of the cmdline and message text by moving
            messages to the dialog window when entering the cmdline below
            expanded messages.

          - Set cursor to start of the first message only when first
            entering the pager. Use `norm! zb` to position last message
            at the bottom of the window (which shouldn't crash anymore
            since 911337eb).

          - Increase cfg.msg.msg.timeout used in the test file.
2026-03-24 09:53:25 -04:00
Yochem van Rosmalen
042c66e4f9 docs: job-control.txt => flow layout #38463 2026-03-24 08:30:23 -04:00
Shadman
0af01948f3 fix(progress): show progress-status only in curwin #38458
Problem:
Currently same progress stat get's displayed on statusline of all
windows. This is repeatitive and noisy.

Solultion:
Only display progress-status on the focused window

Problem:
Currently, when multiple progress are on going we show it as Progress:
{N} items {percent}% format. It can be simplified sinnce items doesn't
really add enough value for the valuable space it takes in statusline

Solution:
Change format to Progress: {percent}%({N})
2026-03-24 08:28:44 -04:00
Yochem van Rosmalen
10ca09a2cb fix(vim.net): always pass response body to on_response #38460
Problem:
on_response(err, response) handler doesn't receive a response when an
output buffer or path is supplied to vim.net.request. User might want to
both output output to a file/buffer and also do something with it on
response.

Solution:
If an on_response handler was given, then pass the response to it.
2026-03-24 07:30:00 -04:00
Justin M. Keyes
ebc9811149 Merge #38402 from justinmk/doc2 2026-03-24 06:56:01 -04:00
Eisuke Kawashima
39bb5d7ca2 fix(runtime): stop treesitter highlight in b:undo_ftplugin #38459
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2026-03-24 05:17:02 -04:00
zeertzjq
929f03fa8c vim-patch:c9eaff0: runtime(java): Make changes for JDK 26 (#38452)
Reintroduce supported syntax-preview-feature numbers 455,
488, and 507 as _a new number_ 530.

Reference:
https://openjdk.org/jeps/530 (Primitive Types in Patterns etc.)

closes: vim/vim#19793

c9eaff0a8a

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2026-03-24 00:01:43 +00:00
Anakin Childerhose
1de1c08210 vim-patch:9.2.0235: filetype: wks files are not recognized (#38451)
Problem:  filetype: wks files are not recognized.
Solution: Detect *.wks, *.wks.in and *.wks.inc as wks filetype,
          include a filetype and syntax plugin (Anakin Childerhose)

The OpenEmbedded Image Creation tool, `wic` uses wic kickstarter files
to define image partition and bootloader layouts.
wks files can end with .wks, .wks.in for templated wks files, and
.wks.inc for including in other .wks files.

The autocmd for *.wks.inc needs to come before *.inc in
runtime/ftdetect.vim

Reference:
https://docs.yoctoproject.org/ref-manual/kickstart.html#openembedded-kickstart-wks-reference
https://git.openembedded.org/openembedded-core/tree/scripts/lib/wic/canned-wks

closes: vim/vim#19796

8c116bbe79
2026-03-23 23:40:03 +00:00
Justin M. Keyes
c01a8741f6 test(lsp): get_configs resolves only necessary configs 2026-03-24 00:14:55 +01:00
Justin M. Keyes
a3b48b1054 docs: api, plugins, ui2 2026-03-24 00:14:55 +01:00
Yochem van Rosmalen
f29b3b5d45 feat(net): vim.net.request(outbuf) writes response to buffer #36164
Problem:
Non-trivial to write output of vim.net.request to buffer. Requires extra
code in plugin/net.lua which can't be reused by other plugin authors.

```
vim.net.request('https://neovim.io', {}, function(err, res)
  if not err then
    local buf = vim.api.nvim_create_buf(true, false)
    if res then
      local lines = vim.split(res.body, '\n', { plain = true })
      vim.api.nvim_buf_set_lines(buf, 0, -1, true, lines)
    end
  end
end)
```

Solution:
Accept an optional `outbuf` argument to indicate the buffer to write output
to, similar to `outpath`.

    vim.net.request('https://neovim.io', { outbuf = buf })

Other fixes / followups:
- Make plugin/net.lua smaller
- Return objection with close() method
- vim.net.request.Opts class
- vim.validate single calls
- Use (''):format(...) instead of `..`
2026-03-23 18:48:03 -04:00
Tristan Knight
7c3df3e2ea fix(lsp): get_namespace signature (#38449)
Problem: Since the change to `pull_id` in #37938 we used the
deprecated signature internally

Solution: Don't
2026-03-23 15:42:47 -07:00
Yochem van Rosmalen
3e93793bb1 docs: change lua-bit to new layout #38447
Problem:
Flow layout looks better on neovim.io. Nvim-owned help files should
switch to the new layout. Also lua-bit.txt doesn't use the same format
for function documentation as the other docs (such as api.txt).

Solution:
Switch to new layout. Tweak the function documentation to be in line
with the other docs style.
2026-03-23 17:41:48 -04:00
Gregory Anders
a728eb7af1 refactor(treesitter)!: remove "all" option of Query:iter_matches #33070
This option was introduced to help with transitioning to the new
behavior during the 0.11 release cycle with the intention of removing in
0.12.
2026-03-23 14:34:14 -04:00
glepnir
f2d0b06ecb fix(lsp): completion word includes leading space from label #38435
Problem: clangd prepends a space/bullet indicator to label. With
labelDetailsSupport enabled, the signature moves to labelDetails,
making label shorter. This flips the length comparison in
get_completion_word, causing it to use item.label directly and
insert the indicator into the buffer.

Solution: only prefer filterText over label when label starts with non-keyword
character in get_completion_word fallback branch.
2026-03-23 11:02:30 -04:00
Justin M. Keyes
3a3c6f0907 refactor: rename termcap.lua -> tty.lua #38437
Problem:
The `termcap.lua` module is too narrowly named. We may need a place for
tty-related functionality in the future.
https://github.com/neovim/neovim/pull/31399#discussion_r1882598297

Solution:
This isn't a public/documented interface, so just rename it.
2026-03-23 10:14:48 -04:00
skewb1k
9a5641b4b5 fix(lua): drop support for boolean buf in vim.keymap #38432
Problem:
`vim.keymap.*.Opts.buf` allows `boolean` aliases for more widely
used `integer?` values, `true` -> `0` and `false` -> `nil`. This
conversion is unnecessary and can be handled at call sites.

Solution:
As a follow-up to deprecating the `buffer` option, drop support for
boolean values for the new `buf` option. The deprecated `buffer`
continues to support booleans for backward compatibility.
2026-03-23 08:00:53 -04:00
glepnir
4ed597389c fix(lsp): snippet preview blocked completionItem/resolve request #38428
Problem: Generating snippet preview in get_doc() populated the
documentation field before resolve, so the resolve request was
never sent.

Solution: Move snippet preview logic into on_completechanged and
the resolve callback so it no longer blocks the resolve request.
2026-03-23 07:57:36 -04:00
Barrett Ruth
d6a6eed4f3 feat(lsp): attach to buftype=help buffers #38412
Problem: `vim.lsp.enable()` skips all buffers with non-empty `buftype`,
including `help` buffers. LSPs targeting `filetype='help'` never
auto-attach despite help buffers being real files.

Solution: Expand the `buftype` guard in `lsp_enable_callback` to allow
`help` alongside `""`.
2026-03-23 07:30:35 -04:00
Justin M. Keyes
59eadebe33 fix(runtime)!: move "tohtml" to pack/dist/opt/ #34557
Problem:
The "tohtml" plugin is loaded by default.

Solution:
- Move it to `pack/dist/opt/nvim.tohtml/`, it is an "opt-in" plugin now.
- Document guidelines.
- Also revert the `plugin/` locations of `spellfile.lua` and `net.lua`.
  That idea was not worth the trouble, it will be too much re-education
  for too little gain.
2026-03-23 06:41:00 -04:00
zeertzjq
e51f217be7 vim-patch:9.2.0223: Option handling for key:value suboptions is limited (#38426)
Problem:  Option handling for key:value suboptions is limited
Solution: Improve :set+=, :set-= and :set^= for options that use
          "key:value" pairs (Hirohito Higashi)

For comma-separated options with P_COLON (e.g., diffopt, listchars,
fillchars), :set += -= ^= now processes each comma-separated item
individually instead of treating the whole value as a single string.

For :set += and :set ^=:
- A "key:value" item where the key already exists with a different value:
  the old item is replaced.
- An exact duplicate item is left unchanged.
- A new item is appended (+=) or prepended (^=).

For :set -=:
- A "key:value" or "key:" item removes by key match regardless of value.
- A non-colon item removes by exact match.

This also handles multiple non-colon items (e.g., :set
diffopt-=filler,internal) by processing each item individually, making
the behavior order-independent.

Previously, :set += simply appended the value, causing duplicate keys to
accumulate.

fixes:  vim/vim#18495
closes: vim/vim#19783

e2f4e18437

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 10:13:48 +08:00
zeertzjq
6cd1fe9a66 vim-patch:9.2.0225: runtime(compiler): No compiler plugin for just (#38424)
Problem:  runtime(compiler): No compiler plugin for just
Solution: Add a compiler plugin for the just command runner, add a test
          (Aditya Malik)

Sets makeprg and a custom errorformat to parse just's multi-line
error output into quickfix entries with file, line, column, and
message. Includes a test.

Reference:
- https://github.com/casey/just

closes: vim/vim#19773

e147b635fc

Co-authored-by: Aditya Malik <adityamalik2833@gmail.com>
2026-03-22 23:14:49 +00:00
Maria Solano
471213ee61 revert: "feat(lsp): add buftypes field to vim.lsp.Config" #38421
revert: "feat(lsp): add `buftypes` field to `vim.lsp.Config` (#38380)"

This reverts commit cfcdbcf638.
2026-03-22 13:33:11 -04:00
Eisuke Kawashima
51aa64488d fix(provider): support python3.14 #38419
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2026-03-22 09:20:04 -04:00
Justin M. Keyes
256811a617 Merge #38410 from justinmk/fix-numbered-list-html 2026-03-21 21:13:26 -04:00
Justin M. Keyes
e12a9e7c4e docs: starting.txt new layout 2026-03-22 01:57:28 +01:00
Justin M. Keyes
4397c4b117 fix(docs): improve adjacent list items
Problem:
List items separated by blank lines are wrapped in "blocks", then the
html generator does not treat them as contiguous list-items, and the
browser shows the list as "1. 1. 1." instead of "1. 2. 3.".

Solution:
- When generating a list-item, check if the last child of the previous
  block was a list-item, and merge them together.
- Massage the help source.

fix #37220
2026-03-22 01:57:28 +01:00
Barrett Ruth
cfcdbcf638 feat(lsp): add buftypes field to vim.lsp.Config (#38380)
Problem: `vim.lsp.enable()` skips buffers with `buftype` set, even when
`filetype` matches.

Solution: Add `buftypes` field to `vim.lsp.Config`.
2026-03-21 17:09:01 -07:00
KrrishJain
0db8efcbe4 fix(lsp): restore virtual document color visibility (#38407)
Problem: Default swatch unicode character got lost.

Solution: Put it back where it belongs.

---------

Co-authored-by: vnadgaonkar-spec <vnadgaonkar@gmail.com>
Co-authored-by: Christian Clason <ch.clason+github@icloud.com>
2026-03-22 00:34:44 +01:00
glepnir
cc518cf9ba feat(lsp): support CompletionItem.labelDetails #38403
Problem: CompletionItem.labelDetails is ignored, losing
function signatures and module info in the completion menu.

Solution: Append labelDetails.detail to abbr and use
labelDetails.description for menu with fallback to item.detail.

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItemLabelDetails
2026-03-21 19:07:26 -04:00
skewb1k
4d3a67cd62 feat(lua): replace buffer with buf in vim.keymap.set/del #38360
The `buffer` option remains functional but is now undocumented.
Providing both will raise an error. Since providing `buf` was disallowed
before, there is no code that will break due to using `buffer` alongside
`buf`.
2026-03-21 12:00:06 -04:00
luukvbaal
fbac2e5edc feat(ui2): configure maximum window heights #38392
Problem:
- Window height is set dynamically to match the text height,
  making it difficult for the user to use a different height.
- Cmdwin is closed to enter the pager but still taken into
  account for the pager position, and not restored when
  the pager is closed.
- Dialog pager handler may unnecessarily consume <Esc>.

Solution:
- Add maximum height config fields for each of the UI2 windows,
  where a number smaller than one is a fraction of 'lines',
  absolute height otherwise (i.e. `cfg.msg.pager.height = 0.5`).
- If the cmdwin will be closed to enter the pager, don't try
  to position the pager above it. Re-enter the cmdwin when the
  pager is closed.
- Only add vim.on_key() handler for the dialog paging is actually
  possible.
2026-03-21 10:20:06 -04:00
Sergei Slipchenko
7a5e9ef0aa fix(lsp/diagnostic): use diagnostic provider identifier for code actions #38401
Problem:
f9b2189b28 started using namespaces
for pull diagnostics that look like this `<id>:<identifier>`.
`vim.lsp.buf.codeaction` passes `true` instead of an identifier
to `vim.lsp.diagnostic.get_namespace`, resulting in a namespace that
looks like `<id>:nil`. The end result is that none of the diagnostics are
passed to `textDocument/codeAction` request. Because of that server
might not send any code actions back. For example, eslint lsp responds
with an empty list of actions if it receives no diagnostics.

Solution:
use `_provider_foreach` to collect diagnostics from all `identifiers`
and use that identifier to get a namespace instead of `true`.
2026-03-21 09:38:11 -04:00
zeertzjq
0655a359ae vim-patch:9.2.0217: filetype: cto files are not recognized (#38400)
Problem:  filetype: cto files are not recognized
Solution: Detect *.cto as concerto filetype (Jamie Shorten)

Add filetype detection for the Concerto Modelling Language. Concerto
is a schema language by the Accord Project for defining data models
used in smart legal contracts and business networks.

Reference:
Language spec: https://concerto.accordproject.org
Tree-sitter grammar: https://github.com/accordproject/concerto-tree-sitter

closes: vim/vim#19760

68f9dedba4

Co-authored-by: Jamie Shorten <jamie@jamieshorten.com>
2026-03-21 08:50:15 +08:00
zeertzjq
6d84209eae vim-patch:ce4fbda: runtime(fish): Add matchit support to filetype plugin (#38399)
closes: vim/vim#19701

ce4fbda992

Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-03-21 08:49:41 +08:00