Commit Graph

35483 Commits

Author SHA1 Message Date
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>
nightly
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
zeertzjq
dec3c6fa34 test(lsp): fix fake LSP server timeout not working (#37970)
Problem:  Fake LSP server does not timeout or respond to SIGTERM as it
          does not run the event loop.
Solution: Instead of io.read(), use stdioopen()'s on_stdin callback to
          accumulate input and use vim.wait() to wait for input.

Also, in the test suite, don't stop a session when it's not running, as
calling uv.stop() outside uv.run() will instead cause the next uv.run()
to stop immediately, which cancels the next RPC request.
2026-02-19 10:38:14 -08:00
zeertzjq
08f4811061 fix(treesitter): :InspectTree wrong title for non-relative path #37965
Problem:  :InspectTree sets wrong title for file with non-relative path.
Solution: Use full path if relpath() returns nil.
2026-02-19 12:05:48 -05:00
Evgeni Chasnovski
9567fb0507 fix(defaults): silent gx if no textDocument/documentLink support #37969
Problem: If buffer has attached LSP servers and none of them supports
  `textDocument/documentLink` method, typing `gx` results in a warning
  about that.

Solution: Explicitly check that at least one server supports the target
  method before making the LSP request.
2026-02-19 06:59:00 -05:00
zeertzjq
f0137bf443 test(terminal/channel_spec): fix test still flaky on Windows (#37968)
FAILED   1 test, listed below:
FAILED   test/functional/terminal/channel_spec.lua @ 133: chansend sends lines to terminal channel in proper order
test/functional/terminal\channel_spec.lua:141: retry() attempts: 3
test/functional/terminal\channel_spec.lua:143: Failed to match any screen lines.
Expected (anywhere): "echo "hello".*echo "world""
Actual:
  |^PowerShell 7.4.13                                                                                   |
  |PS D:\a\neovim\neovim> {UNEXPECTED foreground = tonumber('0xffff40'), fg_indexed = true:echo }{UNEXPECTED foreground = tonumber('0x00e0e0'), fg_indexed = true:"hello"}                                                                 |
  |hello                                                                                               |
  |PS D:\a\neovim\neovim> {UNEXPECTED foreground = tonumber('0xffff40'), fg_indexed = true:echo }{UNEXPECTED foreground = tonumber('0x00e0e0'), fg_indexed = true:"world"}                                                                 |
  |{UNEXPECTED foreground = Screen.colors.Gray88, fg_indexed = true:>> }                                                                                                 |
  |world                                                                                               |
  |PS D:\a\neovim\neovim> {UNEXPECTED foreground = tonumber('0xffff40'), fg_indexed = true:echo }{UNEXPECTED foreground = tonumber('0x00e0e0'), fg_indexed = true:"hello"}                                                                 |
  |{UNEXPECTED foreground = Screen.colors.Gray88, fg_indexed = true:>> }                                                                                                 |
  |hello                                                                                               |
  |PS D:\a\neovim\neovim> {UNEXPECTED foreground = tonumber('0xffff40'), fg_indexed = true:echo }{UNEXPECTED foreground = tonumber('0x00e0e0'), fg_indexed = true:"world"}                                                                 |
  |{UNEXPECTED foreground = Screen.colors.Gray88, fg_indexed = true:>> }                                                                                                 |
  |world                                                                                               |
  |PS D:\a\neovim\neovim> {UNEXPECTED foreground = tonumber('0xffff40'), fg_indexed = true:echo }{UNEXPECTED foreground = tonumber('0x00e0e0'), fg_indexed = true:"hello"}                                                                 |
  |{UNEXPECTED foreground = Screen.colors.Gray88, fg_indexed = true:>> }                                                                                                 |
  |hello                                                                                               |
  |PS D:\a\neovim\neovim> {UNEXPECTED foreground = tonumber('0xffff40'), fg_indexed = true:echo }{UNEXPECTED foreground = tonumber('0x00e0e0'), fg_indexed = true:"world"}                                                                 |
  |{UNEXPECTED foreground = Screen.colors.Gray88, fg_indexed = true:>> }                                                                                                 |
  |world                                                                                               |
  |{1:term://D:\a\neovim\neovim//9056:pwsh.exe -nop [-]                                                   }|
  |                                                                                                    |
2026-02-19 19:31:33 +08:00
zeertzjq
2605ce9377 test: fix flaky tests in terminal/{buffer,channel}_spec.lua (#37966)
In buffer_spec.lua, wait for a bit more than the refresh delay.
In channel_spec.lua, retry sending lines on Windows.
2026-02-19 17:57:02 +08:00
zeertzjq
76db55c137 test(ex_cmds/write_spec): don't create files under test/ (#37963) 2026-02-19 06:30:26 +00:00
zeertzjq
ea3942f222 test: remove duplicate test file 078_swapfile_recover_spec.lua (#37961)
This is now covered by Test_swap_file() in test_recover.vim.
2026-02-19 04:14:39 +00:00
zeertzjq
e98a6979ee vim-patch:9.2.0025: filetype: cshtml incorrectly recognized (#37957)
Problem:  filetype: cshtml incorrectly recognized, razor files are not
          recognized
Solution: Detect *.cshtml and *.razor files as razor filetype
          (tris203)

Reference:
https://learn.microsoft.com/en-us/aspnet/core/mvc/views/razor?view=aspnetcore-10.0

closes: vim/vim#19207

68dbb58d51

Co-authored-by: tris203 <admin@snappeh.com>
2026-02-19 02:46:27 +00:00
zeertzjq
e142e01d57 fix(rpc): include write failure reason in log (#37959)
Also don't use LOGLVL_ERR on UV_EPIPE.
2026-02-19 10:34:22 +08:00
Maria Solano
c3589753a0 fix(lsp): add vim.deprecate call to vim.lsp.with (#37960) 2026-02-18 18:16:03 -08:00
zeertzjq
336469ff2d Merge pull request #37958 from zeertzjq/vim-9.2.0023
vim-patch:9.2.{0023,0024}
2026-02-19 09:05:06 +08:00
zeertzjq
fadf5fc8db vim-patch:9.2.0024: Reading files with very long lines crashes with a segfault
Problem:  Reading files with lines approaching MAXCOL length crashes
          with segfault due to colnr_T overflow.
Solution: The split check 'linerest >= MAXCOL' fired too late because
          linerest could grow by up to 'size' bytes before the next
          check. Change threshold to 'linerest >= MAXCOL - size' to
          ensure the line passed to ml_append() stays within colnr_T
          range.

Note: supported by AI claude

fixes:   vim/vim#17935
closes:  vim/vim#18953
closes:  vim/vim#19332

6cc291da06

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-02-19 08:19:44 +08:00
zeertzjq
134782b99e vim-patch:9.2.0023: fix integer overflow in ml_append_int() for long lines
Problem:  ml_append_int() crashes when appending lines near MAXCOL
          length due to signed integer overflow in space_needed
          calculation.
Solution: Change 'space_needed' from int to long to handle the
          'len + INDEX_SIZE' computation without overflow. Update
          db_free comparison casts from (int) to (long) to match.

Note: supported by AI claude

related: vim/vim#17935
related: vim/vim#18953
related: vim/vim#19332

0ece393844

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-02-19 08:19:44 +08:00
zeertzjq
6877fef972 vim-patch:89712b9: runtime(ccomplete): handle structs from tags file (#37956)
fixes: vim/vim#7292

89712b9f0e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-02-19 00:18:55 +00:00
zeertzjq
ac84a3f3b6 vim-patch:9.2.0020: Wrong shortened buffer after :cd with duplicate slashes (#37955)
Problem:  Wrong shortened buffer name after :cd with duplicate slashes.
Solution: Skip over multiple consecutive path separators (zeertzjq).

related: neovim/neovim#37080
closes:  vim/vim#19444

f245e17ac7

N/A patches:
vim-patch:9.0.1859: heap-use-after-free in bt_normal()
vim-patch:9.2.0022: bt_quickfix() is slow
2026-02-19 07:46:10 +08:00
zeertzjq
d74e927310 test: remove XDG dir and rplugin manifest on cleanup (#37954) 2026-02-18 23:43:13 +00:00
zeertzjq
2154d325d5 fix(memfile): avoid potential crash on OOM (#37946)
When running out of memory in a libuv callback, try_to_free_memory()
will call mf_release_all(). In this case, mf_sync() cannot call
os_breakcheck() as it'll run the libuv loop recursively, so check
main_loop.recursive to prevent that.

Also fix another possible problem that a terminal buffer may have a
swapfile when encountering an OOM in e.g. terminal_alloc().
2026-02-19 06:07:16 +08:00
Bartłomiej Maryńczak
761fbc155a test(lsp): add entire-line completion word case (#37927)
Problem:
Multiword completion items used to be cut at a first word.

Solution:
Add a test that ensures this does not regress in the future
2026-02-18 13:13:38 -08:00
Maria Solano
6fe68abdf5 fix(lsp): use entire line as completion word (#37949) 2026-02-18 11:40:34 -08:00
Justin M. Keyes
0e4fa55200 Merge #37928 prompt-buffer cursor, undo 2026-02-18 14:19:25 -05:00
Christian Clason
4b14ba5258 ci(deps): don't brew install ninja on macOS
Problem: `install_deps.sh` tries to install `ninja` on macOS, but it is
installed on the runners by default, triggering warnings (and wasting
time) on CI.

Solution: Don't `brew install ninja`.
2026-02-18 19:39:31 +01:00
Christian Clason
3bdebfb87f feat(defaults): don't enable treesitter query linter
This was added before there was a dedicated language server for
tree-sitter queries. Now that https://github.com/ribru17/ts_query_ls
exists, this is a better option in every regard (and up to now
required manually disabling the builtin linter to avoid duplicate
diagnostics and performance issues).
2026-02-18 18:06:35 +01:00
Justin M. Keyes
abfe6c9ef7 feat(logging): rename ".nvimlog" => "nvim.log" #37935
- Rename ".nvimlog" to "nvim.log"
  - doesn't need to be "hidden"/dotfile
  - ".log" extension helps with filetype detection
- Also rename "nvim/log" => "nvim/nvim.log"
2026-02-18 11:58:34 -05:00
zeertzjq
d23f28cca2 test(win_scrolled_resized_spec): fix flaky test (#37942) 2026-02-18 21:10:22 +08:00
zeertzjq
d0c699ec7b test(screen): fix minimal timeout too small for "intermediate" (#37933)
After #27620 flags.timeout is no longer used as the minimal timeout for
"intermediate", but the default minimal timeout shouldn't be too small.
2026-02-18 19:10:08 +08:00
zeertzjq
a520d9c4ea test: fix test failure causing following tests to fail (#37932) 2026-02-18 17:08:08 +08:00
bfredl
fa9e071b83 Merge pull request #37826 from glepnir/hl_underline_int_overflow
fix(highlight): blend underline check and use 64-bit key for attr cache to support 32-bit attr values
2026-02-18 09:46:41 +01:00