Commit Graph

34592 Commits

Author SHA1 Message Date
Justin M. Keyes
bf820b1b94 docs: misc, build, lsp 2025-11-22 19:32:45 -05:00
Justin M. Keyes
83d22e0979 refactor: deduplicate test 2025-11-22 17:04:32 -05:00
Justin M. Keyes
4bbdffe829 Merge #36663 from justinmk/offlinebuild
build: drop BUNDLED_CMAKE_FLAG, BUNDLED_LUA_CMAKE_FLAG
2025-11-22 13:26:04 -08:00
Justin M. Keyes
9044d64af9 feat: has('terminfo')
Problem:
No way to detect at runtime if the build includes unibilium (or whatever
terminfo layer we swap it with later).

Solution:
Support `has('terminfo')`.
2025-11-22 15:59:07 -05:00
Justin M. Keyes
d589ce28b0 build: drop BUNDLED_CMAKE_FLAG, BUNDLED_LUA_CMAKE_FLAG
Problem:
We have too many build flags.

Solution:
Prepend to DEPS_CMAKE_FLAGS instead of defining a bunch of extra flags.
2025-11-22 15:26:03 -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
dependabot[bot]
c488639757 ci: bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-21 13:34:28 +01:00
Riccardo Mazzarini
7da4d6abe2 fix(api): on_bytes gets stale data on :substitute #36487
Problem: `extmark_splice()` was being called before `ml_replace()`,
which caused the on_bytes callback to be invoked with the old buffer
text instead of the new text.

Solution: store metadata for each match in a growing array, call
`ml_replace()` once to update the buffer, then call `extmark_splice()`
once per match.

