Skip to content

Commit e9d9a81

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 15cd80a + 35cb38d commit e9d9a81

File tree

514 files changed

+25182
-4125
lines changed

Some content is hidden

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

514 files changed

+25182
-4125
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ indent_size = 2
2424
# https://spec.commonmark.org/0.31.2/#hard-line-breaks
2525
trim_trailing_whitespace = false
2626

27+
[*.vim]
28+
indent_style = space
29+
indent_size = 2
30+
31+
[runtime/pack/dist/opt/{comment,nohlsearch}/**.vim]
32+
indent_style = space
33+
indent_size = 4
34+
2735
[runtime/doc/**.txt]
2836
# It can mess up some documentation by trying to strip trailing whitespaces
2937
trim_trailing_whitespace = false

.github/MAINTAINERS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ runtime/ftplugin/pbtxt.vim @lakshayg
250250
runtime/ftplugin/pdf.vim @tpope
251251
runtime/ftplugin/perl.vim @petdance @dkearns
252252
runtime/ftplugin/php.vim @dkearns
253+
runtime/ftplugin/plsql.vim @lee-lindley
253254
runtime/ftplugin/pod.vim @petdance @dkearns
254255
runtime/ftplugin/poefilter.vim @ObserverOfTime
255256
runtime/ftplugin/postscr.vim @mrdubya
@@ -284,6 +285,7 @@ runtime/ftplugin/slint.vim @ribru17
284285
runtime/ftplugin/snakemake.vim @ribru17
285286
runtime/ftplugin/solidity.vim @cothi
286287
runtime/ftplugin/solution.vim @dkearns
288+
runtime/ftplugin/spajson.vim @dseomn
287289
runtime/ftplugin/spec.vim @ignatenkobrain
288290
runtime/ftplugin/squirrel.vim @ribru17
289291
runtime/ftplugin/ssa.vim @ObserverOfTime
@@ -295,6 +297,7 @@ runtime/ftplugin/systemverilog.vim @Kocha
295297
runtime/ftplugin/swig.vim @jmarrec
296298
runtime/ftplugin/tap.vim @petdance
297299
runtime/ftplugin/tcsh.vim @dkearns
300+
runtime/ftplugin/tera.vim @MuntasirSZN
298301
runtime/ftplugin/terraform.vim @JannoTjarks
299302
runtime/ftplugin/tf.vim @ribru17
300303
runtime/ftplugin/thrift.vim @jiangyinzuo
@@ -394,6 +397,7 @@ runtime/indent/scheme.vim @evhan
394397
runtime/indent/scss.vim @tpope
395398
runtime/indent/sh.vim @chrisbra
396399
runtime/indent/solidity.vim @cothi
400+
runtime/indent/spajson.vim @dseomn
397401
runtime/indent/systemverilog.vim @Kocha
398402
runtime/indent/tcl.vim @dkearns
399403
runtime/indent/tcsh.vim @dkearns
@@ -422,6 +426,7 @@ runtime/pack/dist/opt/nohlsearch/ @habamax
422426
runtime/plugin/manpager.vim @Konfekt
423427
runtime/syntax/shared/hgcommitDiff.vim @vegerot
424428
runtime/syntax/abaqus.vim @costerwi
429+
runtime/syntax/abnf.vim @A4-Tacks
425430
runtime/syntax/aidl.vim @dpelle
426431
runtime/syntax/ant.vim @dkearns
427432
runtime/syntax/antlr4.vim @jiangyinzuo
@@ -557,6 +562,7 @@ runtime/syntax/ninja.vim @nico
557562
runtime/syntax/nix.vim @equill
558563
runtime/syntax/nroff.vim @jmarshall
559564
runtime/syntax/nsis.vim @k-takata
565+
runtime/syntax/omnimark.vim @kennypete
560566
runtime/syntax/ondir.vim @jparise
561567
runtime/syntax/opencl.vim @Freed-Wu
562568
runtime/syntax/openvpn.vim @ObserverOfTime
@@ -574,6 +580,7 @@ runtime/syntax/postscr.vim @mrdubya
574580
runtime/syntax/privoxy.vim @dkearns
575581
runtime/syntax/progress.vim @rdnlsmith
576582
runtime/syntax/prolog.vim @XVilka
583+
runtime/syntax/prql.vim @vanillajonathan
577584
runtime/syntax/ps1.vim @heaths
578585
runtime/syntax/ps1xml.vim @heaths
579586
runtime/syntax/psl.vim @danielkho
@@ -605,6 +612,7 @@ runtime/syntax/sed.vim @dkearns
605612
runtime/syntax/shared/debversions.vim @jamessan
606613
runtime/syntax/shaderslang.vim @mTvare6
607614
runtime/syntax/solidity.vim @cothi
615+
runtime/syntax/spajson.vim @dseomn
608616
runtime/syntax/spec.vim @ignatenkobrain
609617
runtime/syntax/sqloracle.vim @chrisbra
610618
runtime/syntax/squirrel.vim @zenmatic
@@ -619,6 +627,7 @@ runtime/syntax/swig.vim @jmarrec
619627
runtime/syntax/systemverilog.vim @Kocha
620628
runtime/syntax/tap.vim @petdance
621629
runtime/syntax/tcsh.vim @dkearns
630+
runtime/syntax/tera.vim @MuntasirSZN
622631
runtime/syntax/teraterm.vim @k-takata
623632
runtime/syntax/terraform.vim @gpanders
624633
runtime/syntax/thrift.vim @jiangyinzuo

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ src/xxd/xxd
148148
src/xxd/xxd.dSYM
149149
src/a.out.dSYM
150150

151+
runtime/syntax/testdir/done/
152+
runtime/syntax/testdir/messages
153+
runtime/syntax/testdir/testdeps.mk
154+
runtime/syntax/testdir/vimcmd
155+
151156
# Generated by "make install"
152157
runtime/doc/doctags
153158
runtime/doc/tags-*

.hgignore

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,33 @@ src/json_test
9898
src/message_test
9999
src/kword_test
100100

101+
runtime/syntax/testdir/done/
102+
runtime/syntax/testdir/messages
103+
runtime/syntax/testdir/testdeps.mk
104+
runtime/syntax/testdir/vimcmd
105+
101106
# Generated by "make install"
102107
runtime/doc/doctags
103108
runtime/doc/tags-*
104109

110+
# Temporarily generated by "runtime/syntax/generator/make"
111+
runtime/syntax/generator/generator.err
112+
runtime/syntax/generator/sanity_check.err
113+
runtime/syntax/generator/vim.vim.rc
114+
105115
# Generated by "make shadow". The directory names could be anything but we
106116
# restrict them to shadow (the default) or shadow-*
107117
src/shadow
108118
src/shadow-*
109119
src/runtime
110120
src/pixmaps
121+
src/LICENSE
122+
src/README.txt
111123

112124
# other files possibly created by tools
113125
src/cscope.out
114126

115127
# Linter/language server files
116-
/.cache/clangd/
117-
/.ccls-cache/
118-
/compile_commands.json
128+
.cache/clangd/
129+
.ccls-cache/
130+
compile_commands.json

CONTRIBUTING.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,31 @@ Contributions will be distributed with Vim under the Vim license. Providing a
2121
change to be included implies that you agree with this and your contribution
2222
does not cause us trouble with trademarks or patents. There is no CLA to sign.
2323

24+
## Signing-off commits
25+
26+
While not required, it's recommended to use **Signed-off commits** to ensure
27+
transparency, accountability, and compliance with open-source best practices.
28+
Signed-off commits follow the [Developer Certificate of Origin (DCO)][15],
29+
which confirms that contributors have the right to submit their changes under
30+
the project's license. This process adds a `Signed-off-by` line to commit
31+
messages, verifying that the contributor agrees to the project's licensing
32+
terms. To sign off a commit, simply use the -s flag when committing:
33+
34+
```sh
35+
git commit -s
36+
```
37+
38+
This ensures that every contribution is properly documented and traceable,
39+
aligning with industry standards used in projects like the Linux Kernel or
40+
the git project. By making Signed-off commits a standard practice, we help
41+
maintain a legally compliant and well-governed codebase while fostering trust
42+
within our contributor community.
43+
44+
When merging PRs into Vim, the current maintainer @chrisbra usually adds missing
45+
`Signed-off-by` trailers for the author user name and email address as well for
46+
anybody that explicitly *ACK*s a pull request as a statement that those
47+
approvers are happy with that particular change.
48+
2449
# Reporting issues
2550

2651
We use GitHub issues, but that is not a requirement. Writing to the Vim
@@ -113,3 +138,4 @@ mailing list. For other questions please use the [Vi Stack Exchange][8] website,
113138
[12]: https://github.com/vim/vim/blob/master/src/testdir/test_filetype.vim
114139
[13]: https://github.com/vim/vim/blob/master/runtime/doc/filetype.txt
115140
[14]: https://github.com/vim/vim/blob/master/runtime/doc/syntax.txt
141+
[15]: https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin

Filelist

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ SRC_ALL = \
157157
src/textobject.c \
158158
src/textprop.c \
159159
src/time.c \
160+
src/tuple.c \
160161
src/typval.c \
161162
src/ui.c \
162163
src/undo.c \
@@ -223,6 +224,7 @@ SRC_ALL = \
223224
src/testdir/samples/*.html \
224225
src/testdir/samples/*.txt \
225226
src/testdir/samples/*.vim \
227+
src/testdir/samples/poc.zip \
226228
src/testdir/samples/test000 \
227229
src/testdir/samples/test.zip \
228230
src/testdir/samples/test_undo.txt.undo \
@@ -338,6 +340,7 @@ SRC_ALL = \
338340
src/proto/textobject.pro \
339341
src/proto/textprop.pro \
340342
src/proto/time.pro \
343+
src/proto/tuple.pro \
341344
src/proto/typval.pro \
342345
src/proto/ui.pro \
343346
src/proto/undo.pro \
@@ -771,16 +774,16 @@ RT_ALL = \
771774
runtime/tools/[a-z]*[a-z0-9] \
772775
runtime/tutor/README.txt \
773776
runtime/tutor/tutor1 \
777+
runtime/tutor/tutor1.utf-8 \
774778
runtime/tutor/en/vim-01-beginner.tutor \
775779
runtime/tutor/en/vim-01-beginner.tutor.json \
776-
runtime/tutor/it/vim-01-beginner.tutor \
777-
runtime/tutor/it/vim-01-beginner.tutor.json \
778-
runtime/tutor/sr/vim-01-beginner.tutor \
779-
runtime/tutor/sr/vim-01-beginner.tutor.json \
780+
runtime/tutor/en/vim-02-beginner.tutor \
781+
runtime/tutor/en/vim-02-beginner.tutor.json \
780782
runtime/tutor/tutor.tutor \
781783
runtime/tutor/tutor.tutor.json \
782784
runtime/tutor/tutor.vim \
783785
runtime/tutor/tutor2 \
786+
runtime/tutor/tutor2.utf-8 \
784787
runtime/vimrc_example.vim \
785788
runtime/pack/dist/opt/cfilter/plugin/cfilter.vim \
786789
runtime/pack/dist/opt/comment/plugin/comment.vim \
@@ -804,6 +807,7 @@ RT_ALL = \
804807
runtime/pack/dist/opt/editorconfig/plugin/editorconfig.vim \
805808
runtime/pack/dist/opt/helptoc/autoload/helptoc.vim \
806809
runtime/pack/dist/opt/helptoc/plugin/helptoc.vim \
810+
runtime/pack/dist/opt/hlyank/plugin/hlyank.vim \
807811
runtime/pack/dist/opt/justify/plugin/justify.vim \
808812
runtime/pack/dist/opt/matchit/plugin/matchit.vim \
809813
runtime/pack/dist/opt/matchit/doc/matchit.txt \
@@ -1077,7 +1081,16 @@ LANG_GEN = \
10771081
runtime/tutor/README.*.txt \
10781082
runtime/tutor/Makefile \
10791083
runtime/tutor/Make_all.mak \
1080-
runtime/tutor/tutor1.utf-8 \
1084+
runtime/tutor/it/vim-01-beginner.tutor \
1085+
runtime/tutor/it/vim-01-beginner.tutor.json \
1086+
runtime/tutor/ru/vim-01-beginner.tutor \
1087+
runtime/tutor/ru/vim-01-beginner.tutor.json \
1088+
runtime/tutor/ru/vim-02-beginner.tutor \
1089+
runtime/tutor/ru/vim-02-beginner.tutor.json \
1090+
runtime/tutor/sr/vim-01-beginner.tutor \
1091+
runtime/tutor/sr/vim-01-beginner.tutor.json \
1092+
runtime/tutor/sr/vim-02-beginner.tutor \
1093+
runtime/tutor/sr/vim-02-beginner.tutor.json \
10811094
runtime/tutor/tutor1.?? \
10821095
runtime/tutor/tutor1.??.utf-8 \
10831096
runtime/tutor/tutor1.??.euc \
@@ -1090,7 +1103,6 @@ LANG_GEN = \
10901103
runtime/tutor/tutor1.??_??.utf-8 \
10911104
runtime/tutor/tutor1.bar \
10921105
runtime/tutor/tutor1.bar.utf-8 \
1093-
runtime/tutor/tutor2.utf-8 \
10941106
runtime/tutor/tutor2.?? \
10951107
runtime/tutor/tutor2.??.utf-8 \
10961108
runtime/spell/README.txt \

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ VIM_FOR_SYNTAXTEST = ../../src/vim
6363

6464
# (For local testing only with GNU Make.)
6565
VIM_SYNTAX_TEST_FILTER =
66+
VIM_SYNTAX_TEST_WAIT_TIME =
6667

6768
syntaxtest:
6869
cd runtime/syntax && \

runtime/autoload/dist/man.vim

Lines changed: 87 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
" Autoload Split: Bram Moolenaar
66
" Last Change: 2024 Jan 17 (make it work on AIX, see #13847)
77
" 2024 Jul 06 (honor command modifiers, #15117)
8+
" 2025 Mar 05 (add :keepjumps, #16791)
9+
" 2025 Mar 09 (improve :Man completion for man-db, #16843)
810

911
let s:cpo_save = &cpo
1012
set cpo-=C
@@ -34,6 +36,88 @@ endtry
3436

3537
unlet! uname_s
3638

39+
let s:man_db_pages_by_section = v:null
40+
func! s:ManDbPagesBySection() abort
41+
if s:man_db_pages_by_section isnot v:null
42+
return s:man_db_pages_by_section
43+
endif
44+
let s:man_db_pages_by_section = {}
45+
let list_command = 'apropos --long .'
46+
let unparsed_lines = []
47+
for line in systemlist(list_command)
48+
" Typical lines:
49+
" vim (1) - Vi IMproved, a programmer's text editor
50+
"
51+
" Unusual lines:
52+
" pgm_read_ T _ (3avr) - (unknown subject)
53+
"
54+
" Code that shows the line's format:
55+
" https://gitlab.com/man-db/man-db/-/blob/2607d203472efb036d888e9e7997724a41a53876/src/whatis.c#L409
56+
let match = matchlist(line, '^\(.\{-1,}\) (\(\S\+\)) ')
57+
if empty(match)
58+
call add(unparsed_lines, line)
59+
continue
60+
endif
61+
let [page, section] = match[1:2]
62+
if !has_key(s:man_db_pages_by_section, section)
63+
let s:man_db_pages_by_section[section] = []
64+
endif
65+
call add(s:man_db_pages_by_section[section], page)
66+
endfor
67+
if !empty(unparsed_lines)
68+
echomsg 'Unable to parse ' .. string(len(unparsed_lines)) .. ' lines ' ..
69+
\ 'from the output of `' .. list_command .. '`. Example lines:'
70+
for line in unparsed_lines[:9]
71+
echomsg line
72+
endfor
73+
endif
74+
return s:man_db_pages_by_section
75+
endfunc
76+
77+
func! dist#man#Reload() abort
78+
if g:ft_man_implementation ==# 'man-db'
79+
let s:man_db_pages_by_section = v:null
80+
call s:ManDbPagesBySection()
81+
endif
82+
endfunc
83+
84+
func! s:StartsWithCaseInsensitive(haystack, needle) abort
85+
if empty(a:needle)
86+
return v:true
87+
endif
88+
return a:haystack[:len(a:needle)-1] ==? a:needle
89+
endfunc
90+
91+
func! dist#man#ManDbComplete(arg_lead, cmd_line, cursor_pos) abort
92+
let args = split(trim(a:cmd_line[: a:cursor_pos - 1], '', 1), '', v:true)
93+
let pages_by_section = s:ManDbPagesBySection()
94+
if len(args) > 2
95+
" Page in the section args[1]. At least on Debian testing as of
96+
" 2025-03-06, man seems to match sections case-insensitively and match any
97+
" prefix of the section. E.g., `man 3 sigprocmask` and `man 3PoSi
98+
" sigprocmask` with both load sigprocmask(3posix) even though the 3 in the
99+
" first command is also the name of a different section.
100+
let results = []
101+
for [section, pages] in items(pages_by_section)
102+
if s:StartsWithCaseInsensitive(section, args[1])
103+
call extend(results, pages)
104+
endif
105+
endfor
106+
else
107+
" Could be a section, or a page in any section. Add space after sections
108+
" since there has to be a second argument in that case.
109+
let results = flattennew(values(pages_by_section), 1)
110+
for section in keys(pages_by_section)
111+
call add(results, section .. ' ')
112+
endfor
113+
endif
114+
call sort(results)
115+
call uniq(results)
116+
call filter(results,
117+
\ {_, val -> s:StartsWithCaseInsensitive(val, a:arg_lead)})
118+
return results
119+
endfunc
120+
37121
func s:ParseIntoPageAndSection()
38122
" Accommodate a reference that terminates in a hyphen.
39123
"
@@ -188,7 +272,7 @@ func dist#man#GetPage(cmdmods, ...)
188272
setl buftype=nofile noswapfile
189273

190274
setl fdc=0 ma nofen nonu nornu
191-
%delete _
275+
keepjumps %delete _
192276
let unsetwidth = 0
193277
if empty($MANWIDTH)
194278
let $MANWIDTH = winwidth(0)
@@ -218,10 +302,10 @@ func dist#man#GetPage(cmdmods, ...)
218302
endif
219303
" Remove blank lines from top and bottom.
220304
while line('$') > 1 && getline(1) =~ '^\s*$'
221-
1delete _
305+
keepjumps 1delete _
222306
endwhile
223307
while line('$') > 1 && getline('$') =~ '^\s*$'
224-
$delete _
308+
keepjumps $delete _
225309
endwhile
226310
1
227311
setl ft=man nomod

runtime/autoload/zip.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
" 2024 Aug 05 by Vim Project: clean-up and make it work with shellslash on Windows
1515
" 2024 Aug 18 by Vim Project: correctly handle special globbing chars
1616
" 2024 Aug 21 by Vim Project: simplify condition to detect MS-Windows
17+
" 2025 Mar 11 by Vim Project: handle filenames with leading '-' correctly
1718
" License: Vim License (see vim's :help license)
1819
" Copyright: Copyright (C) 2005-2019 Charles E. Campbell {{{1
1920
" Permission is hereby granted to use and distribute this code,
@@ -343,6 +344,11 @@ fun! zip#Extract()
343344
return
344345
endif
345346
let target = fname->substitute('\[', '[[]', 'g')
347+
" unzip 6.0 does not support -- to denote end-of-arguments
348+
" unzip 6.1 (2010) apparently supports, it, but hasn't been released
349+
" so the workaround is to use glob '[-]' so that it won't be considered an argument
350+
" else, it would be possible to use 'unzip -o <file.zip> '-d/tmp' to extract the whole archive
351+
let target = target->substitute('^-', '[&]', '')
346352
if &shell =~ 'cmd' && has("win32")
347353
let target = target
348354
\ ->substitute('[?*]', '[&]', 'g')

0 commit comments

Comments
 (0)