| Commit message (Collapse) | Author | Age |
| ... | |
| |
|
|
|
|
|
|
| |
closes: vim/vim#17229
https://github.com/vim/vim/commit/fa8b7db99afad9074e4e1f89b49046836ac61d5b
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'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>
|
| |
|
|
|
|
| |
Problem: Buffer setup after moving the message buffer to the "more"
window after ff95d7ff is incomplete.
Solution: Adjust and invoke tab_check_wins() to do the setup instead.
|
| |
|
|
|
|
|
| |
Problem: Closing the "more" window for an entered cmdwin in ff95d7ff9
still requires special casing to properly handle "more" visibility.
Solution: Reposition the "more" window instead; anchoring it to the
cmdwin.
|
| |
|
|
|
|
|
| |
closes: vim/vim#17414
https://github.com/vim/vim/commit/95ea0b0f8de4ab6e13bf090f33b8cbfe5b6e5c9f
Co-authored-by: Damien Lejay <damien@lejay.be>
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Message lines from multiple message events that end up
spilling 'cmdheight' end up spread out over the cmdline
and "more" window.
Messages emitted as feedback to a typed :command (rather than
its sole purpose like :echo/:=) are routed to the more window.
The more window isn't closed when entering the cmdwin, and
doesn't allow `vim.hl.on_yank()`.
Solution: When first opening the "more" window for spilled messages,
move the message buffer to the more window.
Restrict routing of typed commands to echo kinds.
Ignore all events but WinLeave and TextYankPost.
|
| |\
| |
| | |
vim-patch:9.1.{1342,1420}
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Shebang filetype detection can be improved
Solution: Improve detection logic (Eisuke Kawashima)
Vim does not correctly detect filetype from
- `#!/usr/bin/env --split-string=awk -f`
- `#!/usr/bin/env -S -i awk -f`
- `#!/usr/bin/env -S VAR= awk -f`
So update the current detection logic to detect those cases.
closes: vim/vim#17199
https://github.com/vim/vim/commit/f102f4c2e80f5493a02a7b1130f11615d60b6295
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
|
| |/
|
|
|
| |
* feat(lsp)!: pass entire entry to format function
* refactor(lsp): deprecate `vim.lsp.log.should_log()`
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
closes: vim/vim#17381
https://github.com/vim/vim/commit/a4a3f712e250299bb788a1de9c7557ba0de92f06
Co-authored-by: Damien Lejay <damien@lejay.be>
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
| |
|
|
|
|
|
|
| |
Problem: `TSLangInfo` annotation does not reflect the structure returned
by `vim.treesitter.language.inspect()`.
Solution: Move version information under new (optional since ABI 15 only)
`TSLangMetadata` field.
|
| |
|
|
|
|
|
|
|
|
| |
Problem:
vim.uv.spawn will emit ENOENT for either when the cmd or cwd do not
exist and does not tell you which.
Solution:
If an error occurs, check if cwd was supplied and included in the error
message if it does not exist.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
complete_info() (#34219)
Problem: missing info about register completion in complete_info()
(after v9.1.1408)
Solution: update documentation and mention that register is used as
source, add a test (glepnir)
closes: vim/vim#17389
https://github.com/vim/vim/commit/49864aecd0d23676e202b30bc8705c78ae52d680
Co-authored-by: glepnir <glephunter@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
(#34198)
Problem: not easily possible to complete from register content
Solution: add register-completion submode using i_CTRL-X_CTRL-R
(glepnir)
closes: vim/vim#17354
https://github.com/vim/vim/commit/0546068aaef2b1a40faa2945ef7eba249739f219
|
| |
|
|
|
| |
Problem: Error when `vim.filetype.match` a buffer with suffix `sh`.
Solution: fallback to an empty string as buffer content.
|
| | |
|
| |
|
|
|
| |
Problem: Unable to emit a message with arbitrary kind.
Solution: Add a "kind" opts field to nvim_echo().
Use it to set the "list_cmd" kind for vim.show_pos().
|
| |
|
|
|
|
|
| |
Problem: Calculated cmdline cursor position can be smaller than 0.
Prompt part of the cmdline is translated, while it should
support "\t" characters.
Solution: Remove prompt part from the stored "cmdbuff" and get rid of
dubious +/-1 from cmdline cursor calculation.
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem: An already open "more" window is the most convenient place
to route messages to with `cfg.msg.pos == 'cmd'`. Instead we
route to the cmdline (unless that message also exceeds
'cmdheight').
Solution: Route to "more" window while it is open and scroll to bottom
to show the newest message. This is more convenient and more
efficient due to not writing to the target buffer first (which
is done to calculate the height of the message).
(Ensure message highlights are deleted when text is replaced.)
|
| |
|
|
|
|
|
|
| |
closes: vim/vim#17366
https://github.com/vim/vim/commit/a6172f8c5ce136d877965bf49881fc6e71ea4edf
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Problem: Bulking message lines to write in a single API call is
complicated and still not correct w.r.t. overwriting
highlights.
Solution: Write each chunk pattern separately with it's highlight
such that it will be spliced correctly for message chunks
that contain a carriage return. Go with correctness over
performance until this proves to be too inefficient.
Also add an identifying name to the various extui buffers.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Problem: Using tracked message column as column in cleared buffer.
Solution: Ensure column does not exceed current line length.
Further work to ensure carriage return and cmdline block mode
work properly.
|
| | |
|
| |
|
|
| |
Problem: "q" cannot close window when `<c-w>` is mapped.
Solution: Map q to `<Cmd>wincmd c<CR>`.
|
| |
|
|
|
|
|
|
|
| |
Problem: "99 searchcount ought to be enough for anyone."
Solution: Increase `SEARCH_STAT_DEF_MAX_COUNT` to 999, which I'm sure
will suffice for the next twenty years.
Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
|
| |
|
|
|
| |
Problem: Consecutive `:echon` messages are printed on separate lines.
Solution: Implement the new msg_show->append parameter.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Some LSPs cause the following completion error (reformatted slightly):
Error executing vim.schedule lua callback:
.../runtime/lua/vim/lsp/completion.lua:373
attempt to index field 'range' (a nil value)
This is because an internal function assumes edits are either missing
or of type `TextEdit`, but there's a third [possibility][0] that's not
handled: the `InsertReplaceEdit`.
This was previously reported in at least two issues:
- https://github.com/neovim/neovim/issues/33142
- https://github.com/neovim/neovim/issues/33224
Solution:
Don't assume the edit is a `TextEdit`. This implicitly handles
`InsertReplaceEdit`s.
Also, add a test case for this, which previously caused an error.
[0]: https://github.com/neovim/neovim/blob/2c07428966a74c76003e00e2a37bf98eb8802c93/runtime/lua/vim/lsp/_meta/protocol.lua#L1099
|
| | |
|
| |
|
|
|
|
|
| |
Problem:
Because the buffer in the window may change before the request is completed, foldclose() might be executed on the wrong buffer.
Solution:
Avoid that.
|
| | |
|
| |
|
|
|
|
|
| |
|vim.glob.to_lpeg()| uses a new LPeg-based implementation (Peglob) that
provides ~50% speedup for complex patterns. The implementation restores
support for nested braces and follows LSP 3.17 specification with
additional constraints for improved correctness and resistance to
backtracking edge cases.
|
| |
|
|
|
|
| |
Problem: A "search_cmd" message alters the message state (since 8e8f4523),
unnecessarily affecting logic for messages that follow.
Solution: Reset the appropriate variables after a "search_cmd" message.
Don't show "search_cmd" message with zero 'cmdheight'.
|
| | |
|
| | |
|
| |\
| |
| | |
feat(exrc): unset 'exrc' to stop searching parent directories
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem:
No way for a user to limit 'exrc' search in parent directories (compare
editorconfig.root).
Solution:
A configuration file can unset 'exrc', disabling the search for its
parent directories.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem:
The exrc file in the current directory is executed twice, here and in
`do_exrc_initalization()`.
Solution:
Start search from parent directory. Let core handle exrc in current
directory.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
The root_markers field can now contain a table of tables (as of
https://github.com/neovim/neovim/pull/33485) and :checkhealth will show
an error in that case since Lua cannot concatenate a table of tables.
Ensure that tables contain strings before concatenating and if not, fall
back to using vim.inspect().
|
| |/ |
|
| |
|
|
|
|
|
|
|
|
| |
feat(logs): show full path of short_src in lsp logs
Problem:
- Cannot gf to info.short_src printed in the logs since only the last 16
characters are printed
Solution:
- Print full info.short_src and remove ...
|
| |
|
|
|
|
|
| |
Problem: <Tab> is not translated on the cmdline, and exposes a wrong
assumption in search messages that may contain multiple chunks.
Solution: Translate unprintable characters in the cmdline content.
Extract the 'search_count' from the last chunk and route
'search_cmd' to cmdline to handle multiple chunks.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: The 'grepformat' option is global option, but it would be
useful to have it buffer-local, similar to 'errorformat' and
other quickfix related options (Dani Dickstein)
Solution: Add the necessary code to support global-local 'grepformat',
allowing different buffers to parse different grep output
formats (glepnir)
fixes: vim/vim#17316
closes: vim/vim#17315
https://github.com/vim/vim/commit/7b9eb6389d693dafcd502cda2ffc62564a2dbba9
Co-authored-by: glepnir <glephunter@gmail.com>
|
| |
|
|
|
|
| |
Problem: Incorrect message highlighting for highlighted message
chunks containing carriage returns.
Solution: Add a highlight for each substring ending in a newline or
carriage return separately.
|