Commit Graph

9828 Commits

Author SHA1 Message Date
zeertzjq
2c6469aca4 vim-patch:9.1.1933: completion: complete_match() is not useful (#36726)
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#16716
fixes: vim/vim#18563
closes: vim/vim#18790

cbcbff8712

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-11-28 10:10:31 +08:00
zeertzjq
0b888ea039 vim-patch:b217ffb: runtime(doc): remove outdated help about 'completeopt' "fuzzy"
closes: vim/vim#18815

b217ffbef2
2025-11-28 07:53:49 +08:00
zeertzjq
812186e2dc vim-patch:9.1.1930: completion: 'completefuzzycollect' is too obscure
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#18498
closes: vim/vim#18788

33fbfe003c

Remove this option completely, as it's introduced in Nvim v0.12 cycle.

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-11-28 07:53:49 +08:00
glepnir
e4ce0c7270 fix(health): git check and autocmd clean #36713
Problem: Incorrect Git check and improper autocmd cleanup

Solution: Add once to the autocmd and fix the Git check condition
2025-11-26 20:12:50 -08:00
zeertzjq
2c97ea3f04 vim-patch:25a736e: runtime(i3config/swayconfig): add all option for i3config only (#36710)
Since i3 version 4.24, popup_during_fullscreen has new
option `all`. So add the `all` option for popup_during_fullscreen to
prevent `all` option highlighted as error.

However, sway won't implement `all` option for popup_during_fullscreen,
so let's remove the extra options from the syntax cluster in swayconfig
syntax script after sourcing the i3config.

Reference:
- https://i3wm.org/docs/userguide.html#_popups_during_fullscreen_mode
- https://github.com/swaywm/sway/issues/8746

closes: vim/vim#18760

25a736e323

Co-authored-by: Robertus Chris <robertusdchris@gmail.com>
2025-11-27 01:46:05 +00:00
zeertzjq
933df98270 vim-patch:712b650: runtime(doc): Fix typo in "Jumping to Changes", usr_08.txt (#36707)
- 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#18810

712b650332

Co-authored-by: Brent Pappas <pappasbrent@gmail.com>
2025-11-27 07:49:44 +08:00
Miika Tuominen
7ebfc50775 fix(lsp): ignore invalid fold ranges (#36708) 2025-11-26 18:47:07 -05:00
glepnir
8a626e5c4a feat(float): 'statusline' in floating windows #36521
Problem:
Can't show 'statusline' in floating windows.

Solution:
Use window-local 'statusline' to control floating window statusline visibility.
2025-11-26 09:10:45 -08:00
glepnir
13ed225054 feat(health): create a bug report #31842
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.
2025-11-25 21:21:32 -08:00
Rob Pilling
612b2e7850 feat(api): nvim_get_commands returns function fields #36415
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.
2025-11-25 21:12:39 -08:00
Maria Solano
7e09fedf43 feat(diagnostic): config.status #36693
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`.
2025-11-25 21:00:00 -08:00
Muhammad Saheed
87bd16e470 fix(man.lua): :Man slow/hangs if MANPAGER is set #36689
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()`
2025-11-25 12:38:32 -08:00
Riley Bruins
4107442103 feat(diagnostic): highlights in diagnostic.status() #36685
Applies the appropriate `DiagnosticSign*` highlight to each group,
resetting the highlights at the end of the expression.
2025-11-25 10:14:46 -08:00
Riley Bruins
8d8f17c924 refactor(defaults): deduplicate selection_range() mappings #36686
We don't need to specify the timeout ms here anymore, because the
implementation was changed to use it by default.
2025-11-25 10:00:28 -08:00
Branden Call
e82aef2e22 feat(lsp): incremental-selection operator-pending mode #36575
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.
2025-11-24 17:10:50 -08:00
Justin M. Keyes
60c35cc4c7 docs: vimdoc parsing errors #36681
Error: .tests/neovim/runtime/doc/dev_test.txt
    (MISSING "`" [420, 79] - [420, 79])
    Error: .tests/neovim/runtime/doc/news.txt
    (MISSING "`" [137, 80] - [137, 80])
    Error: .tests/neovim/runtime/doc/nvim.txt
    (MISSING "<" [106, 0] - [106, 0])
    Error: .tests/neovim/runtime/doc/vimfn.txt
    (MISSING "}" [2610, 26] - [2610, 26])
2025-11-24 15:10:05 -08:00
zeertzjq
dbd7f45873 vim-patch:2190036: runtime(doc): Add environment variable expansion note to options (#36675)
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#18791

2190036c8c

Co-authored-by: Alex Plate <AlexPl292@gmail.com>
2025-11-24 10:29:39 +08:00
zeertzjq
71ce3030eb vim-patch:898ac80: runtime(new-tutor): update vim-02-beginner following 48940d9 (#36674)
closes: vim/vim#18793

898ac80be6
2025-11-24 09:33:28 +08:00
Justin M. Keyes
3fc72f4ef1 docs: misc
Close #36441
Close #36631
Close #36656

Co-authored-by: Maria José Solano <majosolano99@gmail.com>
Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: "Mike J. McGuirk" <mike.j.mcguirk@gmail.com>
2025-11-23 20:03:13 -05:00
Tomas Slusny
a88c7962a8 fix(difftool): handle "no differences found" #36671
Add an early exit in diff_dirs to notify the user and return when no
differences are detected between directories.
This prevents Vim:E42: No Errors exception message

See https://github.com/neovim/neovim/pull/35448#issuecomment-3568271456
2025-11-23 13:01:57 -08:00
Justin M. Keyes
bf820b1b94 docs: misc, build, lsp 2025-11-22 19:32:45 -05:00
Justin M. Keyes
6c20531e48 docs: deprecate BUNDLED_CMAKE_FLAG
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.
2025-11-22 14:33:13 -05:00
zeertzjq
1c12073db6 vim-patch:8da8862: runtime(vim): Update base syntax, match full :history command (#36655)
closes: vim/vim#18784

8da886269a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-11-21 23:13:10 +00:00
zeertzjq
2185e4f4b7 vim-patch:ea86e53: runtime(vim): Update base syntax, match :debug and :break* commands
Match full :debug, :breakadd, :breakdel and :breaklist commands.

closes: vim/vim#18748

ea86e53c2b

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-11-21 08:56:51 +08:00
zeertzjq
5f93d27fba vim-patch:74b4f92: runtime(compiler): set errorformat where missing
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#18754

74b4f9242e

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-11-21 08:56:51 +08:00
zeertzjq
091b0859ad vim-patch:d128850: runtime(php): Update indent script to 1.76 (from 1.75)
fixes: vim/vim#18739 (editor hang on mixed syntax style)
closes: vim/vim#18758

d1288503aa

Co-authored-by: John Wellesz <john.wellesz@gmail.com>
2025-11-21 08:56:51 +08:00
zeertzjq
cafd5cfca7 vim-patch:ddb88ab: runtime(haskell): allow spaces in backticked operators in syntax script
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#18776

ddb88ab796

Co-authored-by: Mirek Kratochvil <exa.exa@gmail.com>
2025-11-21 08:56:51 +08:00
zeertzjq
2fa8825bef vim-patch:7fe4b8c: runtime(c): Update signal constants in syntax script
closes: vim/vim#18763

7fe4b8c1bd

Co-authored-by: Harry <166658338+harrystevens4@users.noreply.github.com>
2025-11-21 08:56:49 +08:00
zeertzjq
4dc337cda8 vim-patch:9.1.1924: 'commentstring' requires +folding feature (#36645)
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#18731

a08030c9f7

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-11-21 08:24:20 +08:00
Yochem van Rosmalen
e49a592595 fix(help): retry once if async parsing fails #36592
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.
2025-11-20 15:29:55 -08:00
Oleh Volynets
ea70d2ad85 fix(ui2): unset Search highlighting (#36633)
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.
2025-11-20 17:19:31 +00:00
Michele Sorcinelli
69b286c3bf fix(vim.net): filetype detection, mark unmodified #36297
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.
2025-11-19 22:04:59 -08:00
altermo
caa9419355 refactor!: optwin.lua #36505
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-11-19 20:43:15 -08:00
zeertzjq
a04c73cc17 fix(input): discard following keys when discarding <Cmd>/K_LUA (#36498)
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.
2025-11-20 12:33:02 +08:00
luukvbaal
ba6fc90b6f fix(ui2): hide search highlights in msg window #36626
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.
2025-11-19 17:02:32 -08:00
Justin M. Keyes
7c2d4df2d3 revert: "fix(tutor): remove hyperlinks, simplify non-interactive examples" #36622
This reverts commit 5e039c8e97.
2025-11-19 13:47:48 -08:00
przepompownia
3eefe37871 docs(dev_tools): fix how to properly run not yet installed build
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
2025-11-19 13:07:32 +00:00
Jeff Martin
ff792f8e69 fix(lsp): enable insertReplaceSupport for use in adjust_start_col #36569
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.
2025-11-18 23:03:40 -08:00
glepnir
b65aadc03e docs(diagnostic): diagnostic.Opts.Float extend open_floating_preview.Opts #30058
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
2025-11-18 21:52:30 -08:00
glepnir
c22b03c771 feat(lsp): user-specified sorting of lsp.completion multi-server results #36401
Problem: No way to customize completion order across multiple servers.

Solution: Add `cmp` function to `vim.lsp.completion.enable()` options
for custom sorting logic.
2025-11-18 21:38:53 -08:00
glepnir
4998b8d7b5 feat(api): nvim_win_set_config accepts unchanged "noautocmd" #36463
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.
2025-11-18 20:23:50 -08:00
zeertzjq
f2619160ae vim-patch:c2cc63e: runtime(compiler): expand errorformats in maven compiler (#36605)
matches malformed POM error messages and tries to catch other tools
as well.

closes: vim/vim#18768

c2cc63ec7d

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-11-19 09:14:49 +08:00
zeertzjq
ec70a248b8 vim-patch:040a47a: runtime(netrw): Use proper UNC notation for temp files (#36606)
closes: vim/vim#18764

040a47a470

Co-authored-by: Miguel Barro <miguel.barro@live.com>
2025-11-19 09:14:36 +08:00
Daniel Danner
d00f680c0d fix(clipboard): use tmux only in a tmux session #36407
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.
2025-11-18 12:38:30 -08:00
Riley Bruins
098da1fc2c perf(treesitter): parse multiple ranges in languagetree, eliminate flickering #36503
**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>
2025-11-18 10:09:49 -08:00
skewb1k
4b8980949c fix(lsp): set concealcursor='' in LSP floating windows #36596
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
2025-11-17 17:49:14 -08:00
luukvbaal
c4ac36bfd9 fix(ui2): only redraw when necessary #36457
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.
2025-11-17 10:34:02 -08:00
Justin M. Keyes
5df1112e5f Merge #36338 vim.pack: lockfile synchronization 2025-11-17 09:55:11 -08:00
Grzegorz Rozdzialik
2767eac320 feat(diagnostics): stack DiagnosticUnnecessary,DiagnosticDeprecated highlights #36590
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.
2025-11-17 09:37:59 -08:00
Evgeni Chasnovski
f492f62c3d fix(pack): rename confirmation buffer to again use nvim-pack:// scheme
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>`.
2025-11-17 12:47:29 +02:00