Commit Graph
5127 Commits
Author SHA1 Message Date
zeertzjqandGirish Palya 739fc26d77 vim-patch:80981e1: runtime(doc): mention 'findfunc' at :h :find (#35697)
fixes: vim/vim#18250
related: vim/vim#18253

https://github.com/vim/vim/commit/80981e1db93d2ebb4060fa1368fe76e336c1d65b

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-10 07:02:53 +08:00
bfredl b95aedeae4 Merge pull request #35536 from bfredl/skipahead
perf(highlight): allow decoration providers to skip ranges without data

fixes #35644
2025-09-09 20:53:31 +02:00
bfredl f9d2115a35 perf(highlight): allow decoration providers to skip ranges without data
Continuing the work of #31400

That PR allowed the provider to be invoked multiple times per line.
We want only to do that when there actually is more data later on the
line. Additionally, we want to skip over lines which contain no new
highlight items. The TS query cursor already tells us what the next
position with more data is, so there is no need to reinvoke the range
callback before that.

NB: this removes the double buffering introduced in #32619 which
is funtamentally incompatible with this (nvim core is supposed to keep
track of long ranges by itself, without requiring a callback reinvoke
blitz). Need to adjust the priorities some other way to fix the same issue.
2025-09-09 12:54:04 +02:00
zeertzjqandGirish Palya eb19206e03 vim-patch:9.1.1742: complete: preinsert does not work well with 'autocomplete' (#35692)
Problem:  complete: preinsert does not work well with preinsert
Solution: Make "preinsert" completeopt value work with autocompletion
          (Girish Palya)

This change extends Insert mode autocompletion so that 'preinsert' also
works when 'autocomplete' is enabled.

Try: `:set ac cot=preinsert`

See `:help 'cot'` for more details.

closes: vim/vim#18213

https://github.com/vim/vim/commit/fa6fd41a943e6442c1a2ce6b0a237298b00ecca0

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-09 03:35:41 +00:00
zeertzjqandGirish Palya 327a2d57eb vim-patch:d7d6a6f: runtime(doc): Improve doc for cmdline-autocompletion
- Address https://github.com/vim/vim/pull/18219#issuecomment-3264634710
- Make the cmdline-autocompletion help more user friendly

closes: vim/vim#18245

https://github.com/vim/vim/commit/d7d6a6f05a536b443188ff95a45bbd46485f11fb

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-09 08:30:34 +08:00
Justin M. Keyes 1cb1cfead0 docs: drop "xx.vim" syntax help-tags #35623
Problem:
These "foo.vim" syntax tags add 100+ useless tags to help. In
particular, "progress.vim" is the first match for "progress", which not
the result anyone is actually looking for, since Nvim 0.12 gained the
"progress-message" feature.

Solution:
Drop the "foo.vim" syntax tags. The "ft-foo" tags are more appropriately
named.
2025-09-07 20:45:22 -07:00
zeertzjqandGirish Palya 29f30ad91c vim-patch:9.1.1679: unclear what key causes CmdlineLeave autocommand (#35677)
Problem:  unclear what key causes CmdlineLeave autocommand
Solution: Set |v:char| to the key (Girish Palya).

related: vim/vim#17806
closes: vim/vim#18063

https://github.com/vim/vim/commit/ba9551d131d608b71155bacc0c4a65264f1f5f7c

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-08 11:40:12 +08:00
Evgeni Chasnovski 0c49167490 docs: adjust *lua-plugin-init* wording #35600
Problem: Unnecessarily anecdotal wording.

Solution: Adjust wording while delivering the same message.
2025-09-07 15:04:09 -07:00
skewb1k 448f15ca39 feat(json): pretty-format (indent) with vim.json.encode() #35424
Problem:
There is no straightforward way to pretty-print objects as JSON.
The existing `vim.inspect` outputs LON.

Solution:
Introduce an `indent` option for `vim.json.encode()` which enables
human-readable output with configurable indentation.

Adapts PR to upstream: openresty/lua-cjson#114
2025-09-07 14:38:27 -07:00
Evgeni Chasnovski 7853cde29a feat(pack): vim.pack.get() gets VCS info #35631
Problem:
Force resolve `spec.version` overrides the information about whether
a user supplied `version` or not. Knowing it might be useful in some use
cases (like comparing to previously set `spec` to detect if it has
changed).

Solution:
Do not resolve `spec.version`. This also improves speed when triggering
events and calling `get()`.
- Place default branch first when listing all branches.
- Use correct terminology in `get_hash` helper.
- Do not return `{ '' }` if there are no tags.

Problem:
There is no way to get more information about installed plugins, like
current revision or default branch (necessary if resolving default
`spec.version` manually). As computing Git data migth take some time,
also allow `get()` to limit output to only necessary set of plugins.

Solution:
- introduce arguments to `get(names, opts)`, which follows other
  `vim.pack` functions. Plugin extra info is returned by default and
  should be opt-out via `opts.info = false`.
  - Examples:
    - Get current revision: `get({ 'plug-name' })[1].rev`
    - Get default branch: `get({ 'plug_name' })[1].branches[1]`
- `update()` and `del()` act on plugins in the same order their names
  are supplied. This is less surprising.
- default `opts.info` to `true` since this simplifies logic for the
  common user, while still leaving the door open for a faster `get()` if
  needed.
2025-09-07 09:59:31 -07:00
Maria José Solano 21f2c2b19c docs(lsp): tweak inline_completion.get code snippet #35657
`replace_keycodes` is true if `expr` is set, and "Accept" is a better
term to describe the keymap.
2025-09-06 16:12:32 -07:00
Phạm Bình An 798bb3f66a docs: details dict in nvim_buf_get_extmark() #35289
Problem: The document of nvim_buf_get_extmark currently lacks the
following:
- "details" directory: nvim_buf_get_extmarks() allows an option details
  to get a "details" directory in result, but it doesn't mention where
  that "details" directory is, what fields does it have.

Solution: Add docs for "details" directory in nvim_buf_get_extmarks()
2025-09-06 13:38:31 -07:00
Justin M. Keyes 2affb8373f docs: api events 2025-09-04 00:11:52 -04:00
Justin M. KeyesandYochem van Rosmalen 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
zeertzjqandYochem van Rosmalen 1ae09bf545 vim-patch:4c39d0c: runtime(doc): quote partial urls with a backtick (#35606)
closes: vim/vim#18194

https://github.com/vim/vim/commit/4c39d0cc9b61dd512851c5145923cc52027f852d

Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
2025-09-03 09:07:01 +08:00
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
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
Riley BruinsandMaria José Solano 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
glepnir 1b3abfa688 docs(lsp): mention lsp/after/ in faq #35534 2025-08-30 10:31:16 -07: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
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
zeertzjqandYegappan Lakshmanan 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

https://github.com/vim/vim/commit/5e27058fc4a98dbea16f72bc54e76bbe1d455168

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-08-28 00:15:06 +00: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
zeertzjqandGirish Palya 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)

https://github.com/vim/vim/commit/c6a0f42cdb8b0d9c5beda98176caad0cf48550c2

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 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
Yi Ming 62b45b8fe4 feat(lua): conversion between extmark positions 2025-08-24 19:38:38 +08:00
Yi Ming 7499c9f9a7 feat(lua): conversion between cursor positions 2025-08-24 19:38:38 +08:00
zeertzjqandGirish Palya 810a234978 vim-patch:9.1.1672: completion: cannot add timeouts for 'cpt' sources (#35447)
Problem:  completion: cannot add timeouts for 'cpt' sources
          (Evgeni Chasnovski)
Solution: Add the 'autocompletetimeout' and 'completetimeout' options
          (Girish Palya)

fixes: vim/vim#17908
closes: vim/vim#17967

https://github.com/vim/vim/commit/69a337edc15a6c6eba6f16d2f3b7b223a149a938

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-24 13:16:55 +08:00
zeertzjqandHirohito Higashi 1c0465bec6 vim-patch:5ca1ea8: runtime(doc): Tweak documentation style
closes: vim/vim#18078

https://github.com/vim/vim/commit/5ca1ea83ad79c8d1ebd25e61c91f1199c9bc4f09

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-08-23 20:40:59 +08:00
zeertzjqandGirish Palya 4019d3050d vim-patch:9.1.1638: completion: not possible to delay the autcompletion
Problem:  completion: not possible to delay the autcompletion
Solution: add the 'autocompletedelay' option value (Girish Palya).

This patch introduces a new global option 'autocompletedelay'/'acl' that
specifies the delay, in milliseconds, before the autocomplete menu
appears after typing.

When set to a non-zero value, Vim waits for the specified time before
showing the completion popup, allowing users to reduce distraction from
rapid suggestion pop-ups or to fine-tune the responsiveness of
completion.

The default value is 0, which preserves the current immediate-popup
behavior.

closes: vim/vim#17960

https://github.com/vim/vim/commit/a09b1604d4fe7516d87fbcbf2ffd2dc484799b23

N/A patch: vim-patch:9.1.1641: a few compiler warnings are output

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-23 20:40:58 +08:00
Gregory Anders 586b1b2d9b feat(tui): add nvim_ui_send (#35406)
This function allows the Nvim core to write arbitrary data to a TTY
connected to a UI's stdout.
2025-08-22 15:05:43 -05:00
Evgeni Chasnovski 1ffaaa06c5 docs(pack): document $XDG_DATA_HOME/nvim/site presence in 'packpath'
Problem: Some use cases might lead to `vim.pack.add()` failing to
`:packadd` a plugin because of missing entry in 'packpath'. Like with
`nvim --clean` or manually setting `$XDG_DATA_HOME` during startup.

Solution: Document it. A more proactive approach can be ensuring correct
'packpath' entry, but it is currently somewhat verbose to do (due to
having to adjust for Windows using `\` in 'packpath' entries).
2025-08-22 13:41:36 +03:00
c522cb0e96 feat(pack): support user-defined data in plugin spec #35360
Problem:
The load function in opts was difficult to use if you wished to
customize based on the plugin being loaded.

You could get the name, but without some way to mark a spec, that was of
limited usefulness unless you wanted to hardcode a list of names in the
function, or write a wrapper around the whole thing

Solution:
Allow users to provide an arbitrary data field in plugin specs so that
they may receive info as to how to handle that plugin in load, get() and
events, and act upon it

Co-authored-by: BirdeeHub <birdee@localhost>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
2025-08-21 10:08:29 -07:00
zeertzjq 7d53982b7f vim-patch:84a343a: runtime(doc): correct another problem in :h items()
The returned value is only in arbitrary order for a Dict.

closes: vim/vim#18050

https://github.com/vim/vim/commit/84a343a6ed34995adc67c062b64533c1b0bf7fb1
2025-08-21 08:44:08 +08:00
zeertzjqandChristian Brabandt 1fdacbb3e4 vim-patch:44c8072: runtime(doc): fix style and clarify items() function for String type
related: vim/vim#18021

https://github.com/vim/vim/commit/44c8072ef64a7a218eb8cf4b72866921762633e4

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-21 08:44:08 +08:00
zeertzjqandYegappan Lakshmanan 049de6f119 vim-patch:partial:308a313: runtime(doc): Update help for the items() function
closes: vim/vim#18021

https://github.com/vim/vim/commit/308a3130be89148cdaf83bfaf00e3e7c69ed2133

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-08-21 08:44:07 +08:00
zeertzjqandWuJunkai2004 ba25f3e4d4 vim-patch:9.1.1647: filetype: Cangjie files are not recognized
Problem:  filetype: Cangjie files are not recognized
Solution: Detect *.cj files as cangjie filetype, include a syntax plugin
          (WuJunkai2004)

This commit introduces a new syntax highlighting file for the Cangjie
programming language, includes 4 parts as required:
- The main syntax file: runtime/syntax/cangjie.vim
- The filetype detection rule in: runtime/filetype.vim
- The documentation update in: runtime/doc/syntax.txt
- Some menus

References:
- https://gitcode.com/Cangjie
- https://cangjie-lang.cn/

fixes: 18014
closes: vim/vim#18027

https://github.com/vim/vim/commit/0c4405a6b2bc4d93c127e1b66da1b93dcfbbe3db

Co-authored-by: WuJunkai2004 <wujunkai20041123@outlook.com>
2025-08-20 07:23:49 +08:00
TheBlob42 701258921e feat(snippet): highlight active tabstop (#35378) 2025-08-19 06:21:32 -07:00
Justin M. Keyes 1b2a6e0664 Merge #35018 refactor(lsp): centralized enable/is_enabled strategy 2025-08-18 10:57:57 -04:00
Yi Ming b3fbc8d6fa refactor(lsp): move util.enable to capability.enable 2025-08-18 19:41:53 +08:00
Justin M. Keyes 960b33a9d8 docs: misc, dev-api-fast, $XDG_STATE_HOME #35138 2025-08-17 20:45:40 -07:00
Justin M. Keyes d8ed43c6a7 Merge #35109 vim.pos, vim.range 2025-08-17 16:37:56 -04:00