Skip to content

Commit 00042fe

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 9779bf9 + ee86524 commit 00042fe

File tree

733 files changed

+6718
-3003
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

733 files changed

+6718
-3003
lines changed

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ freebsd_task:
2323
- sudo -u cirrus make test
2424
on_failure:
2525
test_artifacts:
26-
name: "Cirrus-CI-freebsd-failed-tests"
26+
name: "Cirrus-${CIRRUS_BUILD_ID}-freebsd-failed-tests"
2727
path: |
2828
runtime/indent/testdir/*.fail
2929
runtime/syntax/testdir/failed/*

.github/actions/test_artifacts/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ runs:
77
uses: actions/upload-artifact@v4
88
with:
99
# Name of the artifact to upload.
10-
name: ${{ github.workflow }}-${{ github.job }}-${{ join(matrix.*, '-') }}-failed-tests
10+
name: GH-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}-${{ join(matrix.*, '-') }}-failed-tests
1111

1212
# A file, directory or wildcard pattern that describes what
1313
# to upload.

runtime/autoload/ccomplete.vim

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ vim9script noclear
33
# Vim completion script
44
# Language: C
55
# Maintainer: The Vim Project <https://github.com/vim/vim>
6-
# Last Change: 2024 Jun 06
6+
# Last Change: 2025 Jul 24
77
# Rewritten in Vim9 script by github user lacygoill
88
# Former Maintainer: Bram Moolenaar <[email protected]>
99

@@ -121,6 +121,10 @@ export def Complete(findstart: bool, abase: string): any # {{{1
121121
endif
122122
endwhile
123123

124+
if complete_check()
125+
return v:none
126+
endif
127+
124128
# Find the variable items[0].
125129
# 1. in current function (like with "gd")
126130
# 2. in tags file(s) (like with ":tag")
@@ -135,6 +139,9 @@ export def Complete(findstart: bool, abase: string): any # {{{1
135139
# Handle multiple declarations on the same line.
136140
var col2: number = col - 1
137141
while line[col2] != ';'
142+
if complete_check()
143+
return res
144+
endif
138145
--col2
139146
endwhile
140147
line = line[col2 + 1 :]
@@ -145,6 +152,9 @@ export def Complete(findstart: bool, abase: string): any # {{{1
145152
# declaration.
146153
var col2: number = col - 1
147154
while line[col2] != ','
155+
if complete_check()
156+
return res
157+
endif
148158
--col2
149159
endwhile
150160
if line[col2 + 1 : col - 1] =~ ' *[^ ][^ ]* *[^ ]'
@@ -215,6 +225,9 @@ export def Complete(findstart: bool, abase: string): any # {{{1
215225

216226
res = []
217227
for i: number in len(diclist)->range()
228+
if complete_check()
229+
return res
230+
endif
218231
# New ctags has the "typeref" field. Patched version has "typename".
219232
if diclist[i]->has_key('typename')
220233
res = res->extend(diclist[i]['typename']->StructMembers(items[1 :], true))
@@ -246,6 +259,9 @@ export def Complete(findstart: bool, abase: string): any # {{{1
246259
var last: number = len(items) - 1
247260
var brackets: string = ''
248261
while last >= 0
262+
if complete_check()
263+
return res
264+
endif
249265
if items[last][0] != '['
250266
break
251267
endif
@@ -311,6 +327,9 @@ def Dict2info(dict: dict<any>): string # {{{1
311327
# Use all the items in dictionary for the "info" entry.
312328
var info: string = ''
313329
for k: string in dict->keys()->sort()
330+
if complete_check()
331+
return info
332+
endif
314333
info ..= k .. repeat(' ', 10 - strlen(k))
315334
if k == 'cmd'
316335
info ..= dict['cmd']
@@ -346,6 +365,9 @@ def ParseTagline(line: string): dict<any> # {{{1
346365
endwhile
347366
endif
348367
for i: number in range(n + 1, len(l) - 1)
368+
if complete_check()
369+
return d
370+
endif
349371
if l[i] == 'file:'
350372
d['static'] = 1
351373
elseif l[i] !~ ':'
@@ -441,6 +463,9 @@ def Nextitem( # {{{1
441463
# Try to recognize the type of the variable. This is rough guessing...
442464
var res: list<dict<string>>
443465
for tidx: number in len(tokens)->range()
466+
if complete_check()
467+
return res
468+
endif
444469

445470
# Skip tokens starting with a non-ID character.
446471
if tokens[tidx] !~ '^\h'
@@ -467,6 +492,11 @@ def Nextitem( # {{{1
467492
# Use the tags file to find out if this is a typedef.
468493
var diclist: list<dict<any>> = taglist('^' .. tokens[tidx] .. '$')
469494
for tagidx: number in len(diclist)->range()
495+
496+
if complete_check()
497+
return res
498+
endif
499+
470500
var item: dict<any> = diclist[tagidx]
471501

472502
# New ctags has the "typeref" field. Patched version has "typename".
@@ -559,6 +589,9 @@ def StructMembers( # {{{1
559589
endif
560590
if !cached
561591
while 1
592+
if complete_check()
593+
return []
594+
endif
562595
execute 'silent! keepjumps noautocmd '
563596
.. n .. 'vimgrep ' .. '/\t' .. typename .. '\(\t\|$\)/j '
564597
.. fnames
@@ -581,6 +614,9 @@ def StructMembers( # {{{1
581614
var idx: number = 0
582615
var target: string
583616
while 1
617+
if complete_check()
618+
return []
619+
endif
584620
if idx >= len(items)
585621
target = '' # No further items, matching all members
586622
break
@@ -619,6 +655,9 @@ def StructMembers( # {{{1
619655
# Skip over next [...] items
620656
++idx
621657
while 1
658+
if complete_check()
659+
return matches
660+
endif
622661
if idx >= len(items)
623662
return matches # No further items, return the result.
624663
endif
@@ -646,6 +685,9 @@ def SearchMembers( # {{{1
646685
# When "all" is true find all, otherwise just return 1 if there is any member.
647686
var res: list<dict<string>>
648687
for i: number in len(matches)->range()
688+
if complete_check()
689+
return res
690+
endif
649691
var typename: string = ''
650692
var line: string
651693
if matches[i]->has_key('dict')

runtime/autoload/dist/vimindent.vim

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@ vim9script
22

33
# Language: Vim script
44
# Maintainer: github user lacygoill
5-
# Last Change: 2025 Apr 13
5+
# Last Change: 2025 Jul 25
66
#
77
# Includes changes from The Vim Project:
8-
# - 2024 Feb 09: Fix indent after literal Dict (A. Radev via #13966)
9-
# - 2024 Nov 08: Fix indent after :silent! function (D. Kearns via #16009)
10-
# - 2024 Dec 26: Fix indent for enums (Jim Zhou via #16293)
118

129
# NOTE: Whenever you change the code, make sure the tests are still passing:
1310
#
@@ -23,9 +20,8 @@ def IndentMoreInBracketBlock(): number # {{{2
2320
if get(g:, 'vim_indent', {})
2421
->get('more_in_bracket_block', false)
2522
return shiftwidth()
26-
else
27-
return 0
2823
endif
24+
return 0
2925
enddef
3026

3127
def IndentMoreLineContinuation(): number # {{{2
@@ -35,9 +31,8 @@ def IndentMoreLineContinuation(): number # {{{2
3531

3632
if n->typename() == 'string'
3733
return n->eval()
38-
else
39-
return n
4034
endif
35+
return n
4136
enddef
4237
# }}}2
4338

@@ -145,7 +140,7 @@ const HEREDOC_OPERATOR: string = '\s=<<\s\@=\%(\s\+\%(trim\|eval\)\)\{,2}'
145140

146141
# A better regex would be:
147142
#
148-
# [^-+*/%.:# \t[:alnum:]\"|]\@=.\|->\@!\%(=\s\)\@!\|[+*/%]\%(=\s\)\@!
143+
# [^-+*/%.:#[:blank:][:alnum:]\"|]\|->\@!\%(=\s\)\@!\|[+*/%]\%(=\s\)\@!
149144
#
150145
# But sometimes, it can be too costly and cause `E363` to be given.
151146
const PATTERN_DELIMITER: string = '[-+*/%]\%(=\s\)\@!'
@@ -193,10 +188,9 @@ const MODIFIERS: dict<string> = {
193188
patterns =<< trim eval END
194189
argdo\>!\=
195190
bufdo\>!\=
196-
cdo\>!\=
191+
[cl]f\=do\>!\=
197192
folddoc\%[losed]\>
198193
foldd\%[oopen]\>
199-
ldo\=\>!\=
200194
tabdo\=\>
201195
windo\>
202196
au\%[tocmd]\>!\=.*
@@ -290,9 +284,9 @@ patterns = []
290284
for kwds: list<string> in BLOCKS
291285
for kwd: string in kwds[0 : -2]
292286
if MODIFIERS->has_key(kwd->Unshorten())
293-
patterns += [$'\%({MODIFIERS[kwd]}\)\={kwd}']
287+
patterns->add($'\%({MODIFIERS[kwd]}\)\={kwd}')
294288
else
295-
patterns += [kwd]
289+
patterns->add(kwd)
296290
endif
297291
endfor
298292
endfor
@@ -348,7 +342,8 @@ patterns =<< trim eval END
348342
{'\'}<argd\%[elete]\s\+\*\s*$
349343
\<[lt]\=cd!\=\s\+-\s*$
350344
\<norm\%[al]!\=\s*\S\+$
351-
\%(\<sil\%[ent]!\=\s\+\)\=\<[nvxsoilct]\=\%(nore\|un\)map!\=\s
345+
\%(\<sil\%[ent]!\=\s\+\)\=\<[nvxsoilct]\=\%(nore\|un\)\=map!\=\s
346+
\<set\%(\%[global]\|\%[local]\)\>.*,$
352347
{PLUS_MINUS_COMMAND}
353348
END
354349

@@ -430,6 +425,9 @@ export def Expr(lnum = v:lnum): number # {{{2
430425
elseif line_A.lnum->IsRightBelow('HereDoc')
431426
var ind: number = b:vimindent.startindent
432427
unlet! b:vimindent
428+
if line_A.text =~ ENDS_BLOCK_OR_CLAUSE
429+
return ind - shiftwidth()
430+
endif
433431
return ind
434432
endif
435433

@@ -444,9 +442,8 @@ export def Expr(lnum = v:lnum): number # {{{2
444442
if line_A.text =~ BACKSLASH_AT_SOL
445443
if line_B.text =~ BACKSLASH_AT_SOL
446444
return Indent(line_B.lnum)
447-
else
448-
return Indent(line_B.lnum) + IndentMoreLineContinuation()
449445
endif
446+
return Indent(line_B.lnum) + IndentMoreLineContinuation()
450447
endif
451448

452449
if line_A->AtStartOf('FuncHeader')
@@ -459,9 +456,8 @@ export def Expr(lnum = v:lnum): number # {{{2
459456
unlet! b:vimindent
460457
if line_A.text =~ ENDS_FUNCTION
461458
return startindent
462-
else
463-
return startindent + shiftwidth()
464459
endif
460+
return startindent + shiftwidth()
465461
endif
466462

467463
var past_bracket_block: dict<any>
@@ -542,8 +538,9 @@ export def Expr(lnum = v:lnum): number # {{{2
542538

543539
if line_B.text =~ STARTS_CURLY_BLOCK
544540
return Indent(line_B.lnum) + shiftwidth() + IndentMoreInBracketBlock()
541+
endif
545542

546-
elseif line_A.text =~ CLOSING_BRACKET_AT_SOL
543+
if line_A.text =~ CLOSING_BRACKET_AT_SOL
547544
var start: number = MatchingOpenBracket(line_A)
548545
if start <= 0
549546
return -1
@@ -565,9 +562,8 @@ export def Expr(lnum = v:lnum): number # {{{2
565562
var block_start: number = SearchPairStart(start, middle, end)
566563
if block_start > 0
567564
return Indent(block_start)
568-
else
569-
return -1
570565
endif
566+
return -1
571567
endif
572568

573569
var base_ind: number
@@ -591,8 +587,7 @@ export def Expr(lnum = v:lnum): number # {{{2
591587
endif
592588
endif
593589

594-
var ind: number = base_ind + Offset(line_A, line_B)
595-
return [ind, 0]->max()
590+
return base_ind + Offset(line_A, line_B)
596591
enddef
597592

598593
def g:GetVimIndent(): number # {{{2
@@ -611,29 +606,31 @@ def Offset( # {{{2
611606
if line_B->AtStartOf('FuncHeader')
612607
&& IsInInterface()
613608
return 0
609+
endif
614610

615611
# increase indentation inside a block
616-
elseif line_B.text =~ STARTS_NAMED_BLOCK
612+
if line_B.text =~ STARTS_NAMED_BLOCK
617613
|| line_B->EndsWithCurlyBlock()
618614
# But don't indent if the line starting the block also closes it.
619615
if line_B->AlsoClosesBlock()
620616
return 0
617+
endif
621618
# Indent twice for a line continuation in the block header itself, so that
622619
# we can easily distinguish the end of the block header from the start of
623620
# the block body.
624-
elseif (line_B->EndsWithLineContinuation()
621+
if (line_B->EndsWithLineContinuation()
625622
&& !line_A.isfirst)
626623
|| (line_A.text =~ LINE_CONTINUATION_AT_SOL
627624
&& line_A.text !~ PLUS_MINUS_COMMAND)
628625
|| line_A.text->Is_IN_KeywordForLoop(line_B.text)
629626
return 2 * shiftwidth()
630-
else
631-
return shiftwidth()
632627
endif
628+
return shiftwidth()
629+
endif
633630

634631
# increase indentation of a line if it's the continuation of a command which
635632
# started on a previous line
636-
elseif !line_A.isfirst
633+
if !line_A.isfirst
637634
&& (line_B->EndsWithLineContinuation()
638635
|| line_A.text =~ LINE_CONTINUATION_AT_SOL)
639636
&& !(line_B->EndsWithComma() && line_A.lnum->IsInside('EnumBlock'))
@@ -653,12 +650,11 @@ def HereDocIndent(line_A: string): number # {{{2
653650
# will need to be indented relative to the start of the heredoc. It
654651
# must know where it starts; it needs the cache.
655652
return 0
656-
else
657-
var ind: number = b:vimindent.startindent
658-
# invalidate the cache so that it's not used for the next heredoc
659-
unlet! b:vimindent
660-
return ind
661653
endif
654+
var ind: number = b:vimindent.startindent
655+
# invalidate the cache so that it's not used for the next heredoc
656+
unlet! b:vimindent
657+
return ind
662658
endif
663659

664660
# In a non-trimmed heredoc, all of leading whitespace is semantic.
@@ -700,7 +696,7 @@ def HereDocIndent(line_A: string): number # {{{2
700696
b:vimindent.startindent = new_startindent
701697
endif
702698

703-
return [0, Indent(v:lnum) + b:vimindent.offset]->max()
699+
return Indent(v:lnum) + b:vimindent.offset
704700
enddef
705701

706702
def CommentIndent(): number # {{{2
@@ -727,9 +723,8 @@ def CommentIndent(): number # {{{2
727723
endif
728724
if getline(next) =~ ENDS_BLOCK
729725
return ind + shiftwidth()
730-
else
731-
return ind
732726
endif
727+
return ind
733728
enddef
734729

735730
def BracketBlockIndent(line_A: dict<any>, block: dict<any>): number # {{{2

runtime/doc/builtin.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim version 9.1. Last change: 2025 Jul 21
1+
*builtin.txt* For Vim version 9.1. Last change: 2025 Jul 22
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -12370,7 +12370,7 @@ wildtrigger() *wildtrigger()*
1237012370
produce a beep when no matches are found and generally
1237112371
operates more quietly. This makes it suitable for triggering
1237212372
completion automatically, such as from an |:autocmd|.
12373-
*cmdline-autocompletion*
12373+
*cmdline-autocompletion*
1237412374
Example: To make the completion menu pop up automatically as
1237512375
you type on the command line, use: >
1237612376
autocmd CmdlineChanged [:/?] call wildtrigger()

0 commit comments

Comments
 (0)