Commit Graph

35510 Commits

Author SHA1 Message Date
luukvbaal
844caca881 fix(ui2): multiline/color replaced message, expanded cmdline, error messages #38044
Problem:  - Unintentionally inserting lines for a replaced multiline
          message that also has multiple highlights.
          - Scheduled check to see if the expanded cmdline window was
          entered makes it difficult to keep track of what happens when
          the key pressed to dismiss it results in a message.
          - Reading the first line of an error message should be enough
          notice for something going wrong.
          - "search_cmd" messages should not be shown with 0 'cmdheight'.
          - Unable to configure dynamically changed pager height.
          - Enabling UI2 doesn't make sense with no UIs attached.

Solution: - Only insert a line for the first chunk after a newline.
          - Use getmousepos() to check if the expanded cmdline was
          clicked to enter the pager.
          entering the pager to serve as a configuration interface.
          - Don't expand the cmdline for error messages; user can press g<.
          - Don't show "search_cmd" messages with 'cmdheight' set to 0.
          - Change 'eventignorewin' to ensure WinEnter is fired when
          - Have enable() return early when no UIs are attached.
2026-02-24 17:05:38 -05:00
phanium
16aab4cb48 fix(treesitter): InspectTree only show the largest injection #37906
Problem:
:InspectTree don't show luadoc injection lua file. Since luadoc share
the same "root" with comment in their common primary (lua) tree.
Current logic simply show the largest (comment injection) and ignore all
smaller one (luadoc injection).

Solution:
Handle different lang injections separately. Then sort them by
byte_length to ensure the draw tree consistent.
2026-02-24 16:22:30 -05:00
luukvbaal
39c4e0f336 fix(messages): unwanted ext_messages newlines for confirm() #38045
Problem:  Newlines emitted with ext_messages intended to position
          the message/prompt on the message grid.
Solution: Don't emit these newlines with ext_messages, followup to 4260f73e.
2026-02-24 13:01:31 -05:00
glepnir
3115a18a80 refactor(test): lsp completion spec cleanup #38041
Problem: retry/feed/tbl_map patterns duplicated everywhere, detach check was a false negative

Solution: extract wait_for_pum/extract_word_abbr/word_sorter helpers,
fix assert_cleanup_after_detach with positive+negative pum confirmation
2026-02-24 09:20:58 -05:00
glepnir
5eb1c4df54 refactor(test): avoid deprecated functions #37017
Problem:
Tests are using some deprecated functions.

Solution:
Replace with command, pcall_err, etc.
2026-02-24 07:15:24 -05:00
github-actions[bot]
5d6846c389 docs: update version.c #37962
vim-patch:9.1.0001: tests: Test_popup_setbuf() fails
vim-patch:9.2.0018: high cpu usage with Wayland compositor
vim-patch:472f46e23 README.md: mention r/vim and #vim libera
vim-patch:dbd924f6a runtime(syntax-tests): Fail when executable syntax tests are found
vim-patch:70a9273dc Filelist: Fix CI error caused by xdg.vim missing in Filelist
vim-patch:405ba5010 runtime(doctags): remove unused header include file
vim-patch:47eb32fc9 translation(zh): Update menu translation for changed "Sponsor" entry
vim-patch:9.2.0038: Wayland: Not using bool type
vim-patch:a99dcca17 Maintainers: Update MAINTAINERS file
vim-patch:7b7a6f941 Add information for runtime files in the bug template.
vim-patch:9b16aa34b CI: Avoid referencing the unstable ddebs.ubuntu.com/noble-proposed mirror
vim-patch:9.2.0044: Wayland: still performance issues

Co-authored-by: marvim <marvim@users.noreply.github.com>
2026-02-24 03:40:03 -05:00
Oleksandr Chekhovskyi
d9d8c660fd fix(watch): invalid joined path #37973
Problem:
When vim._watch.watch() is used to watch a single file, libuv returns
the basename as the filename argument in the callback. The code joins
this with the watched path, producing a nonsensical path like
"/path/to/file.lua/file.lua", which causes ENOTDIR errors on
subsequent fs_stat calls.

Solution:
Check whether the watched path is a directory before joining the
filename. When watching a file, ignore the filename from libuv and
use the watched path directly.
2026-02-23 17:33:13 -05:00
Yochem van Rosmalen
b57ed5e940 refactor(gen): let Hugo build html docs #37972
Problem:
The html and css of the website's documentation pages are defined in
long strings in gen_help_html.lua, making it hard to maintain and
improve them. E.g. adding in headers that state the documentation is for
nightly Nvim has been a long standing feature request.

