Skip to content

[pull] master from vim:master#589

Merged
pull[bot] merged 11 commits intoMu-L:masterfrom
vim:master
Nov 20, 2025
Merged

[pull] master from vim:master#589
pull[bot] merged 11 commits intoMu-L:masterfrom
vim:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull bot commented Nov 20, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

harrystevens4 and others added 11 commits November 18, 2025 20:50
closes: #18763

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Harry <166658338+harrystevens4@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
closes: #18775

Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
…wing

Problem:  tests: not enough testing for wildtrigger() pum redrawing.
Solution: Also test redrawing when leaving cmdline mode (zeertzjq).

closes: #18773

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem:  xdiff: included xdiff code is outdated because it is based on
          git 2.40.0
Solution: Sync with xdiff from git 2.52 (Yee Cheng Chin).

Git [v2.52](https://github.com/git/git/releases/tag/v2.52.0) has just been
released. Merge from upstream to get the latest version of xdiff. Vim's xdiff
was last updated in #12181 (Patch v9.0.1418) from Git v2.33 to v2.40.

I have refined the strategy for merging from upstream a bit compared to last
time. I use the following commands to create an orphaned branch that extracts
the before/after xdiff source code from the Git codebase, and then perform a
subtree merge. The commits in the orphaned branch are reproducible
deterministically so a reviewer can reproduce the steps and it should result in
identical commit hashes (63264f2 and d741f0e). The commands are as
follows (you could run in a separate Vim repo to keep things clean):

```bash
git remote add --no-tags git https://github.com/git/git.git
git fetch git

git switch --orphan xdiff-orig
git read-tree --reset -u 73876f4861:xdiff/  # Git v2.40.0
git rm -f xmerge.c                          # Vim doesn't use xmerge
(GIT_COMMITTER_NAME="dummy" GIT_COMMITTER_EMAIL="dummy" GIT_COMMITTER_DATE="1600000000 +0000" \
  git commit --no-gpg-sign --reuse-message=73876f4861)

git switch -c xdiff-new
git read-tree --reset -u 9a2fb147f2:xdiff/  # Git v2.52.0
git rm -f xmerge.c
(GIT_COMMITTER_NAME="dummy" GIT_COMMITTER_EMAIL="dummy" GIT_COMMITTER_DATE="1600000000 +0000" \
  git commit --no-gpg-sign --reuse-message=9a2fb147f2)

git switch master
git switch -c xdiff-upstream-v2.52.0
git merge -s ours --no-edit --allow-unrelated-histories xdiff-orig
git merge -Xsubtree=xdiff xdiff-new
```

The commit graph looks like so:

```
* a005e26 2025-11-17 17:11:26 Yee Cheng Chin (HEAD -> xdiff-upstream-v2.52.0) Update xdiff README
*   d353c6f 2025-11-17 16:26:15 Yee Cheng Chin Merge branch 'xdiff-new' into xdiff-upstream-v2.52.0
|\
| * d741f0e 2025-11-17 07:35:33 Junio C Hamano (xdiff-new) Git 2.52
* | c4f8b15 2025-11-17 16:22:30 Yee Cheng Chin Merge branch 'xdiff-orig' into xdiff-upstream-v2.52.0
|\|
| * 63264f2 2023-03-12 14:34:41 Junio C Hamano (xdiff-orig) Git 2.40
* 6437997 2025-11-16 18:30:42 Girish Palya   (tag: v9.1.1918, origin/master, origin/HEAD, master) patch 9.1.1918: completion: crash with fuzzy completion
```

For reviewing I recommend using the following commands which simplifies the diff to only what we care about:
- `git show --remerge-diff d353c6f`: This shows how my merge actually
  resolved the merge conflicts.
- `vimdiff <(git diff-tree -U0 63264f2 master:src/xdiff/) \
   <(git diff-tree -U0 d741f0e xdiff-upstream-v2.52.0:src/xdiff) \
   -c "silent windo %s/^index.*/index/" \
   -c "silent windo %s/^@@ [-+, 0-9]* @@/@@/"`:
This shows how the patch (downstream changes done in Vim on top of Git) has
changed. Note that some local changes for fixing compiler warnings are now gone
because they are fixed upstream.

- git/git@d39e28e
  added a dependency (`signed_add_overflows`) to Git code base. I replaced it
  with a custom one since it's not hard to implement.
- Upstream had fixed a lot of compiler warnings with signed/unsigned integers,
  so the compiler warning fixes that were done in Vim downstream were removed.
- Replace new `BUG()` calls with `xdl_bug()` where we use Vim's assertion
  mechanisms instead.

- Performance improvement due to optimizations in the line hashing function
  (git/git@41d9783 and
   git/git@a4bbe8a).
  - From personal unscientific testing (Apple M1 Max, macOS 15), when using the
    new xdiff, for simple/normal diff's this could result in **11%/29%** overall
    diff speed improvement. For larger more pathologically complicated diff this
    results in a more modest **4%/7%** improvement.
  - The two improvement numbers above are for compiling Vim with `-O3 -flto` vs
    `-O2`. The more optimized version of Vim results in lower performance
    improvement as it was already doing inlining via link-time-optimization
    before.
  - Just for reference, the command I used to test this was the following (use
    either test case and comment out the other one):
    ```bash
    # Simple/normal diff test case
    (COMMIT=0d9160e11ce; git show ${COMMIT}:src/diff.c > test1.txt; git show ${COMMIT}~:src/diff.c > test2.txt)
    # Larger diff test case
    (COMMIT=9670f61d468; git show ${COMMIT}:src/auto/configure > test1.txt; git show ${COMMIT}~:src/auto/configure > test2.txt)

    # Build Vim with old/new xdiff, then copy ./src/vim to ./src/vim_orig / ./src/vim_new respectively.
    hyperfine --warmup 4 --runs 20 -L vimcmd vim_orig,vim_new \
        "./src/{vimcmd} -u NONE -U NONE -es -V1 -c \"let g:f1=readfile('test1.txt')\" -c \"let g:f2=readfile('test2.txt')\" -c \"for i in range(1,200) | call diff(g:f1, g:f2) | endfor\" -c 'q'"
    ```

closes: #18765

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem:  Wrong virtcol('$') with virtual text at EOL (rickhowe).
Solution: Also add 1 to end virtcol when there is virtual text.
          (zeertzjq)

fixes: #18761
closes: #18762

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #18776

Signed-off-by: Mirek Kratochvil <exa.exa@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
fixes: #18739 (editor hang on mixed syntax style)
closes: #18758

Signed-off-by: John Wellesz <john.wellesz@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #18754

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Match full :debug, :breakadd, :breakdel and :breaklist commands.

closes: #18748

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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 76b92b2 (tag: v7.0b).

closes: #18757

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #18731

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
@pull pull bot locked and limited conversation to collaborators Nov 20, 2025
@pull pull bot added the ⤵️ pull label Nov 20, 2025
@pull pull bot merged commit a08030c into Mu-L:master Nov 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants