9402 Commits

Author SHA1 Message Date
Evgeni Chasnovski
069be91106 feat(pack): use nvim_echo{kind=progress} to report progress #35625
Problem: Progress reports use plain `nvim_echo()` with manually
  constructed messages and populate history on every call.

Solution: Use `nvim_echo()` with newly added `kind=progress` which (at
  least for now) is meant to be a unified interface for showing progress
  report. Also save in history only first and last progress report
  messages.
2025-09-05 07:12:28 -07:00
zeertzjq
0bafbe872b vim-patch:9.1.1732: filetype: .inc file detection can be improved (#35635)
Problem:  filetype: .inc file detection can be improved
Solution: Update filetype detection for Pascal and BitBake code
          (Martin Schwan).

Fix the detection of .inc files containing Pascal and BitBake code:

- the concatenated string, merged from three lines, only contains one
  beginning and the pattern "^" would not match as expected. Use a range()
  loop to iterate each line string individually. This way, the pattern "^"
  works for beginning of lines.

- improve BitBake include file detection by also matching forward-slashes
  "/" in variable names and assignment operators with a dot ".=" and "=.".
  Valid examples, which should match, are:

    PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
    MACHINEOVERRIDES =. "qemuall:"
    BBPATH .= ":${LAYERDIR}"

- parse twenty instead of just three lines, to accommodate for potential
  comments at the beginning of files

closes: vim/vim#18202

9fd1a657d2

Co-authored-by: Martin Schwan <m.schwan@phytec.de>
2025-09-05 17:22:24 +08:00
Justin M. Keyes
2affb8373f docs: api events 2025-09-04 00:11:52 -04:00
Justin M. Keyes
9c3099f0cf docs: lsp, misc
- Problem: It's not clear for new plugin developers that `:help` uses
  a help-tags file for searching the docs, generated by `:helptags`.
  - Solution: Hint to the |:helptags| docs for regenerating the tags
    file for their freshly written documentation.

Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
2025-09-03 23:03:51 -04:00
zeertzjq
17da1ad8f4 vim-patch:9.1.1730: filetype: vivado journal/log files are not recognized (#35613)
Problem:  filetype: vivado journal/log files are not recognized
Solution: Detect vivado*.{jou,log} as tcl filetype (Wu Zhenyu).

closes: vim/vim#18191

9a6cafdc1c

Also fix missing anchor in the pattern from the port of patch 9.1.1602.

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-09-04 07:16:47 +08:00
zeertzjq
967d226f96 vim-patch:f165798: runtime(m4): update syntax script
This change does the following to the M4 syntax script:

- In M4 there are no "strings" in the usual sense. Instead, M4 has
  quotes, but the text inside a quoted region is rescanned just like
  outside, and quotes can be nested.
- The old m4String region was misleading and removed. A new m4Quoted
  region reflects proper quoting semantics.
- Removed a duplicate highlight rule.
- Fixed a typo in a highlight group name (m4builtin → m4Builtin).
- Added a reference link to the POSIX M4 specification.
- Removed outdated maintainer URL.

closes: vim/vim#18192

f165798184

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-09-03 21:28:11 +08:00
zeertzjq
c4c9daf7e2 vim-patch:e0704a3: runtime(keymap): Add transliteration (buckwalter) arabic keymap
References:
- https://en.wikipedia.org/wiki/Buckwalter_transliteration
- http://qamus.org/transliteration.htm

closes: vim/vim#18186

e0704a3593

Co-authored-by: Rafael Ketsetsides <rketsetsides@gmail.com>
2025-09-03 21:27:24 +08:00
zeertzjq
1ae09bf545 vim-patch:4c39d0c: runtime(doc): quote partial urls with a backtick (#35606)
closes: vim/vim#18194

4c39d0cc9b

Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
2025-09-03 09:07:01 +08:00
Shadman
79bfeecdb4 feat(editor)!: insert-mode ctrl-r should work like paste #35477
Problem:
insert-mode ctrl-r input is treated like raw user input, which is almost
never useful. This means any newlines in the input are affected by
autoindent, etc., which is:
- slow
- usually breaks the formatting of the input

Solution:
- ctrl-r should be treated like a paste, not user-input.
- does not affect `<c-r>=`, so `<c-r>=@x` can still be used to get the
  old behavior.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-09-01 21:05:16 -07:00
zeertzjq
b4d21f141c vim-patch:71149df: runtime(java): Dismiss "g:markdown_fenced_languages" for Java buffers (#35596)
No support is provided or planned for language recognition
in code snippets of documentation comments.  Requesting to
load arbitrary syntax plugins with the aid of the concerned
variable is therefore wasteful in general and erroneous when
paired languages ":syn-include" one another without taking
steps to manage circularity.

related: vim/vim#17308
related: vim/vim#17220
closes: vim/vim#18172

71149dfec5

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-09-02 08:28:07 +08:00
Justin M. Keyes
a5e7ccc329 docs: Lua plugin development guide 2025-09-01 19:42:45 -04:00
Marc Jakobi
28ab656122 docs: Lua plugin development guide 2025-09-01 18:42:02 -04:00
Shadman
8a12a01466 feat(progress): better default format + history sync #35533
Problem:
The default progress message doesn't account for
message-status. Also, the title and percent sections don't get written
to history. And progress percent is hard to find with variable length messages.

Solution:
Apply highlighting on Title based on status. And sync the formated msg
in history too. Also updates the default progress message format to
{title}: {percent}% msg
2025-09-01 15:13:21 -07:00
Yochem van Rosmalen
4cda52a5d1 docs(treesitter): fix language-injection url #35592 2025-09-01 14:08:08 -07:00
Justin M. Keyes
d8a8825679 feat(lua): vim.wait() returns callback results #35588
Problem:
The callback passed to `vim.wait` cannot return results directly, it
must set upvalues or globals.

    local rv1, rv2, rv3
    local ok = vim.wait(200, function()
      rv1, rv2, rv3 = 'a', 42, { ok = { 'yes' } }
      return true
    end)

Solution:
Let the callback return values after the first "status" result.

    local ok, rv1, rv2, rv3 = vim.wait(200, function()
      return true, 'a', 42, { ok = { 'yes' } }
    end)
2025-09-01 13:26:46 -07:00
Yi Ming
6888f65be1 feat(lsp): vim.lsp.inline_completion on_accept #35507 2025-09-01 08:46:29 -07:00
Volodymyr Chernetskyi
06df337617 vim-patch:9.1.1718: filetype: kubectl config file is not recognized #35583
Problem:  filetype: kubectl config file is not recognized
Solution: Detect .kube/kubectl as yaml filetype
          (Volodymyr Chernetskyi).

References:
- https://kubernetes.io/docs/reference/kubectl/kuberc/

closes: vim/vim#18169

6cd6857cbe
2025-09-01 08:16:43 -07:00
Volodymyr Chernetskyi
8fc1db043a vim-patch:9.1.1717: filetype: AWS cli alias file is not recognized #35581
Problem:  filetype: AWS cli alias file is not recognized
Solution: Detect .aws/cli/alias as confini filetype
          (Volodymyr Chernetskyi).

References:
- https://docs.aws.amazon.com/cli/v1/userguide/cli-usage-alias.html

related: vim/vim#18169

be0589f1d2
2025-09-01 08:16:34 -07:00
Riley Bruins
77e3efecee feat(lsp): support textDocument/onTypeFormatting (#34637)
Implements [on-type
formatting](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_onTypeFormatting)
using a `vim.on_key()` approach to listen to typed keys. It will listen
to keys on the *left hand side* of mappings. The `on_key` callback is
cleared when detaching the last on-type formatting client. This feature
is disabled by default.

Co-authored-by: Maria José Solano <majosolano99@gmail.com>
2025-08-31 14:09:12 -07:00
Michael Henry
f311c96973 fix(health): update advice for Python #35564
Problem: `:checkhealth` advice for Python is out-of-date.

Solution: Update the advice to point to `:help provider-python`.
2025-08-31 11:17:21 -07:00
glepnir
1b3abfa688 docs(lsp): mention lsp/after/ in faq #35534 2025-08-30 10:31:16 -07:00
Volodymyr Chernetskyi
c333d64663 vim-patch:9.1.1709: filetype: kyaml files are not recognized
Problem:  filetype: kyaml files are not recognized
Solution: Detect *.kyml files as yaml filetype
          (Volodymyr Chernetskyi)

References:
- https://kubernetes.io/blog/2025/08/27/kubernetes-v1-34-release/#alpha-support-for-kyaml-a-kubernetes-dialect-of-yaml

closes: vim/vim#18158

d5c89cc6bb

Co-authored-by: Volodymyr Chernetskyi <19735328+chernetskyi@users.noreply.github.com>
2025-08-30 11:58:00 +02:00
zeertzjq
6eebf30a39 vim-patch:7239d95: runtime(vim): Update base syntax, match :defer command argument (#35547)
closes: vim/vim#18159

7239d95bf2

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-08-30 08:15:01 +08:00
zeertzjq
8a2587be23 Merge pull request #35546 from zeertzjq/vim-a07a2f4
vim-patch:a07a2f4: runtime(astro): catch json_decode() error when parsing tsconfig.json
2025-08-30 08:14:15 +08:00
zeertzjq
68a2e0ef78 vim-patch:9.1.1713: filetype: fvwm2m4 files are no longer detected
Problem:  filetype: fvwm2m4 files are no longer recognized
          (after 9.1.1687).
Solution: Add a special case in m4 filetype detection (zeertzjq).

closes: vim/vim#18146

5355e81868

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-08-30 06:57:09 +08:00
zeertzjq
dab31a3637 vim-patch:9.1.1687: filetype: autoconf filetype not always correct
Problem:  filetype: autoconf filetype not always correct
Solution: Detect aclocal.m4 as config filetype, detect configure.ac as
          config filetype, fall back to POSIX m4 (Damien Lejay).

closes: vim/vim#18065

2b55474f0a

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-08-30 06:57:08 +08:00
bfredl
772f1966a3 Merge pull request #31400 from vanaigr/decor-provider-range
feat(decor): add range-based highlighting
2025-08-29 10:33:15 +02:00
zeertzjq
19f2e5c3eb vim-patch:b760062: runtime(debversions): Move bullseye, focal, and oracular to "unsupported" (#35531)
These versions have exited their standard support term as of
- bullseye: 2024-08-14
- focal: 2025-05
- oracular: 2025-07-10

closes: vim/vim#18134

b760062897

Co-authored-by: James McCoy <jamessan@jamessan.com>
2025-08-29 07:23:43 +08:00
Siddhant Agarwal
7a71235399 fix(server): serverlist({peer=true}) does not find peer servers #35506 2025-08-28 06:41:31 -07:00
Shadman
bc6737250d fix(progress): simplify ui-event, introduce default presentation #35527
Problem:
`msg_show` has "progress" info (title, status, percent) which is not presented
by default.

Solution:
Format TUI messages as `{title}: {msg}...{percent}%`. This also gets sent to UI.

- With specific formatting sent to UI we can remove the `progress` item from
  `msg_show` event. It can be added if needed in the future. Also, having
  a default presentation makes the feature more useful.
- For `vim._extui` we just need to implement the replace-msg-with-same-id
  behavior.
- If any UI/plugin wants to do anything fancier, they can handle the `Progress`
  event.
2025-08-28 06:33:41 -07:00
vanaigr
5edbabdbec perf: add on_range in treesitter highlighting 2025-08-28 08:22:38 -05:00
Christian Clason
c10e36fc01 refactor(lua): consistent use of local aliases 2025-08-28 11:34:01 +02:00
Meriel Luna Mittelbach
a33284c2c0 fix(health): accept TERM=tmux-direct #35511
tmux-direct is functionally the same as tmux-256color, except it
directly reports 24-bit color and how to set them (setaf/setab)
via ncurses 6.x's extended terminfo format.
2025-08-27 20:01:07 -07:00
Robert Muir
729111d3a3 fix(lsp): don't treat MarkedString[] with language id as empty #35518
Problem:
Hover response of MarkedString[] where the first element contains a
language identifier treated as empty.

Solution:
Fix empty check to handle case of MarkedString[] where the first element
is a pair of a language and value.
2025-08-27 18:51:30 -07:00
zeertzjq
2ac00f1350 vim-patch:9.1.1698: Some error numbers are not documented (#35522)
Problem:  Some error numbers are not documented
          (Restorer)
Solution: Document missing error numbers (Yegappan Lakshmanan).

fixes: vim/vim#18114
closes: vim/vim#18135

5e27058fc4

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-08-28 00:15:06 +00:00
Justin M. Keyes
bcf952e85f Merge #35505 from ofseed/lsp-fix-autocomplete 2025-08-27 13:33:17 -04:00
phanium
cd7cf4bd16 fix(extui): error on :call input('') (#35515)
Problem:  Error on empty string prompt.
Solution: (prompt .. '\n'):gmatch('(.-)\n').
2025-08-27 17:12:17 +02:00
Yi Ming
db1b7f7412 fix(lsp): update completion items on TextChangedP 2025-08-27 20:40:35 +08:00
Yi Ming
6c3e9b5573 fix(lsp): update on CursorHoldI cause users unable to select() 2025-08-27 20:38:49 +08:00
Yi Ming
6005fcf671 fix(lsp): opts.wrap always true 2025-08-27 20:02:42 +08:00
zeertzjq
117b129378 vim-patch:9.1.1694: filetype: Buck eXtension Lang files are not recognized (#35504)
Problem:  filetype: Buck eXtension Lang files are not recognized
Solution: Detect *.bxl files as bzl filetype.
          (Jade Lovelace)

References:
- https://buck2.build/docs/bxl/

closes: vim/vim#18130

3aea867b27

Co-authored-by: Jade Lovelace <jadel@mercury.com>
2025-08-27 12:23:31 +08:00
zeertzjq
6014174b71 vim-patch:3571388: runtime(lf): update syntax to support lf version r37 (#35503)
Adds the lf release 37 specific syntax highlighting changes.

From the PR andis-sprinkis/lf-vim#23 by @CatsDeservePets

closes: vim/vim#18115

3571388ded

Co-authored-by: Andis Spriņķis <andis@sprinkis.com>
2025-08-27 12:23:17 +08:00
Shadman
8b171852a9 feat(api): nvim_echo can emit Progress messages/events #34846
Problem:
Nvim does not have a core concept for indicating "progress" of
long-running tasks. The LspProgress event is specific to LSP.

Solution:
- `nvim_echo` can emit `kind="progress"` messages.
  - Emits a `Progress` event.
  - Includes new fields (id, status, percent) in the `msg_show` ui-event.
  - The UI is expected to overwrite any message having the same id.
- Messages have a globally unique ID.
  - `nvim_echo` returns the message ID.
- `nvim_echo(… {id=…})` updates existing messages.

Example:

    local grp = vim.api.nvim_create_augroup("Msg", {clear = true})
    vim.api.nvim_create_autocmd('Progress', {
      pattern={"term"},
      group = grp,
      callback = function(ev)
        print(string.format('event fired: %s', vim.inspect(ev))..'\n')
      end
    })

    -- require('vim._extui').enable({enable=true, msg={target='msg', timeout=1000}})
    vim.api.nvim_echo({{'searching'}}, true, {kind='progress',  percent=80, status='running', title="terminal(ripgrep)"})
    local id = vim.api.nvim_echo({{'searching'}}, true, {kind='progress', status='running', percent=10, title="terminal(ripgrep)"})
    vim.api.nvim_echo({}, true, {id = id, kind='progress', percent=20, status = 'running', title='find tests'})
    vim.api.nvim_echo({}, true, {id = id, kind='progress', status='running', percent=70})
    vim.api.nvim_echo({{'complete'}}, true, {id = id, kind='progress', status='success', percent=100, title="find tests"})

Followups:
- Integrate with 'statusline' by listening to the Progress autocmd event.
- Integrate progress ui-event with `vim._extui`.
2025-08-26 13:48:53 -07:00
zeertzjq
821bfc02fb vim-patch:9.1.1685: Missing changes from PR 18068 (#35482)
Problem:  Missing changes from PR 18068
Solution: Include the missing changes
          (Girish Palya)

c6a0f42cdb

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-26 07:24:21 +08:00
Justin M. Keyes
58060c2340 Merge #33972 feat(lsp): textDocument/inlineCompletion 2025-08-24 22:17:34 -04:00
Yi Ming
42f244bf18 fix(lsp): check whether buffer is valid when scheduled #35461 2025-08-24 18:59:56 -07:00
Yi Ming
0e70aa0e86 feat(lsp): support textDocument/inlineCompletion 2025-08-25 09:48:27 +08:00
Justin M. Keyes
bccec33f5a docs: misc #35459 2025-08-24 23:43:48 +00:00
Maria José Solano
1f63735f17 fix(lsp): treat nil inlay hint result as empty array (#35458)
`gopls` seems to send a nil result when there are no inlay hints for the
buffer. [The protocol](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_inlayHint)
allows for the server to send an array or nil, and it isn't clear what
nil should represent. I think it's reasonable to treat it as an empty
array though.
2025-08-24 15:46:08 -07:00
Yi Ming
40f5115ac4 fix(lua): disable strict_indexing when converting LSP positions 2025-08-24 21:02:02 +08:00