Solution:
Move the inlined css and html (e.g. the <head>, <nav>, etc.) to Hugo.

Now that the website is build with Hugo, we can use its templating
system to generate the full html/css from the Tree-sitter tree:
https://github.com/neovim/neovim.github.io/pull/437
2026-02-23 17:26:27 -05:00
Andrew Braxton
eb90f5d9e3 fix(lsp): only resolve LSP configs once (#38007)
`lsp.config[]` resolves an LSP config the first time it is called, and
returns the cached result on subsequent calls.

The change in #37571 added an extra call to `lsp.config[]` which will
resolve the config *before* the server is added to `_enabled_configs`,
meaning the result is discarded. That means configs will be needlessly
resolved again once `lsp_enable_callback` fires for the first time. That
includes an additional `loadfile()` call which is relatively expensive
and can have unexpected side effects.

Avoid this by storing the result of the initial call to `lsp.config[]`
in `_enabled_configs` so the config is not resolved a second time once
`lsp_enable_callback` is called for the first time.
2026-02-23 11:15:53 -08:00
bfredl
4d754d2704 Merge pull request #37265 from bfredl/zigluajit
fix(build): build.zig: use luajit also on windows
2026-02-23 18:43:28 +01:00
glepnir
1ec74fa7b1 fix(api): win_config border type #38030
Problem: ArrayOf(String) doesn't cover mixed string/array border chars.

Solution: use Union(Array, Enum(...)) to match parse_border_style behavior.
2026-02-23 11:23:46 -05:00
Sean Dewar
32d3dd0650 fix(statusline): broken statusline on error #38000
Problem: after #33036, an error from evaluating 'statusline' clears it and
doesn't draw the statusline. (causing glitchy redraws)

Solution: use the default value instead. If 'stl' is somehow ever empty, still
call redraw_custom_statusline to at least draw an empty statusline.

Ideally our default 'stl' shouldn't itself error too! :-)
Also adjust some prior screen:expect()s to avoid immediate success warnings.
2026-02-23 11:22:13 -05:00
Sean Dewar
2478a7fbbd docs(api): nvim_open_win "split" with negative "win" #38032
Acts like :topleft/botright.
2026-02-23 10:10:20 -05:00
GX
374e869504 build: distclean: remove zig-related dirs #38013 2026-02-23 14:56:41 +00:00
Justin M. Keyes
0d13945bbb feat(messages): drop hardcoded 'showmode' delay #38029
Problem:
- Editing a 'readonly' file forces a 3-second delay.
- nvim_get_mode waits 3 secs with 'showmode' enabled or when there are error messages.

Solution:
Remove the delay for "ui2", by using `msg_delay`.
2026-02-23 09:54:35 -05:00
zeertzjq
f1490b5fe9 test: don't test overriding argv[0] using FFI (#38012)
Instead, test this by adding a new functionality to shell-test, allowing
reuse in other future tests.
2026-02-23 21:43:44 +08:00
bfredl
8069df2661 fix(build): build.zig: use luajit for windows
These were disabled as they failed when tested with cross-compiling,
but it works fine for windows natively on ci, so let's use that.

mac os builds after disabling debug info, which currently
triggers a bug in zig's MachO linker: natecraddock/ziglua#191
Tracking issue: https://codeberg.org/ziglang/zig/issues/30669
Unfortunately actually using the JIT of luajit still triggers
issues on mac os, so we cannot use it yet.

Also sync luajit version used via ziglua to a recent one
like we use in cmake, see natecraddock/ziglua#196
2026-02-23 10:33:06 +01:00
Sathya Pramodh
c5b8ed870b fix(coverity/644326): NULL ptr deref in socket_address_is_tcp #38010 2026-02-23 04:18:20 -05:00
Justin M. Keyes
ce5c7111f4 refactor: defer_fn return type #37999 2026-02-23 03:24:14 -05:00
Justin M. Keyes
61678811d8 fix(health): check more "old" files #38028 2026-02-23 03:20:37 -05:00
zeertzjq
250d77cce7 test(terminal/scrollback_spec): fix flaky test (#38026)
When using feed_data() with hidden buffer, terminal refresh may arrive
during may_restore_curbuf(), causing "last cursor" positions to change.
Get the two "last cursor" positions in the same RPC call.
2026-02-23 13:51:37 +08:00
zeertzjq
97509aa2be fix(process): handle poll() interrupted by a signal (#38024)
It is indeed possible that a signal may arrive during flush_stream()
(e.g. SIGCHLD from another child process), so poll() again on EINTR.

Fixes the following Coverity warning:
_____________________________________________________________________________________________
*** CID 644345:         Error handling issues  (CHECKED_RETURN)
/src/nvim/event/proc.c: 405             in flush_stream()
399
400     #ifdef __linux__
401         // On Linux, libuv's polling (which uses epoll) doesn't flush PTY master's pending
402         // work on kernel workqueue, so use an explcit poll() before that. #37982
403         if (proc->type == kProcTypePty && !stream->did_eof) {
404           struct pollfd pollfd = { .fd = ((PtyProc *)proc)->tty_fd, .events = POLLIN };
>>>     CID 644345:         Error handling issues  (CHECKED_RETURN)
>>>     Calling "poll(&pollfd, 1UL, 0)" without checking return value. This library function may fail and return an error code.
405           poll(&pollfd, 1, 0);
406         }
407     #endif
408         // Poll for data and process the generated events.
409         loop_poll_events(proc->loop, 0);
410         if (stream->s.events) {

Another possible error is ENOMEM, which is probably not worth handling.
For reference, #23308 previously removed a case of ENOMEM handling, and
this PR also removes an outdated mention of that.

Also reduce the number of #ifdefs in non-OS-specific files.
2026-02-23 12:28:17 +08:00
zeertzjq
ec24746406 test(core/channels_spec): fix flaky test (#38025)
If the last nvim_eval arrives on RPC channel before rpc_close_event() is
processed, it will be scheduled immediately after rpc_close_event() and
before free_channel_event(), causing the test to fail.
2026-02-23 04:26:38 +00:00
zeertzjq
1b013adff3 test(terminal/channel_spec): fix flaky test (#38023)
Adding input doesn't help here, as the important part here is processing
main_loop.events, not running the main loop. Instead, use a non-fast API
request to ensure that previously queued events are processed.
2026-02-23 01:48:15 +00:00
zeertzjq
14fe370564 fix(logging): don't overwrite NameBuff (#38004) 2026-02-23 08:00:26 +08:00
zeertzjq
8a4719e117 fix(process): use poll() to drain PTY master on Linux (#38005)
On Linux, libuv's polling (which uses epoll) doesn't flush PTY master's
pending work on kernel workqueue, so use an explicit poll() before that.
2026-02-23 07:15:38 +08:00
glepnir
f90cd620c5 fix(lsp): vim.lsp.completion clean up triggers on client detach (#38009)
Problem: LspDetach didn't clean up stale client refs in triggers table.

Solution: create LspDetach autocmd and call disable_completion.
2026-02-22 11:43:32 -08:00
zeertzjq
3f4ef487da vim-patch:9.2.0040: completion: preinsert wrong with register completion (#38003)
Problem:  completion: preinsert wrong with register completion
Solution: Remove preinserted text during register content insertion
          (Girish Palya).

fixes:  vim/vim#19329
closes: vim/vim#19474

3684ad83d1

Co-authored-by: Girish Palya <girishji@gmail.com>
2026-02-22 08:13:15 +08:00
zeertzjq
940d5c239b Merge pull request #37991 from zeertzjq/vim-9.2.0031
vim-patch:9.2.{0031,0041}: Inefficient use of ga_concat()
2026-02-22 07:43:59 +08:00
zeertzjq
b775c722dd vim-patch:9.2.0041: Not always using GA_CONCAT_LITERAL
Problem:  Not always using GA_CONCAT_LITERAL with string literals.
          (after: v9.2.0031)
Solution: Use the GA_CONCAT_LITERAL, instead of ga_concat_len.
          (John Marriott)

closes: vim/vim#19468

fc90d8087a

Co-authored-by: John Marriott <basilisk@internode.on.net>
2026-02-22 07:10:58 +08:00
zeertzjq
b3a3028fd9 vim-patch:9.2.0031: Inefficient use of ga_concat()
Problem:  Inefficient use of ga_concat()
Solution: Use ga_concat_len() when the length is already known to avoid
          use of strlen() (John Marriott).

closes: vim/vim#19422

ed202035b1

Co-authored-by: John Marriott <basilisk@internode.on.net>
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-02-22 07:02:47 +08:00
wjyoung65
9aa936d892 test(ui): failure in lua/ui_spec.lua in headless OS (no GUI) #37975 2026-02-21 15:00:06 -05:00
Justin M. Keyes
4648d89d50 docs: highlight, terminal SGR #37998 2026-02-21 14:52:13 -05:00
luukvbaal
96957d80c6 fix(messages): reinstate 'showmode' message delay #37992
Problem:  94c21c2 erroneously removed message delay without ext_messages.
Solution: Remove delay with ext_messages as intended.
2026-02-21 14:13:24 -05:00
Riley Bruins
524164ae05 ci: lint and format treesitter queries
This also adds a `formatquery` rule to write the new format to the query
files.
2026-02-21 13:26:36 +01:00
zeertzjq
30d9970cd7 vim-patch:9.2.0036: completion: thesaurus completion incorrect with "longest/fuzzy" (#37996)
Problem:  completion: thesaurus completion incorrect with
          "longest/fuzzy" (Mao-Yining)
Solution: Disable fuzzy matching and longest-match insertion
          specifically for thesaurus completion (Girish Palya).

fixes:  vim/vim#19356
closes: vim/vim#19475

26a3f486cc

Co-authored-by: Girish Palya <girishji@gmail.com>
2026-02-21 19:54:25 +08:00
Sathya Pramodh
d79a9dcd42 refactor(net): socket_address_is_tcp #37947 2026-02-20 18:41:55 -05:00
Riccardo Mazzarini
cb8c9186e6 feat(highlight): support more SGR attributes #37901
Problem:
TUI does not support several standard SGR text attributes:
- dim/faint (SGR 2)
- blink (SGR 5)
- conceal (SGR 8)
- overline (SGR 53)
This means that when a program running in the embedded terminal emits
one of these escape codes, we drop it and don't surface it to the
outer terminal.

Solution:
- Add support for those attributes.
- Also add corresponding flags to `nvim_set_hl` opts, so users can set
  these attributes in highlight groups.
  - refactor(highlight): widen `HlAttrFlags` from `int16_t` to `int32_t`
    Widen the `rgb_ae_attr` and `cterm_ae_attr` fields in HlAttrs from
    int16_t to int32_t to make room for new highlight attribute flags,
    since there was only one spare bit left.
  - The C flag is named HL_CONCEALED to avoid colliding with the
    existing HL_CONCEAL in syntax.h (which is a syntax group flag, not
    an SGR attribute).
- Also note that libvterm doesn't currently support the dim and overline
  attributes, so e.g. `printf '\e[2mThis should be dim\n'` and `printf
  '\e[53mThis should have an overline\n'` are still not rendered
  correctly when run from the embedded terminal.
2026-02-20 18:35:55 -05:00
zeertzjq
57c6b61cf2 fix(event-loop): don't call uv_stop() when loop isn't running (#37984)
Otherwise it will cause the next uv_run() to stop immediately.
2026-02-21 05:50:54 +08:00
zeertzjq
94c21c22dc Merge pull request #37979 from zeertzjq/vim-9.2.0027
vim-patch: runtime file updates
2026-02-20 09:46:37 +08:00
zeertzjq
93a8acb1b8 vim-patch:9.2.0033: filetype: sh filetype used for env files
Problem:  filetype: sh filetype used for env files
Solution: Detect *.env and .env.* files as env filetype,
          detect .envrc and .envrc.* as sh filetype,
          include a simple env syntax script (DuckAfire)

Previously, .env files were handled by the shell syntax. While
functional, this limited the ability to support specific .env
implementations, such as CodeIgniter4 which allows dots in keys
(e.g., "foo.bar=0").

The new dedicated 'env' filetype and syntax script improves legibility
and prevents highlighting from breaking when encountering spaces.
Currently, the syntax does not support indentation; fields, variables,
and comments must start at the beginning of the line.

closes: vim/vim#19260

d0fa375629

Co-authored-by: DuckAfire <155199080+duckafire@users.noreply.github.com>
2026-02-20 09:26:07 +08:00
zeertzjq
595b4cc48e vim-patch:4611f7b: runtime(apache): Add 'SSLVHostSNIPolicy' declaration to syntax script
The declaration 'SSLVHostSNIPolicy' has bee introduced in version 2.4.66.

closes: vim/vim#19452

4611f7b656

Co-authored-by: Michael Osipov <michael.osipov@innomotics.com>
2026-02-20 09:18:13 +08:00
zeertzjq
c67248988b vim-patch:342ae5f: runtime(progress): Use setlocal for expandtab
The Progress syntax file gained `set expandtab` in 4c3f536f4 (updated
for version 7.0d01, 2006-04-11). The Progress language itself doesn't
distinguish between tabs and spaces for indentation, so this seems like
something that should be left to user preference; but the setting is
accompanied by the comment "The Progress editor doesn't cope with tabs
very well", so there may be reason to keep it.

However, using `set` means that any new buffers created after editing a
Progress file will also have `expandtab` turned on, which is likely
contrary to a user's expectations. We should use `setlocal` instead to
avoid this.

closes: vim/vim#19458

342ae5f8aa

Co-authored-by: Daniel Smith <daniel@rdnlsmith.com>
2026-02-20 09:17:57 +08:00
zeertzjq
c78e276881 vim-patch:9.2.0027: filetype: yara files are not recognized
Problem:  filetype: yara files are not recognized
Solution: Detect *.yara and *.yar files as yara filetype
          (Thomas Dupuy).

Reference:
- https://github.com/VirusTotal/yara
- https://github.com/VirusTotal/yara-x

closes: vim/vim#19460

7d93ae57f0

Co-authored-by: Thomas Dupuy <thom4s.d@gmail.com>
2026-02-20 09:17:46 +08:00
zeertzjq
8c22ba8b79 Merge pull request #37978 from zeertzjq/vim-9.2.0030
vim-patch:9.2.{0030,0032}
2026-02-20 09:15:45 +08:00
zeertzjq
6e8a1a8988 vim-patch:9.2.0032: completion: hang with line completion and fuzzy
Problem:  completion: hang with line completion and fuzzy (Jesse Pavel)
Solution: Only check the line number when wrapping around the file
          (Hirohito Higashi).

fixes:  vim/vim#19434
closes: vim/vim#19443

d8648f7279

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-02-20 09:01:20 +08:00
zeertzjq
08b8fe5ab3 vim-patch:9.2.0030: completion: non-prefix matches shown when leader is NULL
Problem:  When 'autocomplete' fires before compl_leader is initialized,
          the prefix filter is bypassed. This allows non-prefix matches
          (e.g. from fuzzy omnifuncs) to be shown in the popup menu and
          incorrectly preinserted.
Solution: In get_leader_for_startcol(), if compl_leader.string is NULL,
          fall back to using compl_orig_text as a filter for matches
	  starting at or after the completion column (Hirohito Higashi).

When 'autocomplete' first fires, compl_leader is NULL because
ins_compl_start() has not set it yet.  This caused the prefix filter in
ins_compl_build_pum(), find_next_completion_match() and
find_common_prefix() to be bypassed, allowing non-prefix fuzzy omnifunc
matches to appear in the PUM and be preinserted.

Extend get_leader_for_startcol() to fall back to compl_orig_text when
compl_leader.string is NULL: if the match's cpt source startcol is less
than compl_col the match includes pre-compl_col text, so return
&compl_leader (NULL string) to signal "pass through"; otherwise return
&compl_orig_text so callers filter by the original text.  The compl_col
<= 0 guard is kept only for the prepend-text path to avoid it
interfering with the NULL-leader fallback when compl_col is zero.

With this change all callers of get_leader_for_startcol() automatically
receive the correct filter string without additional helpers.

Also update Test_autocomplete_trigger Test 9 to reflect the new
behavior: 'faberge' is no longer shown when completing 'foo' because
it does not start with the current prefix.

Add Test_autocomplete_preinsert_null_leader() to verify that only
prefix-matching candidates appear in the PUM and are preinserted.

fixes:  vim/vim#19328
closes: vim/vim#19447

a04ae0210b

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 08:58:41 +08:00
zeertzjq
e3d46a6337 test: start test runners in Xtest_xdg dir (#37964)
This is a better way to prevent parallel tests from interfering with
each other, as there are many ways files can be created and deleted in
tests, so enforcing different file names is hard.

Using $TMPDIR can also work in most cases, but 'backipskip' etc. have
special defaults for $TMPDIR.

Symlink runtime/, src/, test/ and README.md to Xtest_xdg dir to make
tests more convenient (and symlinking test/ is required for busted).

Also, use README.md instead of test/README.md in the Ex mode inccommand
test, as test/README.md no longer contains 'N' char.
2026-02-20 06:53:33 +08:00
zeertzjq
785ac9f228 vim-patch:9.2.0028: matchadd() conceal may use unrelated syntax cchar (#37974)
Problem:  matchadd() conceal may use unrelated syntax cchar.
Solution: Only use syntax cchar when syntax_flags has HL_CONCEAL
          (zeertzjq).

closes: vim/vim#19459

d01f234ec1
2026-02-19 22:51:31 +00:00
luukvbaal
2de284e50b fix(message): set replace_last for completion "scanning" messages #37967
Problem:  UIs put ins-completion "scanning" messages one after another,
          which are meant to overwrite the previous message.
Solution: Ensure the msg_show "replace_last" parameter is set.
2026-02-19 16:01:43 -05:00