33743 Commits

Author SHA1 Message Date
Jalil David Salamé Messina
bd45e2be63 fix(checkhealth): wrong ABI version for treesitter parsers #35327
Don't print ABI version of duplicated parsers that are later in the
runtime path (see [#35326]).

Change the sorting from `name > path` to `name > rtpath_index`, this
ensures the first (loaded) parser is first in the list and any
subsequent parsers can be considered "not loaded".

This is fuzzy at best since `vim.treesitter.language.add` can take a
path to a parser and change the load order.

The correct solution is for `vim.treesitter.language.inspect` to return
the parser path so we can compare against it and/or for it to also be
able to take a path to a parser so we can inspect it without loading it
first.
2025-08-14 11:47:43 -07:00
bfredl
c26f989b2f fix(build): also check os_win sources with uncrustify in CI 2025-08-14 10:36:08 +02:00
bfredl
38986188ba Merge pull request #35206 from bfredl/nopreproc_cleanup
refactor(build): remove INCLUDE_GENERATED_DECLARATIONS guards
2025-08-14 10:02:57 +02:00
bfredl
442f297c63 refactor(build): remove INCLUDE_GENERATED_DECLARATIONS guards
These are not needed after #35129 but making uncrustify still play nice
with them was a bit tricky.

Unfortunately `uncrustify --update-config-with-doc` breaks strings
with backslashes. This issue has been reported upstream,
and in the meanwhile auto-update on every single run has been disabled.
2025-08-14 09:34:38 +02:00
zeertzjq
d19d2b4491 vim-patch:1ee1d9b: runtime(python): highlight "self" and "cls" in syntax script (#35328)
These are special names by convention, and giving them distinct
highlighting is a nice visual clue (using Identifier by default).

This group is named "pythonClassVar" to match the name used by
python-syntax. Some third-party color schemes are aware of this
name and customized their colors accordingly.

closes: vim/vim#17968

1ee1d9b43d

Co-authored-by: Jon Parise <jon@indelible.org>
2025-08-14 08:36:24 +08:00
zeertzjq
9843573a61 Merge pull request #35320 from zeertzjq/vim-9.1.1627
vim-patch:9.1.{1627,1628}
2025-08-14 07:18:05 +08:00
zeertzjq
2619a749a5 vim-patch:9.1.1628: fuzzy.c has a few issues
Problem:  fuzzy.c has a few issues
Solution: Use Vims memory management, update style
          (glepnir)

Problem:
- Missing cleanup of lmatchpos lists causing memory leaks
- Missing error handling for list operations
- Use of malloc() instead of Vim's alloc() functions
- Inconsistent C-style comments
- Missing null pointer checks for memory allocation
- Incorrect use of vim_free() for list objects

Solution:
- Add proper cleanup of lmatchpos in done section using list_free()
- Set lmatchpos to NULL after successful transfer to avoid confusion
- Add error handling for list_append_tv() failures
- Replace malloc() with alloc() and add null pointer checks
- Convert C-style comments to C++ style for consistency
- Fix vim_free() calls to use list_free() for list objects

closes: vim/vim#17984

17a6d696bd

Co-authored-by: glepnir <glephunter@gmail.com>
2025-08-14 06:48:31 +08:00
zeertzjq
6f0ef8a5f2 vim-patch:c93a2b3: runtime(doc): Adapt fuzzy doc to reflect 'fzy' algorithm
closes: vim/vim#17988

c93a2b3327

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-14 06:48:31 +08:00
zeertzjq
869000e7ce vim-patch:9.1.1627: fuzzy matching can be improved
Problem:  fuzzy-matching can be improved
Solution: Implement a better fuzzy matching algorithm
          (Girish Palya)

Replace fuzzy matching algorithm with improved fzy-based implementation

The
[current](https://www.forrestthewoods.com/blog/reverse_engineering_sublime_texts_fuzzy_match/)
fuzzy matching algorithm has several accuracy issues:

* It struggles with CamelCase
* It fails to prioritize matches at the beginning of strings, often
  ranking middle matches higher.

After evaluating alternatives (see my comments
[here](https://github.com/vim/vim/issues/17531#issuecomment-3112046897)
and
[here](https://github.com/vim/vim/issues/17531#issuecomment-3121593900)),
I chose to adopt the [fzy](https://github.com/jhawthorn/fzy) algorithm,
which:

* Resolves the aforementioned issues.
* Performs better.

Implementation details

This version is based on the original fzy
[algorithm](https://github.com/jhawthorn/fzy/blob/master/src/match.c),
with one key enhancement: **multibyte character support**.

* The original implementation supports only ASCII.
* This patch replaces ascii lookup tables with function calls, making it
  compatible with multibyte character sets.
* Core logic (`match_row()` and `match_positions()`) remains faithful to
  the original, but now operates on codepoints rather than single-byte
  characters.

Performance

Tested against a dataset of **90,000 Linux kernel filenames**. Results
(in milliseconds) show a **\~2x performance improvement** over the
current fuzzy matching algorithm.

```
Search String            Current Algo    FZY Algo
-------------------------------------------------
init                          131.759    66.916
main                          83.688     40.861
sig                           98.348     39.699
index                         109.222    30.738
ab                            72.222     44.357
cd                            83.036     54.739
a                             58.94      62.242
b                             43.612     43.442
c                             64.39      67.442
k                             40.585     36.371
z                             34.708     22.781
w                             38.033     30.109
cpa                           82.596     38.116
arz                           84.251     23.964
zzzz                          35.823     22.75
dimag                         110.686    29.646
xa                            43.188     29.199
nha                           73.953     31.001
nedax                         94.775     29.568
dbue                          79.846     25.902
fp                            46.826     31.641
tr                            90.951     55.883
kw                            38.875     23.194
rp                            101.575    55.775
kkkkkkkkkkkkkkkkkkkkkkkkkkkkk 48.519     30.921
```

```vim
vim9script

var haystack = readfile('/Users/gp/linux.files')

var needles = ['init', 'main', 'sig', 'index', 'ab', 'cd', 'a', 'b',
'c', 'k',
    'z', 'w', 'cpa', 'arz', 'zzzz', 'dimag', 'xa', 'nha', 'nedax',
'dbue',
    'fp', 'tr', 'kw', 'rp', 'kkkkkkkkkkkkkkkkkkkkkkkkkkkkk']
for needle in needles
    var start = reltime()
    var tmp = matchfuzzy(haystack, needle)
    echom $'{needle}' (start->reltime()->reltimefloat() * 1000)
endfor
```

Additional changes

* Removed the "camelcase" option from both matchfuzzy() and
  matchfuzzypos(), as it's now obsolete with the improved algorithm.

related: neovim/neovim#34101
fixes vim/vim#17531
closes: vim/vim#17900

7e0df5eee9

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-14 06:48:30 +08:00
TheBlob42
6f904cfef1 fix(snippet): adjacent tabstops without placeholders (#35167)
* fix(snippet): adjacent tabstops without placeholders

* test(snippet): add tests for directly adjacent tabstops
2025-08-13 14:51:43 -04:00
zeertzjq
7b9512e613 fix(api): fix not capturing output in cmdline mode (#35322) 2025-08-13 20:12:47 +08:00
bfredl
44fdbd6589 Merge pull request #34969 from bfredl/winbuild
feat(build): build.zig windows support.
2025-08-13 10:23:18 +02:00
bfredl
b70a6f3f3e Merge pull request #34394 from bfredl/shadamem
refactor(shada): A shada entry is a shada entry
2025-08-13 10:19:25 +02:00
zeertzjq
35be59cc7b vim-patch:9.1.1626: cindent: does not handle compound literals (#35319)
Problem:  C-indent does not handle compound literals
          (@44100hertz, @Jorenar)
Solution: Detect and handle compound literal and structure
          initialization (Anttoni Erkkilä)

match '=' or "return" optionally followed by &, (typecast), {
Fixes also initialization which begins with multiple opening braces.

fixes: vim/vim#2090
fixes: vim/vim#12491
closes: vim/vim#17865

5ba6e41d37

Co-authored-by: Anttoni Erkkilä <anttoni.erkkila@protonmail.com>
2025-08-12 23:21:09 +00:00
zeertzjq
50ceac4054 vim-patch:9.1.1625: Autocompletion slow with include- and tag-completion (#35318)
Problem:  Autocompletion slow with include- and tag-completion
Solution: Refactor ins_compl_interrupted() to also check for timeout,
          further refactor code to skip outputting message when
          performing autocompletion (Girish Palya).

Running `vim *` in `vim/src` was slower than expected when
'autocomplete' was enabled. Include-file and tag-file completion
sources were not subject to the timeout check, causing unnecessary
delays.

So apply the timeout check to these sources as well, improving
autocompletion responsiveness, refactor find_pattern_in_path() to take
an additional "silent" argument, to suppress any messages.

closes: vim/vim#17966

59e1d7f353

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-13 07:14:49 +08:00
argothiel
76a383bb7b docs: "git" is a prerequisite #35315
BUILD.md: Add git to prerequisites

The git command is literally the first one in the build instructions, therefore it's reasonable to treat it as one of the prerequisites. Void Linux already had git as one of the prerequisites; this commits adds git to all the other Unix systems.
2025-08-12 14:11:51 -07:00
glepnir
c7c3f9fc9c fix(api): fix crash in command preview with % #35228
Problem: parse_cmdline() sets eap->cmdlinep to address of local parameter,
causing invalid memory access when expand_filename() tries to modify it.
This leads to crashes when typing '%' in user commands with preview=true
and complete=file.

Solution: Change parse_cmdline() signature to accept char **cmdline,
allowing cmdlinep to point to caller's variable for safe reallocation.
2025-08-12 13:43:56 -07:00
Jaehwang Jung
3eab5bd38a fix(treesitter): set local values of window options 2025-08-12 16:26:11 +01:00
zeertzjq
e6e1e71abf vim-patch:dba9eb4: runtime(python): Also sync syntax at 'async def' (#35309)
A file containing only async functions (`async def func()`) wouldn't
previously match the pythonSync pattern.

Also, this pattern only matches at the beginning of the line, so it
won't ever match method definitions (which are indented within class
scopes). Update the comment accordingly.

closes: vim/vim#17963

dba9eb46e6

Co-authored-by: Jon Parise <jon@indelible.org>
2025-08-12 20:11:38 +08:00
bfredl
5e1c35509e refactor(shada): A shada entry is a shada entry
problem: most shada entries use weird `PossiblyFreedShadaEntry` type
solution: delet it

Shada entries can either be allocated by shada.c when reading,
or be constructed to represent the state of the current instance,
with direct references to live instance data to avoid extra allocations.
shada.c needs to carefully only free memory allocated by the first case,
and not free memory owned by other subsystems.

In some part of the code, this is inferred by the context but in others
we are mixing entries from different sources and need to indicate
the provenance by a `can_free_entry` flag. However constantly
frontloading this distinction  in the name of the type and with
extra nesting levels, cause extra cognitive overhead when trying
to understand the code in any other aspects than the specific detail
of avoiding leaks/double frees.

As we always know if the memory is owned or not for any entry, we
can just put `can_free_entry` directly on the ShadaEntry struct.
That only one state is possible in a given context, is indicated
by this neat little syntactical construct called a constant field
initializer.
2025-08-12 13:47:33 +02:00
bfredl
dc6cf3add9 feat(build): build.zig windows support
Tested using cross-compiling from linux:

    zig build -Dcross=true -Dtarget=x86_64-windows nvim_bin

Note: not fully functional without a runtime, which still has to be
fuddled with manually

Macos and windows builds require a recent zig 0.15+dev version
As this zig master branch is currently too much in flux, we can't make
our CI depend on zig master.

Revisit CI after zig 0.15 release or at least feature freeze.
2025-08-12 13:33:24 +02:00
tao
a26cdcb20e fix(inccommand): skip input() during preview #35272
Problem:
During preview, the `input` still prompts the user to enter something
that won't be used later, which could be a bit confusing.
e.g., `:s/a/\=input("")`.

Solution:
Make the input() return early during 'inccommand' preview.
2025-08-11 15:39:03 -07:00
Sergei Slipchenko
bc4bddbb21 fix: don't use logical diagnostic position in get_prev and get_next #35282
Problem: `vim.diagnostic.get_prev()` / `vim.diagnostic.get_next()` use
logical diagnostic positions and consider extmark validity.
`vim.diagnostic.get()` only uses original positions and doesn't care
about extmark validity. This results in inconsistency between these
APIs.

Solution: use original positions in `vim.diagnostic.get_prev()` and
`vim.diagnostic.get_next()` and don't consider extmark validity to match
previous behavior, which is consistent with `vim.diagnostic.get`.
2025-08-11 15:34:29 -07:00
Justin M. Keyes
3c7b698d61 Merge #35270 vim.pack: more control over "load" behavior 2025-08-11 18:20:25 -04:00
Shashwat Agrawal
67fede0fc9 fix(gen_help_html): ASCII art rendering in docs #35262
Problem:
gen_help_html.lua script misinterprets parts of ASCII diagrams as help tags
(e.g., `|_________|` in `usr_28.txt`). This incorrectly triggered
special alignment-fixing logic that is meant for columnar text.

Signed-off-by: Shashwat Agrawal <shashwatagrawal473@gmail.com>
2025-08-11 14:37:26 -07:00
skewb1k
7cc07e8383 feat(lsp): support signature help noActiveParameterSupport #34838 2025-08-11 14:31:57 -07:00
luukvbaal
be5a4851ea fix(extui): ensure temporary cmdline config is not restored #35301
Problem:  Temporary cmdline config is saved to be restored later.
Solution: Close the cmdline window so that it is recreated with the appropriate config.
2025-08-11 14:13:39 -07:00
Maria José Solano
f7802dd5d5 fix(lsp): deprecate vim.lsp.set_log_level, vim.lsp.get_log_path #35274 2025-08-11 13:51:40 -07:00
dependabot[bot]
b52f9a19b3 ci: bump actions/checkout from 4 to 5 #35305
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [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/v4...v5)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-11 13:43:53 -07:00
Riley Bruins
09f2c8d8ed docs(lsp): specify formatting_options type (#35302) 2025-08-11 14:36:35 -04:00
Maria José Solano
e94d8f03b9 fix(lsp): check for lens range in vim.lsp.codelens.run() (#35294) 2025-08-11 12:37:32 -04:00
zeertzjq
e3fd906b61 Merge pull request #35283 from janlazo/vim-8.1.0636
vim-patch:8.1.{636,1681,1700,1711},8.2.0115
2025-08-11 13:48:00 +08:00
Jan Edmund Lazo
7048c36ba8 vim-patch:8.2.0115: byte2line() does not work correctly with text properties
Problem:    Byte2line() does not work correctly with text properties. (Billie
            Cleek)
Solution:   Take the bytes of the text properties into account.
            (closes vim/vim#5334)

9df53b62de

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-11 01:06:42 -04:00
Jan Edmund Lazo
750c350be8 vim-patch:8.1.1711: listener callback called at the wrong moment
Problem:    Listener callback called at the wrong moment
Solution:   Invoke listeners before calling ml_delete_int(). (closes vim/vim#4657)

acf7544cf6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-10 23:35:10 -04:00
Jan Edmund Lazo
c9b35360ac vim-patch:8.1.1700: listener callback called for the wrong buffer
Problem:    Listener callback called for the wrong buffer.
Solution:   Invoke listeners before calling ml_append_int().

250e3112c6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-10 23:35:10 -04:00
Jan Edmund Lazo
83f38800e7 vim-patch:8.1.1681: insert stray "{" when listener gets buffer line
Problem:    Insert stray "{" when listener gets buffer line. (Paul Jolly)
Solution:   Flush the cached line after invoking listeners. (closes vim/vim#4455)

0fb286e82d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-10 22:22:44 -04:00
Jan Edmund Lazo
36fc266e86 vim-patch:8.1.0636: line2byte() gives wrong values with text properties
Problem:    line2byte() gives wrong values with text properties. (Bjorn Linse)
Solution:   Compute byte offsets differently when text properties were added.
            (closes vim/vim#3718)

b413d2e6a8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-10 22:22:44 -04:00
zeertzjq
03c953008c vim-patch:32d6bd6: runtime(doc): remove dead links (#35297)
related: vim/vim#17879

32d6bd6df2

N/A patch:
vim-patch:8b18345: runtime(doc): Fix 2 minor issues after 32d6bd6df

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-08-11 00:04:30 +00:00
zeertzjq
d2cdfc413b Merge pull request #35296 from zeertzjq/vim-7270a5a
vim-patch: runtime file updates
2025-08-11 07:23:43 +08:00
zeertzjq
39af96c8ef vim-patch:a94a055: runtime(python): Highlight f-string replacement fields in Python
Highlight f-string replacement fields, including

- Comments
- Debugging flags
- Conversion fields
- Format specifications
- Delimiters

Syntax inside fields will be addressed in a separate commit.

related: vim/vim#10734
related: vim/vim#14033
closes: vim/vim#17784

a94a0555d9

Co-authored-by: Rob B <github@0x7e.net>
2025-08-11 07:01:27 +08:00
zeertzjq
82a54a772b vim-patch:48b7eb1: runtime(python): Highlight classes as structures
Class and function definitions previously shared a single highlight
group (pythonFunction). This change gives classes their own highlight
group (pythonClass) that's linked to Structure.

closes: vim/vim#17856

48b7eb1ceb

Co-authored-by: Jon Parise <jon@indelible.org>
2025-08-11 07:00:50 +08:00
zeertzjq
d395dc9d38 vim-patch:7270a5a: runtime(racket): update Racket runtime files
This brings the upstream files to commit 9dc3bd3 (ftplugin: escape Vim
special characters when opening docs, 2025-08-09). Note that not all
upstream files are included.

closes: vim/vim#17956

7270a5a843

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2025-08-11 07:00:28 +08:00
Dietrich Moerman
47e3aecb78 vim-patch:9.1.1620: filetype: composer.lock and symfony.lock files not recognized (#35291)
Problem:  filetype: composer.lock and symfony.lock files not recognized
Solution: Detect composer.lock and symfony.lock files as json filetype
          (Dietrich Moerman)

closes: vim/vim#17945

4fca92faa2
2025-08-10 13:42:57 +00:00
zeertzjq
9d85f086d9 vim-patch:9.1.1622: Patch v9.1.1432 causes performance regressions (#35288)
Problem:  Patch v9.1.1432 causes performance regressions
Solution: Revert "patch 9.1.1432: GTK GUI: Buffer menu does not handle
          unicode correctly" (Yee Cheng Chin).

This reverts commit 08896dd330c6dc8324618fde482db968e6f71088.

The previous change to support Unicode characters properly in the
buffers menu resorted to removing all buffer menus and re-add the
buffers after doing a sort, per each buffer addition. This was quite
slow because if Vim is trying to load in multiple buffers at once (e.g.
when loading a session) this scales in O(n^2) and Vim can freeze for
dozens of seconds when adding a few hundred buffers.

related: vim/vim#17405
related: vim/vim#17928
fixes: vim/vim#17897

cda0d17f59

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-08-10 09:11:13 +00:00
zeertzjq
22d90217c6 vim-patch:partial:fc3c204: runtime(doc): Fix style and typos in builtin.txt and usr_41.txt (#35286)
- Reformat parts to fit into 80 column window.
- Fix example with mandatory call with a range.
  https://github.com/vim/vim/discussions/17950#discussioncomment-14055687
- Remove some duplicate information

closes: vim/vim#17949

fc3c204bbe

Function list changes only.

Co-authored-by: veotos <veotos@users.noreply.github.com>
2025-08-10 08:23:48 +00:00
zeertzjq
dae79f2b67 vim-patch:9.1.1619: Incorrect E535 error message (#35285)
Problem:  Incorrect E535 error message (after 9.1.1603).
Solution: Don't use transchar(), as the character is always printable
          (zeertzjq).

closes: vim/vim#17948

b362995430
2025-08-10 16:22:43 +08:00
zeertzjq
f0d8341984 vim-patch:9.1.1618: completion: incorrect selected index returned from complete_info() (#35284)
Problem:  completion: incorrect selected index returned from
          complete_info()
Solution: Return the index into "items" and restore the previous
          behaviour (Robert Muir).

complete_info() returned an incorrect selected index after
0ac1eb3555445f4c458c06cef7c411de1c8d1020 (Patch v9.1.1311). Effectively
it became an index into "matches" instead of "items". Return the index
into "items" by default to restore the previous behavior, unless
"matches" was requested.

closes: vim/vim#17952

8e2a229189

Co-authored-by: Robert Muir <rmuir@apache.org>
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-08-10 16:21:47 +08:00
bfredl
72969f1301 Merge pull request #35263 from bfredl/zig15
fix(build): remove deprecated aliases in build.zig removed for zig 0.15
2025-08-10 09:24:27 +02:00
zeertzjq
74511a98fd Merge pull request #35278 from zeertzjq/vim-9.1.1612
vim-patch:9.1.{1612,1613}
2025-08-10 09:05:41 +08:00
zeertzjq
9e8d551b1e vim-patch:9.1.1613: tests: test_search leaves a few swapfiles behind
Problem:  tests: test_search leaves a few swapfiles behind
Solution: Use :bw! instead of :close to close the swapfile at the end of
          the test.

related: vim/vim#17933

a2bb21a895

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-10 08:25:23 +08:00