Problem: completion: complete_match() Vim script function and
'isexpand' option are not that useful and confusing
(after v9.1.1341)
Solution: Remove function and option and clean up code and documentation
(Girish Palya).
complete_match() and 'isexpand' add no real functionality to Vim. They
duplicate what `strridx()` already does, yet pretend to be part of the
completion system. They have nothing to do with the completion mechanism.
* `f_complete_match()` in `insexpand.c` does not call any completion code.
It’s just a `STRNCMP()` wrapper with fluff logic.
* `'isexpand'` exists only as a proxy argument to that function.
It does nothing on its own and amounts to misuse of a new option.
The following Vim script function can be used to implement the same
functionality:
```vim
func CompleteMatch(triggers, sep=',')
let line = getline('.')->strpart(0, col('.') - 1)
let result = []
for trig in split(a:triggers, a:sep)
let idx = strridx(line, trig)
if l:idx >= 0
call add(result, [idx + 1, trig])
endif
endfor
return result
endfunc
```
related: vim/vim#16716fixes: vim/vim#18563closes: vim/vim#18790cbcbff8712
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: completion: 'completefuzzycollect' option is too obscure
Solution: Deprecate the option, but don't error out for existing scripts,
behave like 'completefuzzycollect' is set when fuzzy
completion is enabled (Girish Palya).
fixes: vim/vim#18498closes: vim/vim#1878833fbfe003c
Remove this option completely, as it's introduced in Nvim v0.12 cycle.
Co-authored-by: Girish Palya <girishji@gmail.com>
- Change "Prepended" (past tense) to "Prepend" (present tense,
imperative).
- Add short examples clarifying the behavior of prepending a count to
commands that jump to changes in diff mode.
closes: vim/vim#18810712b650332
Co-authored-by: Brent Pappas <pappasbrent@gmail.com>
Problem:
Creating a bug report is somewhat tedious for users.
Bug reports sometimes are missing useful info.
Solution:
Add a feature to :checkhealth which automatically gets
system info and includes it in a new bug report.
Problem:
nvim_get_commands does not return callbacks defined for
"preview", "complete", or the command itself.
Solution:
- Return Lua function as "callback" field in a Lua context.
- Return "preview" function in a Lua context.
- BREAKING: Return "complete" as a function instead of a boolean.
Problem:
`diagnostic.status()` is configured via `config.signs`, but users may
want diagnostics only in statusline, not in the gutter (signs).
Solution:
Add `config.status`.
Problem:
When `MANPAGER` is set to something like 'nvim +Man!',
`vim.system({ 'nvim' })` call waits forever for input and times out
after 10 seconds in `system()` and the assert on `stdout` being not
`nil` fails.
Solution:
Set `MANPAGER=cat` when calling `system()`
Problem:
LSP incremental selection provides default visual-mode keymaps for `an`
and `in`. Operator-pending mode is not supported, so `dan` and `can` do
not apply the operation.
Solution:
Modify selection_range() to be synchronous.
Add operator-pending mappings.
Add "Environment variables are expanded |:set_env|" documentation to
options that have the P_EXPAND flag but were missing this note.
Updated options:
- 'cdpath'
- 'dictionary'
- 'mkspellmem'
- 'packpath'
- 'runtimepath'
- 'spellfile'
- 'spellsuggest'
- 'thesaurus'
- 'ttytype'
- 'undodir'
- 'verbosefile'
- 'viewdir'
- 'viminfofile'
These options support environment variable expansion in their values
(e.g., $HOME, $USER) but the documentation didn't explicitly mention
this capability. This brings their documentation in line with other
options like backupdir, directory, and makeprg that already include
this note.
closes: vim/vim#187912190036c8c
Co-authored-by: Alex Plate <AlexPl292@gmail.com>
Problem:
We have too many build flags.
BUNDLED_CMAKE_FLAG is redundant with DEPS_CMAKE_FLAGS.
Solution:
In documentation, refer to DEPS_CMAKE_FLAGS instead of BUNDLED_CMAKE_FLAG.
As a matter of caution it sets it to the default gcc errorformat:
```
errorformat=%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-Gg%\?make[%*\d]: *** [%f:%l:%m,%-Gg%\?make: *** [%f:%l:%m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c:,%-GIn file included from %f:%l:%c\,,%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-G%*[ ]from %f:%l:%c,%-G%*[ ]from %f:%l:,%-G%*[ ]from %f:%l\,,%-G%*[ ]from %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory %*[`']%f',%X%*\a[%*\d]: Leaving directory %*[`']%f',%D%*\a: Entering directory %*[`']%f',%X%*\a: Leaving directory %*[`']%f',%DMaking %*\a in %f,%f|%l| %m
```
so that the compiler keeps working after switching to others.
While likely only a subset is needed; such a subset has been proposed in
a commented errorformat;
checked to work for yamllint but ran out of steam for other compilers;
closes: vim/vim#1875474b4f9242e
Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
This formatting (although rare) is actually accepted by GHC, but vim
does not highlight it. This patch adds the simplest possible regex to
support the behavior.
Inconveniently, this might trigger weird formatting on lines that
contain errors, e.g. if the first backtick is removed from:
a `b` c `d` e
then `c` is going to be marked as an operator, which seems weird but is
valid.
closes: vim/vim#18776ddb88ab796
Co-authored-by: Mirek Kratochvil <exa.exa@gmail.com>
Problem: 'commentstring' requires the +folding feature but is used in
contexts other than folding.
Solution: Remove the +folding feature guards from 'commentstring' and
make it available in all builds (Doug Kearns).
closes: vim/vim#18731a08030c9f7
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem:
If the buffer changes during iteration of the query matches,
`get_node_text()` may fail, showing an error to the user.
Solution:
Use `pcall` to not propogate the error to the user. Retry once if an
error occurred.
Problem:
Trying to match the search highlight groups to the Normal highlight for
the window can fail when the message highlighting contains a fg/bg that
the Normal highlight doesn't (like an error message in cmd will have
ErrorMsg highlight instead of MsgArea - which is Normal in cmd.)
Solution:
Link the search highlight groups to an empty group in 'winhighlight'
thus disabling them instead of overriding them with Normal/MsgArea/etc.
Problem:
When running ":edit <url>", filetype detection is not triggered.
Solution:
Run the autocmds in the filetypedetect group after loading the content.
Problem:
After fetching remote content from a URL and adding it to the buffer,
the buffer is marked as modified. This is inconsistent with the original
netrw behavior, and it causes problems with `:e` to refresh or `:q` as
it prompts for saving the file even if the user hasn't touched the
content at all.
Solution:
Mark the buffer as unmodified right after adding the remote content to
the buffer.
Technically the current behavior does match documentation. However, the
keys following <Cmd>/K_LUA aren't normally received by vim.on_key()
callbacks either, so it does makes sense to discard them along with the
preceding key.
One may also argue that vim.on_key() callbacks should instead receive
the following keys together with the <Cmd>/K_LUA, but doing that may
cause some performance problems, and even in that case the keys should
still be discarded together.
fix(ui2): hide search highlights in msg window.
Problem: Search highlighting is shown in the msg (and dialog) window.
Solution: Hide search highlighting in all but the pager window.
Problem: running ./build/bin/nvim without make install
- doesn't respect local changes in ./runtime,
- includes the path where Nvim would be installed,
- ignores changes in precompiled Lua modules (like .../vim/_editor.lua)
Solution:
- use VIMRUNTIME=./runtime,
- use --luamod-dev
Problem:
With the typescript LSes typescript-language-server and vtsls,
omnicompletion on partial tokens for certain types, such as array
methods, and functions that are attached as attributes to other
functions, either results in no entries populated in the completion menu
(typescript-language-server), or an unfiltered completion menu with all
array methods included, even if they don't share the same prefix as the
partial token being completed (vtsls).
Solution:
Enable insertReplaceSupport and uses the insert portion of the lsp
completion response in adjust_start_col if it's included in the
response.
Completion results are still filtered client side.
Problem: the opts table also is param of util.open_floating_preview,
vim.diagnostic.Opts.Float missing some fields of open_floating_preview.
Solution: diagnostic.Opts.Float extend util.open_floating_preview.Opts
Fix#29267
Problem: No way to customize completion order across multiple servers.
Solution: Add `cmp` function to `vim.lsp.completion.enable()` options
for custom sorting logic.
Problem: Cannot reuse same config with noautocmd for both window
creation and updates, even when value is unchanged.
Solution: Only reject noautocmd changes for existing windows.
This reverts 2495e7e. That past change meant that we would modify the
buffer contents of a tmux session if it exists, even if the current Nvim
process wasn't running inside of it. Depending on the tmux
configuration, this could even affect the clipboard of an actually
attached tmux client, since tmux itself uses OSC 52 to forward buffer
writes to attached clients.
While autodetection is usually a trade-off and can rarely make everybody
happy, this behavior goes counter the principle of least surprise. If
really desired, it can be brought back by explicit configuration.
**Problem:** Whenever `LanguageTree:parse()` is called, injection trees
from previously parsed ranges are dropped.
**Solution:** Allow the function to accept a list of ranges, so it can
return injection trees for all the given ranges.
Co-authored-by: Jaehwang Jung <tomtomjhj@gmail.com>
Problem:
Users often jump and navigate through LSP windows to yank text.
Concealed markdown can make navigation through hyperlinks and code
blocks more difficult.
Solution:
Change 'concealcursor' from 'n' to '' to preserve clean display
while improving navigation and selection of the LSP response.
Closes#36537
Problem: Until now the UI callback called nvim__redraw() liberally.
It should only be needed when Nvim does not update the screen
in its own event loop.
Solution: Identify which UI events require immediate redrawing.
Problem: unnecessary and deprecated diagnostics use their own highlight
groups (`DiagnosticUnnecessary` and `DiagnosticDeprecated`) which
override the typical severity-based highlight groups (like
`DiagnosticUnderlineWarn`).
This can be misleading, since diagnostics about unused variables which
are warnings or errors, are shown like comments, since then only the
`DiagnosticUnnecessary` highlight group is used. Users do not see the
more eye-catching red/yellow highlight.
Solution: Instead of overriding the highlight group to
`DiagnosticUnnecessary` or `DiagnosticDeprecated`, set them in addition
to the normal severity-based highlights.
Problem: `nvim://` scheme feels more like a generalized interface that
may be requested externally, and it acts like CLI args (roughly).
This is how `vscode://` works.
Anything that behaves like an "app" or a "protocol" deserves its own
scheme. For such Nvim-owned things they will be called `nvim-xx://`.
Solution: Use `nvim-pack://confirm#<bufnr>` template for confirmation
buffer name instead of `nvim://pack-confirm#<bufnr>`.