Closes https://github.com/neovim/neovim/issues/36370.
2025-11-20 21:40:08 -08:00
zeertzjq
7be031f397 Merge pull request #36647 from zeertzjq/vim-7fe4b8c
vim-patch: runtime file updates
2025-11-21 09:22:30 +08: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
zeertzjq
30a09bdd7e vim-patch:9.1.1923: wrong error when assigning to read-only register (#36644)
Problem:  When assigning to @. in a :let command an incorrect "E15"
          error is emitted.
Solution: Emit the correct "E354" error. (Doug Kearns).

An incorrect "E488" error was also emitted in Vim9 script assignments.

It appears that the code deleted in this commit was added to work around
a limitation in the returned value from find_name_end() that no longer
exists.

See commit 76b92b2830841fd4e05006cc3cad1d8f0bc8101b (tag: v7.0b).

closes: vim/vim#18757

2447131e00

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-11-21 08:24:00 +08:00
zeertzjq
1eec08d1a2 vim-patch:9.1.1922: Wrong virtcol('$') with virtual text at EOL (#36643)
Problem:  Wrong virtcol('$') with virtual text at EOL (rickhowe).
Solution: Also add 1 to end virtcol when there is virtual text.
          (zeertzjq)

fixes: vim/vim#18761
closes: vim/vim#18762

d434f6c2a5
2025-11-21 08:02:20 +08:00
zeertzjq
a8b9660ca3 vim-patch:9.1.1920: tests: not enough testing for wildtrigger() pum redrawing (#36642)
Problem:  tests: not enough testing for wildtrigger() pum redrawing.
Solution: Also test redrawing when leaving cmdline mode (zeertzjq).

closes: vim/vim#18773

eb33c2eb28
2025-11-20 23:49:55 +00: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
Lewis Russell
e9b6474ae7 fix(statusline): scope truncation bookkeeping
Limit the default truncation item to the current recursion range so
nested `nvim_eval_statusline()` calls don't reuse stale `stl_items`
pointers. Add a functional regression that evaluates a Lua statusline
helper which forces truncation to ensure the nested scenario stays
stable.

AI-Assist: OpenAI ChatGPT

Fixes #36616
2025-11-20 09:53:11 +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
Justin M. Keyes
e0308dc147 fix(install): only install "tee" on Windows #36629
Problem:
AUR does not want a web-scale implementation of "tee".

Solution:
- Only install "tee" on Windows.
- The build will still produce `./build/bin/tee` on all platforms, to
  have more coverage and avoid special-cases in tests.
2025-11-19 21:00:56 -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
zeertzjq
3b6df3ae55 refactor: avoid unnecessary redraw for non-curwin cursor line (#36607) 2025-11-20 10:45:08 +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
AaronSteen
ceb7eb5230 build(windows): restore tee.exe on Windows #36363
Problem:
Neovim no longer ships with a tee binary on Windows, which breaks
functionality for the :grep and :make commands.

    nvim --clean
    :grep foo or :make
    "tee is not recognized as an internal or external command"

Solution:
Include a simple, no-dependency tee.c source file in the src/ directory.
Update CMakeLists.txt to build a tee executable alongside neovim during
the build process, and ensure the tee.exe program appears alongside the
neovim executable in the bin/ directory so that it is accessible for
:grep and :make.

tee.c was obtained from the vim codebase:
https://github.com/vim/vim/blob/master/src/tee/tee.c

And we modified it to fix performance issues.

Testing:

    nvim --clean
    :grep foo or :make, after setting a file to the makeprg option.
    Verify that :grep results and error output from a compiler appear in the message pane.

ref https://github.com/neovim/neovim/issues/32431
fix https://github.com/neovim/neovim/issues/32504

Other tee options:
- [tee-win32](https://github.com/dEajL3kA/tee-win32): MIT. However,
  I couldn't get it to build on my machine even after updating its
  makefile to call my install of MSVC. It's also super optimized and
  uses some processor intrinsics for multithreading.
- [gnu coreutils tee](https://gnuwin32.sourceforge.net/packages/coreutils.htm):
  (Windows coreutils contains a tee.c. Last updated 2005. Did not build
  immediately on my machine; we'd have to determine which definitions
  from elsewhere in coreutils tee.c needs and incorporate them somehow.
- [WinTee](https://github.com/mpderbec/WinTee): Has no license. Last
  updated 11 years ago. Relies on Visual Studio to build.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-11-19 16:48:14 -08:00
Justin M. Keyes
4f97239661 build: USE_BUNDLED_UNIBILIUM=0 fails #36623
build: guard unibilium.h with HAVE_UNIBILIUM

Problem:

    make distclean
    make CMAKE_BUILD_TYPE=Release CMAKE_EXTRA_FLAGS="-DENABLE_UNIBILIUM=0" BUNDLED_CMAKE_FLAG="-DUSE_BUNDLED_UNIBILIUM=0"
    sudo make install

    In file included from …/nvim/tui/input.h:10:
    …/nvim/tui/termkey/termkey_defs.h:5:10: fatal error: 'unibilium.h' file not found
        5 | #include <unibilium.h>
          |          ^~~~~~~~~~~~~
    1 error generated.
    make[3]: *** [src/nvim/CMakeFiles/nvim_bin.dir/tui/input.c.o] Error 1
    make[2]: *** [src/nvim/CMakeFiles/nvim_bin.dir/all] Error 2
    make[1]: *** [all] Error 2
    make: *** [nvim] Error 2

Solution:
Check HAVE_UNIBILIUM.
2025-11-19 22:35:32 +00: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
SquallATF
2c04ae9fcc fix(windows): wrong RT_MANIFEST ID in nvim.rc #36406
Problem:
Starting Nvim on MinGW fails:
https://github.com/msys2/MINGW-packages/issues/25140

    Unknown system error -1:"C:\msys64\ucrt64\bin\nvim.exe"Failed to start Nvim server!

Solution:
On Windows, the main application manifest should use resource ID 1 (RT_MANIFEST).
Update `nvim.rc` to use `1 RT_MANIFEST nvim.manifest` instead of `2`,
ensuring the manifest is correctly embedded and recognized by the system.

ID = 1 is for executable files (.exe)
ID = 2 is for DLLs (/DLL)
From MSVC docs: "Use a value of 2 for a DLL to enable it to specify private dependencies."
https://learn.microsoft.com/en-us/cpp/build/reference/manifest-create-side-by-side-assembly-manifest
2025-11-18 21:19:06 -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
Paweł Tomulik
c567340171 build: support Cygwin + bundled luajit #36417
Fixes compilation/link/installation on Cygwin with bundled dependencies
(cmake.deps). Only builds with LuaJIT are fixed. Linking against PUC LUA still
does not work.

Note: Luajit technically does not support Cygwin:
55a42da36e
2025-11-18 19:25:23 -08:00
Justin M. Keyes
4244a96774 test: fix failing lsp/utils_spec #36609
Problem:
098da1fc2c was merged without rebasing on 4b8980949c, which
changed how this test behaves.

Solution:
Update the test.
2025-11-18 19:06:44 -08:00
zeertzjq
677446c70f fix(cmdline): make sure pum is removed on leave (#36608) 2025-11-19 09:40:20 +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
Koichi Shiraishi
93526754a9 build(test): unknown 'ipc_info_object_type_t' type on macOS #36523
Problem:
On macOS Tahoe, `make unittest` started failing with the following error.

````
test/unit/testutil.lua:784: test/unit/testutil.lua:768: (string) '
test/unit/testutil.lua:295: declaration specifier expected near 'ipc_info_object_type_t' at line 2297'
exit code: 256

stack traceback: 
test/unit/testutil.lua:784: in function 'itp_parent' 
test/unit/testutil.lua:822: in function <test/unit/testutil.lua:812>
````

Solution:
Update filter_complex_blocks.
2025-11-18 15:30:20 -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
Yochem van Rosmalen
a468bc573d ci: check URL reachability #35593
Problem:
scripts/check_urls.vim manually matches urls in the help pages and then
synchronously checks them via curl/wget/powershell. This is extremely
slow (~5 minutes for Nvims runtime on my machine) and prone to errors in
how the urls are matched.

Solution:
- Use Tree-sitter to find the urls in the help pages and `vim.net.request` to
  check the responses.
- Add a `lintdocurls` build task and check it in CI (every Friday).
  - Reopens a dedicated issue if it finds unreachable URLs.
- Drop the old check_urls.vim script.
2025-11-18 12:35:22 -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
Vendetta
2483d5ad8a fix(clint.py): replace deprecated codecs.open #36593
Remove codecs import and use open(..., encoding='utf-8', errors='replace', newline=None) in clint.py to avoid Python 3.14 DeprecationWarning; preserve existing CR handling.
2025-11-18 09:35:42 -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