Commit Graph
4919 Commits
Author SHA1 Message Date
Lewis Russell 8cfb993fdf docs: support overloads and async 2025-06-16 09:18:42 +01:00
zeertzjqandglepnir b92e3889fe vim-patch:631a50c: runtime(doc): mention cannot ignored events in eventignorewin (#34522)
closes: vim/vim#17545

https://github.com/vim/vim/commit/631a50ceb9a312a9042a8e8420afd8e948497d90

Co-authored-by: glepnir <glephunter@gmail.com>
2025-06-16 02:14:20 +00:00
luukvbaalandphanium 29f2cb89f0 fix(messages): add append parameter to history entries (#34467)
Problem:  The "append" parameter added in abb40ece is missing from
          history entries, resulting in different message formatting
          for "g<".
Solution: Add "append" field to message history entries.

Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
2025-06-15 23:36:41 +02:00
luukvbaal 5046ef4c8f fix(extui): clear cmdline buffer for first message (#34490)
Problem:  Cmdline buffer is not cleared for a new message (since c973c7ae),
          resulting in an incorrect spill indicator. When the cmdline
          buffer is cleared, "msg_row" is not invalidated, resulting in
          an error. The extui module is untested.
          Return value of `vim.ui_attach()->callback` is undocumented.
Solution: Clear the cmdline buffer for the first message in an event
          loop iteration. Ensure msg_row passed as end_row does not
          exceed buffer length.
          Add `messages_spec2.lua` to test the extui module, keeping in
          mind that test coverage will greatly increase if this UI is made
          the default. As such, only tests for specific extui functionality
          unlikely to be covered by tests leveraging the current message grid.
          Document the return value of `vim.ui_attach()->callback`, it seems
          to make sense, and is also used to suppress remote UI events in
          `messages_spec2.lua`.
2025-06-15 12:55:01 +02:00
4367441213 docs: misc
Co-authored-by: Jan Weinkauff <jan@weinkauff.cloud>
Co-authored-by: MeanderingProgrammer <meanderingprogrammer@gmail.com>
Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
2025-06-14 17:24:36 +02:00
Riley Bruins 76d213efbe feat(lsp): support multiline semantic tokens #34458 2025-06-13 08:30:08 -07:00
Justin M. Keyes 8001276bd0 docs: vim.fs., diagnostics, lsp #34402 2025-06-13 07:49:21 -07:00
Riley Bruins 1d5b3b5b4c feat(treesitter)!: apply offset! directive to all captures #34383
This commit changes the `offset!` directive so that instead of setting a
`metadata.range` value for the entire pattern, it will set a
`metadata.offset` value. This offset will be applied to the range only
in `vim.treesitter.get_range()`, rather than at directive application
time. This allows the offset to be applied to any and all nodes captured
by the given pattern, and removes the requirement that `#offset!` be
applied to only a single node.

The downside of this change is that plugins which read from
`metadata.range` may be thrown off course, but such plugins should
prefer `vim.treesitter.get_range()` when retrieving ranges anyway.

Note that `#trim!` still sets `metadata.range`, and
`vim.treesitter.get_range()` still reads from `metadata.range`, if it
exists.
2025-06-13 06:42:10 -07:00
Luuk van Baal 9ec6c19c67 docs(extui): rename box->msg, more->pager, prompt->dialog
Includes breaking changes to the `opts` layout. "box" doesn't really
describe anything other than a floating window so was an unwanted synonym.
2025-06-13 14:28:01 +02:00
90b682891d vim-patch:91af4c4: runtime(doc): improve the wording of 'sts', 'varts' and 'varsts' values (#34480)
closes: vim/vim#17522

https://github.com/vim/vim/commit/91af4c41809c4089d15857c1be13315b1969ea3b

Co-authored-by: Damien Lejay <damien@lejay.be>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-06-13 00:53:48 +00:00
Tiago Inaba 7486c2f6aa feat(lsp): <Plug> mapping for signature help cycling #34039
Replace direct function mappings with `<Plug>` mappings for cycling
through overloaded signatures, providing better customization options
for users. This change keeps the default mapping (`<C-s>`) for cycling
if `<Plug>(nvim.lsp.ctrl-s)` is not mapped.
2025-06-12 10:56:39 -07:00
Riley Bruins f99e3a8a2a feat(lsp): incremental selection via "textDocument/selectionRange" #34011
Select outwards with "an" and inwards with "in" in Visual mode.
Ranges are reset when leaving Visual mode.
2025-06-12 09:25:19 -07:00
zeertzjqandIlya Grigoriev 47df8f5a4b vim-patch:053aee0: runtime(doc): add more pointers to 'completeopt' (#34460)
Before this commit, I had trouble finding information about configuring
the insert mode completion. In particular, it was not clear that the
'wildopt' config that I already had in my vimrc does not apply here.

Also, `insert.txt` barely mentioned 'completeopt' except when
describing popups (I was more interested in bash-like behavior
where the unique prefix of all completions is completed first).

I'm hoping these edits will make the relevant docs easier to find.

closes: vim/vim#17515

https://github.com/vim/vim/commit/053aee01f7374fc8c985300399b1ad3b3626e40f

Co-authored-by: Ilya Grigoriev <ilyagr@users.noreply.github.com>
2025-06-12 07:32:07 +08:00
Gregory Anders de87ceb3be feat(tui): support APC queries in TermResponse (#34426)
Add support for APC sequences to libtermkey and the TermResponse
autocommand event.
2025-06-11 08:26:58 -05:00
zeertzjqandDamien Lejay 79ce71430f vim-patch:bfa1636: runtime(doc): update documentation on tabstop settings (#34433)
Unify the treatment of tabstop, correct errors and deprecate smarttab
usage.

closes: vim/vim#17444

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

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-06-10 23:53:35 +00:00
zeertzjq c2aa5fd915 test: :restart works on Windows 2025-06-10 23:00:38 +08:00
Maria José Solano cb4559bc32 feat(lsp): workspace diagnostic support (#34262)
* refactor(lsp): remove underscore prefix from local variables

* feat(lsp): workspace diagnostic support
2025-06-09 13:02:00 -04:00
Siddhant Agarwal 2f0fbdaa48 feat(vim.fs): root() can specify "equal priority" #34276 2025-06-09 09:31:37 -07:00
Mtende 2d980e37c8 docs(diagnostics): default keymaps #34400 2025-06-09 08:44:01 -07:00
Riley Bruins 8b41df185c fix(treesitter): support multiple @injection.content captures
Before, only the last capture's range would be counted for injection.
Now all captured ranges will be counted in the ranges array. This is
more intuitive, and also provides a nice solution/alternative to the
"scoped injections" issue.
2025-06-08 18:23:22 +02:00
zeertzjqandHirohito Higashi 00bec1fd90 vim-patch:partial:8f7256a (#34368)
vim-patch:partial:8f7256a: runtime(doc): fix some style issues and remove obsolete docs

https://github.com/vim/vim/commit/8f7256a5ee5b827722de4e7524da1c2adb68bbae

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-06-08 09:59:02 +08:00
zeertzjq 52c61d9690 feat: make :restart work for remote UI (#34354) 2025-06-07 22:10:34 +00:00
Justin M. Keyes 96a0e5f265 docs: lua, UI events #34261 2025-06-07 07:49:04 -07:00
Lewis Russell 3b6084ddf4 fix: type fixes
Type fixes caught by emmylua
2025-06-06 15:36:48 +01:00
a5bbdbb5d5 vim-patch:dfed077: runtime(doc): fix small errors from rev 2090405de5bb66facc29c74
- update the netrw window to current version (and trim it slightly to 80
  chars)
- remove a trailing double quote

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

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Antonio Giovanni Colombo <azc100@gmail.com>
2025-06-05 06:32:13 +08:00
zeertzjqandDamien Lejay 038fb30ece vim-patch:d6c9ac9: runtime(doc): clarify the effect of 'smarttab'
closes: vim/vim#17426

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

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-06-05 06:31:09 +08:00
phanium f577bb024e docs: getreg() type #34215
```lua
---@type string
local _a = vim.fn.getreg('a', 1)

---@type string[]
local _b = vim.fn.getreg('a', 1, 1)
```
2025-06-04 09:26:56 -07:00
zeertzjq dd9ac565d8 Merge pull request #34294 from glepnir/vim-9.1.1426
vim-patch:9.1.{1426,1428}: register completion improve
2025-06-04 13:46:19 +08:00
Yochem van Rosmalen 3d1f907912 vim-patch:2090405: runtime(doc): make examples verbatim to prevent conceal/tag parsing (#34299)
closes: vim/vim#17437

https://github.com/vim/vim/commit/2090405de5bb66facc29c745596750bdebbd64c2
2025-06-04 05:55:24 +08:00
Lewis Russell 533cc0ab35 fix(vim.diagnostic): improve typing
Problem:

`vim.diagnostic.set()` doesn't actually accept a list of
`vim.Diagnostic` as internally `vim.diagnostic.set()` normalizes the
diagnostics and this normalization is assumed throughout the module.

Solution:

- Add a new type `vim.Diagnostic.Set` which is the input to `vim.diagnostic.set()`

- `col` is now an optional field and defaults to `0` to be consistent
  with `vim.diagnostic.match()`.

- Change `table.insert(t, x)` to `table[#table + 1] = x` for improved
  type checking.
2025-06-03 20:25:07 +01:00
glepnir eb10852804 vim-patch:9.1.1426: completion: register contents not completed
Problem:  CTRL-X CTRL-R only completes individual words from registers,
          making it difficult to insert complete register content.
Solution: Add consecutive CTRL-X CTRL-R support - first press completes
          words, second press completes full register lines, similar to
          CTRL-X CTRL-L and CTRL-X CTRL-P behavior (glepnir).

closes: vim/vim#17395

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

Co-authored-by: glepnir <glephunter@gmail.com>
2025-06-03 16:25:49 +08:00
zeertzjq 049877d379 fix(tui): make :restart use new size after terminal resize (#34282) 2025-06-03 00:18:04 +00:00
zeertzjqandChristian Brabandt aa4fa24963 vim-patch:bfeefc4: runtime(doc): clarify the effect of exclusive single char selections (#34289)
closes: vim/vim#17410

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

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-06-02 23:54:29 +00:00
zeertzjqandGirish Palya eeff6ca8ff vim-patch:9.1.1409: using f-flag in 'complete' conflicts with Neovim
Problem:  using f-flag in 'complete' conflicts with Neovims filename
          completion (glepnir, after v9.1.1301).
Solution: use upper-case "F" flag for completion functions
          (Girish Palya).

fixes: vim/vim#17347
closes: vim/vim#17378

https://github.com/vim/vim/commit/14f6da5ba8d602263fc7bf6cb899c8520f4c3060

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-03 06:30:47 +08:00
zeertzjqandHirohito Higashi 13aec582b4 vim-patch:fa8b7db: runtime(doc): tweak documentation style in options.txt
closes: vim/vim#17229

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

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-06-03 06:30:47 +08:00
zeertzjqandGirish Palya b6acf6112b vim-patch:9.1.1311: completion: not possible to limit number of matches
Problem:  completion: not possible to limit number of matches
Solution: allow to limit the matches for 'complete' sources by using the
          "{flag}^{limit}" notation (Girish Palya)

This change extends the 'complete'  option to support limiting the
number of matches returned from individual completion sources.

**Rationale:** In large files, certain sources (such as the current
buffer) can generate an overwhelming number of matches, which may cause
more relevant results from other sources (e.g., LSP or tags) to be
pushed out of view. By specifying per-source match limits, the
completion menu remains balanced and diverse, improving visibility and
relevance of suggestions.

A caret (`^`) followed by a number can be appended to a source flag to
specify the maximum number of matches for that source. For example:
```
  :set complete=.^9,w,u,t^5
```
In this configuration:
- The current buffer (`.`) will return up to 9 matches.
- The tag completion (`t`) will return up to 5 matches.
- Other sources (`w`, `u`) are not limited.

This feature is fully backward-compatible and does not affect behavior
when the `^count` suffix is not used.

The caret (`^`) was chosen as the delimiter because it is least likely
to appear in file names.

closes: vim/vim#17087

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

Cherry-pick test_options.vim change from patch 9.1.1325.

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-03 06:30:47 +08:00
7651c43252 vim-patch:9.1.1301: completion: cannot configure completion functions with 'complete'
Problem:  completion: cannot configure completion functions with
          'complete'
Solution: add support for setting completion functions using the f and o
          flag for 'complete' (Girish Palya)

This change adds two new values to the `'complete'` (`'cpt'`) option:
- `f` – invokes the function specified by the `'completefunc'` option
- `f{func}` – invokes a specific function `{func}` (can be a string or `Funcref`)

These new flags extend keyword completion behavior (e.g., via `<C-N>` /
`<C-P>`) by allowing function-based sources to participate in standard keyword
completion.

**Key behaviors:**

- Multiple `f{func}` values can be specified, and all will be called in order.
- Functions should follow the interface defined in `:help complete-functions`.
- When using `f{func}`, escaping is required for spaces (with `\`) and commas
  (with `\\`) in `Funcref` names.
- If a function sets `'refresh'` to `'always'`, it will be re-invoked on every
  change to the input text. Otherwise, Vim will attempt to reuse and filter
  existing matches as the input changes, which matches the default behavior of
  other completion sources.
- Matches are inserted at the keyword boundary for consistency with other completion methods.
- If finding matches is time-consuming, `complete_check()` can be used to
  maintain responsiveness.
- Completion matches are gathered in the sequence defined by the `'cpt'`
  option, preserving source priority.

This feature increases flexibility of standard completion mechanism and may
reduce the need for external completion plugins for many users.

**Examples:**

Complete matches from [LSP](https://github.com/yegappan/lsp) client. Notice the use of `refresh: always` and `function()`.

```vim
set cpt+=ffunction("g:LspCompletor"\\,\ [5]). # maxitems = 5

def! g:LspCompletor(maxitems: number, findstart: number, base: string): any
    if findstart == 1
        return g:LspOmniFunc(findstart, base)
    endif
    return {words: g:LspOmniFunc(findstart, base)->slice(0, maxitems), refresh: 'always'}
enddef
autocmd VimEnter * g:LspOptionsSet({ autoComplete: false, omniComplete: true })
```

Complete matches from `:iabbrev`.

```vim
set cpt+=fAbbrevCompletor

def! g:AbbrevCompletor(findstart: number, base: string): any
    if findstart > 0
        var prefix = getline('.')->strpart(0, col('.') - 1)->matchstr('\S\+$')
        if prefix->empty()
            return -2
        endif
        return col('.') - prefix->len() - 1
    endif
    var lines = execute('ia', 'silent!')
    if lines =~? gettext('No abbreviation found')
        return v:none  # Suppresses warning message
    endif
    var items = []
    for line in lines->split("\n")
        var m = line->matchlist('\v^i\s+\zs(\S+)\s+(.*)$')
        if m->len() > 2 && m[1]->stridx(base) == 0
            items->add({ word: m[1], info: m[2], dup: 1 })
        endif
    endfor
    return items->empty() ? v:none :
        items->sort((v1, v2) => v1.word < v2.word ? -1 : v1.word ==# v2.word ? 0 : 1)
enddef
```

**Auto-completion:**

Vim's standard completion frequently checks for user input while searching for
new matches. It is responsive irrespective of file size. This makes it
well-suited for smooth auto-completion. You can try with above examples:

```vim
set cot=menuone,popup,noselect inf

autocmd TextChangedI * InsComplete()

def InsComplete()
    if getcharstr(1) == '' && getline('.')->strpart(0, col('.') - 1) =~ '\k$'
        SkipTextChangedIEvent()
        feedkeys("\<c-n>", "n")
    endif
enddef

inoremap <silent> <c-e> <c-r>=<SID>SkipTextChangedIEvent()<cr><c-e>

def SkipTextChangedIEvent(): string
    # Suppress next event caused by <c-e> (or <c-n> when no matches found)
    set eventignore+=TextChangedI
    timer_start(1, (_) => {
        set eventignore-=TextChangedI
    })
    return ''
enddef
```

closes: vim/vim#17065

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

Temporarily remove bufname completion with #if 0 to make merging easier.

Co-authored-by: Girish Palya <girishji@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: glepnir <glephunter@gmail.com>
2025-06-03 06:30:46 +08:00
Sathya Pramodh 86835b3db3 feat(editor): ":restart" command #33953
Problem:
Developing/troubleshooting plugins has friction because "restarting"
Nvim requires quitting and manually starting again. #32484

Solution:
- Implement a `:restart` command which emits `restart` UI event.
- Handle the `restart` UI event in the builtin TUI client: stop the
  `nvim --embed` server, start a new one, and attach to it.
2025-06-02 05:54:17 -07:00
Christian ClasonandAliaksei Budavei 236243029d vim-patch:b577ad5: runtime(java): Match annotation- and interface-type names of "java.lang"
Complement the documented support for the recognition of all
public types of the "java.lang" package (":help java.vim").
(The original syntax item generator may have, inadvertently,
contributed via suppressing "NullPointerException"s to not
having annotation and interface types qualify in general.)

Also, re-link usage instructions for the alternative syntax
item generator to a rolling "master"'s version.

closes: vim/vim#17419

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

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-06-02 10:03:12 +02:00
zeertzjqandDamien Lejay 5fd03508aa vim-patch:95ea0b0: runtime(doc): make 'shiftwidth' setting more precise (#34266)
closes: vim/vim#17414

https://github.com/vim/vim/commit/95ea0b0f8de4ab6e13bf090f33b8cbfe5b6e5c9f

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-06-02 08:26:34 +08:00
luukvbaal 981d4ba45e fix(eval): winnr('$') counts non-current hidden/unfocusable windows #34207
Problem:  Non-visible/focusable windows are assigned a window number,
          whereas commands that use this window number skip over them.

Solution: Skip over non-visible/focusable windows when computing
          the window number, unless it is made the current window
          through the API in which case an identifiable window number
          is still useful. This also ensures it matches the window
          number of the window entered by `<winnr>wincmd w` since
          403fcacf.
2025-06-01 15:12:12 -07:00
Justin M. Keyes 80753332d1 docs: news, intro, lsp, api #33687 2025-06-01 14:13:50 -07:00
zeertzjq b95189b7e3 Merge pull request #34244 from brianhuster/vim-6fea0a5
vim-patch: document on how to write lang annotation for codeblock in help file
2025-06-01 23:11:52 +08:00
zeertzjqandAliaksei Budavei 84c7785546 vim-patch:055cca8: runtime(java): Reference a modern syntax item generator for type names (#34256)
And generalise the sourcing of "javaid.vim" for Java
buffers.

Resolves zzzyxwvut/java-vim#10.
closes: vim/vim#17411

https://github.com/vim/vim/commit/055cca88c45099073424b69074678bceadebbe09

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-06-01 21:33:32 +08:00
Maria José Solano f72c13341a feat(lsp)!: pass entire entry to format function (#34166)
* feat(lsp)!: pass entire entry to format function

* refactor(lsp): deprecate `vim.lsp.log.should_log()`
2025-05-31 08:47:32 -07:00
brianhusterandh-east 7082367b3a vim-patch:b9ea0a8: runtime(doc): tweak documentation style in helphelp.txt
closes: vim/vim#16302

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

Co-authored-by: h-east <h.east.727@gmail.com>

I removed some parts that are not applicable to Nvim, like HelpTOC
2025-05-31 20:21:59 +07:00
60b866049c vim-patch:5ddcecf: runtime(help): Add better support for language annotation highlighting
closes: vim/vim#16238

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

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: h_east <h.east.727@gmail.com>
2025-05-31 19:57:53 +07:00
luukvbaal 2763d06100 vim-patch:9.1.1419: It is difficult to ignore all but some events (#34245)
Problem:  It is difficult to ignore all but some events.
Solution: Add support for a "-" prefix syntax in '(win)eventignore' that
          subtracts an event from the ignored set if present
          (Luuk van Baal).

https://github.com/vim/vim/commit/8cc6d8b187d53c70c5fdc8fb83d4d3cef35e6d44
2025-05-31 14:51:29 +02:00
11ae879ebd vim-patch:6fea0a5: runtime(help): Add Vim lang annotation support for codeblocks
closes: vim/vim#16215

https://github.com/vim/vim/commit/6fea0a54804fc36ab7138a66210b0eb380d96198

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-05-31 17:25:27 +07:00
zeertzjqandChristian Brabandt eb6ca14248 vim-patch:77959dc: runtime(doc): CI fails with trailing whitespace error in usr_30.txt
https://github.com/vim/vim/commit/77959dc6449053243504a5465b951c608fae51b0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-31 08:18:28 +08:00