Skip to content

Commit 4c7c622

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents ca76060 + 3aa1144 commit 4c7c622

Some content is hidden

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

109 files changed

+6793
-2993
lines changed

.cirrus.yml

Lines changed: 23 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,23 @@
1-
env:
2-
CIRRUS_CLONE_DEPTH: 3
3-
FEATURES: huge
4-
5-
freebsd_task:
6-
name: FreeBSD
7-
matrix:
8-
- name: FreeBSD 14.0
9-
freebsd_instance:
10-
image_family: freebsd-14-0
11-
- name: FreeBSD 13.1
12-
freebsd_instance:
13-
image_family: freebsd-13-1
14-
timeout_in: 20m
15-
install_script:
16-
- pkg install -y gettext
17-
build_script:
18-
- NPROC=$(getconf _NPROCESSORS_ONLN)
19-
- ./configure --with-features=${FEATURES}
20-
- make -j${NPROC}
21-
test_script:
22-
- src/vim --version
23-
# run tests as user "cirrus" instead of root
24-
- pw useradd cirrus -m
25-
- chown -R cirrus:cirrus .
26-
- sudo -u cirrus make test
27-
28-
macos_task:
29-
name: macOS m1
30-
macos_instance:
31-
image: ghcr.io/cirruslabs/macos-ventura-xcode:latest
32-
env:
33-
# only run with clang, gcc is not real, it is a link to clang
34-
CC: clang
35-
timeout_in: 20m
36-
install_script:
37-
- brew update
38-
- brew install gettext libtool diffutils
39-
build_script:
40-
- NPROC=$(getconf _NPROCESSORS_ONLN)
41-
- ./configure --with-features=${FEATURES}
42-
- make -j${NPROC}
43-
test_script:
44-
- src/vim --version
45-
- make test
1+
#env:
2+
# CIRRUS_CLONE_DEPTH: 3
3+
# FEATURES: huge
4+
#
5+
#freebsd_task:
6+
# name: FreeBSD
7+
# matrix:
8+
# - name: FreeBSD 14.0
9+
# freebsd_instance:
10+
# image_family: freebsd-14-0
11+
# timeout_in: 20m
12+
# install_script:
13+
# - pkg install -y gettext
14+
# build_script:
15+
# - NPROC=$(getconf _NPROCESSORS_ONLN)
16+
# - ./configure --with-features=${FEATURES}
17+
# - make -j${NPROC}
18+
# test_script:
19+
# - src/vim --version
20+
# # run tests as user "cirrus" instead of root
21+
# - pw useradd cirrus -m
22+
# - chown -R cirrus:cirrus .
23+
# - sudo -u cirrus make test

.github/CODEOWNERS_vim

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ runtime/ftplugin/javascriptreact.vim @dkearns
166166
runtime/ftplugin/jsonc.vim @izhakjakov
167167
runtime/ftplugin/julia.vim @carlobaldassi
168168
runtime/ftplugin/kconfig.vim @chrisbra
169+
runtime/ftplugin/kotlin.vim @udalov
169170
runtime/ftplugin/less.vim @genoma
170171
runtime/ftplugin/liquid.vim @tpope
171172
runtime/ftplugin/lua.vim @dkearns
@@ -194,7 +195,7 @@ runtime/ftplugin/ps1xml.vim @heaths
194195
runtime/ftplugin/pymanifest.vim @ObserverOfTime
195196
runtime/ftplugin/python.vim @tpict
196197
runtime/ftplugin/qb64.vim @dkearns
197-
runtime/ftplugin/qml.vim @ChaseKnowlden
198+
runtime/ftplugin/qml.vim @ChaseKnowlden
198199
runtime/ftplugin/r.vim @jalvesaq
199200
runtime/ftplugin/racket.vim @benknoble
200201
runtime/ftplugin/readline.vim @dkearns
@@ -271,6 +272,7 @@ runtime/indent/javascript.vim @bounceme
271272
runtime/indent/json.vim @elzr
272273
runtime/indent/jsonc.vim @izhakjakov
273274
runtime/indent/julia.vim @carlobaldassi
275+
runtime/indent/kotlin.vim @udalov
274276
runtime/indent/krl.vim @KnoP-01
275277
runtime/indent/ld.vim @dkearns
276278
runtime/indent/less.vim @genoma
@@ -288,7 +290,7 @@ runtime/indent/postscr.vim @mrdubya
288290
runtime/indent/prolog.vim @dkearns
289291
runtime/indent/ps1.vim @heaths
290292
runtime/indent/qb64.vim @dkearns
291-
runtime/indent/qml.vim @ChaseKnowlden
293+
runtime/indent/qml.vim @ChaseKnowlden
292294
runtime/indent/r.vim @jalvesaq
293295
runtime/indent/racket.vim @benknoble
294296
runtime/indent/rapid.vim @KnoP-01
@@ -325,7 +327,7 @@ runtime/plugin/tarPlugin.vim @cecamp
325327
runtime/plugin/vimballPlugin.vim @cecamp
326328
runtime/plugin/zipPlugin.vim @cecamp
327329
runtime/plugin/manpager.vim @Konfekt
328-
runtime/syntax/shared/hgcommitDiff.vim @vegerot
330+
runtime/syntax/shared/hgcommitDiff.vim @vegerot
329331
runtime/syntax/abaqus.vim @costerwi
330332
runtime/syntax/aidl.vim @dpelle
331333
runtime/syntax/amiga.vim @cecamp
@@ -408,6 +410,7 @@ runtime/syntax/javascript.vim @fleiner
408410
runtime/syntax/jsonc.vim @izhakjakov
409411
runtime/syntax/julia.vim @carlobaldassi
410412
runtime/syntax/kconfig.vim @chrisbra
413+
runtime/syntax/kotlin.vim @udalov
411414
runtime/syntax/krl.vim @KnoP-01
412415
runtime/syntax/less.vim @genoma
413416
runtime/syntax/lex.vim @cecamp
@@ -450,7 +453,7 @@ runtime/syntax/ps1xml.vim @heaths
450453
runtime/syntax/psl.vim @danielkho
451454
runtime/syntax/pymanifest.vim @ObserverOfTime
452455
runtime/syntax/qb64.vim @dkearns
453-
runtime/syntax/qml.vim @ChaseKnowlden
456+
runtime/syntax/qml.vim @ChaseKnowlden
454457
runtime/syntax/r.vim @jalvesaq
455458
runtime/syntax/racket.vim @benknoble
456459
runtime/syntax/raml.vim @in3d

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ all install uninstall tools config configure reconfig proto depend lint tags typ
4040
@echo "If there are problems, cd to the src directory and run make there"
4141
cd src && $(MAKE) $@
4242
@# When the target is "test" also run the indent and syntax tests.
43-
@if test "$@" = "test"; then \
43+
@if test "$@" = "test" -o "$@" = "testtiny"; then \
4444
$(MAKE) indenttest; \
4545
$(MAKE) syntaxtest; \
4646
fi

runtime/autoload/cargo.vim

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
" Last Modified: 2023-09-11
2+
3+
function! cargo#Load()
4+
" Utility call to get this script loaded, for debugging
5+
endfunction
6+
7+
function! cargo#cmd(args) abort
8+
" Trim trailing spaces. This is necessary since :terminal command parses
9+
" trailing spaces as an empty argument.
10+
let args = substitute(a:args, '\s\+$', '', '')
11+
if exists('g:cargo_shell_command_runner')
12+
let cmd = g:cargo_shell_command_runner
13+
elseif has('terminal')
14+
let cmd = 'terminal'
15+
elseif has('nvim')
16+
let cmd = 'noautocmd new | terminal'
17+
else
18+
let cmd = '!'
19+
endif
20+
execute cmd 'cargo' args
21+
endfunction
22+
23+
function! s:nearest_cargo(...) abort
24+
" If the second argument is not specified, the first argument determines
25+
" whether we will start from the current directory or the directory of the
26+
" current buffer, otherwise, we start with the provided path on the
27+
" second argument.
28+
29+
let l:is_getcwd = get(a:, 1, 0)
30+
if l:is_getcwd
31+
let l:starting_path = get(a:, 2, getcwd())
32+
else
33+
let l:starting_path = get(a:, 2, expand('%:p:h'))
34+
endif
35+
36+
return findfile('Cargo.toml', l:starting_path . ';')
37+
endfunction
38+
39+
function! cargo#nearestCargo(is_getcwd) abort
40+
return s:nearest_cargo(a:is_getcwd)
41+
endfunction
42+
43+
function! cargo#nearestWorkspaceCargo(is_getcwd) abort
44+
let l:nearest = s:nearest_cargo(a:is_getcwd)
45+
while l:nearest !=# ''
46+
for l:line in readfile(l:nearest, '', 0x100)
47+
if l:line =~# '\V[workspace]'
48+
return l:nearest
49+
endif
50+
endfor
51+
let l:next = fnamemodify(l:nearest, ':p:h:h')
52+
let l:nearest = s:nearest_cargo(0, l:next)
53+
endwhile
54+
return ''
55+
endfunction
56+
57+
function! cargo#nearestRootCargo(is_getcwd) abort
58+
" Try to find a workspace Cargo.toml, and if not found, take the nearest
59+
" regular Cargo.toml
60+
let l:workspace_cargo = cargo#nearestWorkspaceCargo(a:is_getcwd)
61+
if l:workspace_cargo !=# ''
62+
return l:workspace_cargo
63+
endif
64+
return s:nearest_cargo(a:is_getcwd)
65+
endfunction
66+
67+
68+
function! cargo#build(args)
69+
call cargo#cmd("build " . a:args)
70+
endfunction
71+
72+
function! cargo#check(args)
73+
call cargo#cmd("check " . a:args)
74+
endfunction
75+
76+
function! cargo#clean(args)
77+
call cargo#cmd("clean " . a:args)
78+
endfunction
79+
80+
function! cargo#doc(args)
81+
call cargo#cmd("doc " . a:args)
82+
endfunction
83+
84+
function! cargo#new(args)
85+
call cargo#cmd("new " . a:args)
86+
cd `=a:args`
87+
endfunction
88+
89+
function! cargo#init(args)
90+
call cargo#cmd("init " . a:args)
91+
endfunction
92+
93+
function! cargo#run(args)
94+
call cargo#cmd("run " . a:args)
95+
endfunction
96+
97+
function! cargo#test(args)
98+
call cargo#cmd("test " . a:args)
99+
endfunction
100+
101+
function! cargo#bench(args)
102+
call cargo#cmd("bench " . a:args)
103+
endfunction
104+
105+
function! cargo#update(args)
106+
call cargo#cmd("update " . a:args)
107+
endfunction
108+
109+
function! cargo#search(args)
110+
call cargo#cmd("search " . a:args)
111+
endfunction
112+
113+
function! cargo#publish(args)
114+
call cargo#cmd("publish " . a:args)
115+
endfunction
116+
117+
function! cargo#install(args)
118+
call cargo#cmd("install " . a:args)
119+
endfunction
120+
121+
function! cargo#runtarget(args)
122+
let l:filename = expand('%:p')
123+
let l:read_manifest = system('cargo read-manifest')
124+
let l:metadata = json_decode(l:read_manifest)
125+
let l:targets = get(l:metadata, 'targets', [])
126+
let l:did_run = 0
127+
for l:target in l:targets
128+
let l:src_path = get(l:target, 'src_path', '')
129+
let l:kinds = get(l:target, 'kind', [])
130+
let l:name = get(l:target, 'name', '')
131+
if l:src_path == l:filename
132+
if index(l:kinds, 'example') != -1
133+
let l:did_run = 1
134+
call cargo#run("--example " . shellescape(l:name) . " " . a:args)
135+
return
136+
elseif index(l:kinds, 'bin') != -1
137+
let l:did_run = 1
138+
call cargo#run("--bin " . shellescape(l:name) . " " . a:args)
139+
return
140+
endif
141+
endif
142+
endfor
143+
if l:did_run != 1
144+
call cargo#run(a:args)
145+
return
146+
endif
147+
endfunction
148+
149+
" vim: set et sw=4 sts=4 ts=8:

runtime/autoload/cargo/quickfix.vim

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
" Last Modified: 2023-09-11
2+
3+
function! cargo#quickfix#CmdPre() abort
4+
if &filetype ==# 'rust' && get(b:, 'current_compiler', '') ==# 'cargo' &&
5+
\ &makeprg =~ '\V\^cargo\ \.\*'
6+
" Preserve the current directory, and 'lcd' to the nearest Cargo file.
7+
let b:rust_compiler_cargo_qf_has_lcd = haslocaldir()
8+
let b:rust_compiler_cargo_qf_prev_cd = getcwd()
9+
let b:rust_compiler_cargo_qf_prev_cd_saved = 1
10+
let l:nearest = fnamemodify(cargo#nearestRootCargo(0), ':h')
11+
execute 'lchdir! '.l:nearest
12+
else
13+
let b:rust_compiler_cargo_qf_prev_cd_saved = 0
14+
endif
15+
endfunction
16+
17+
function! cargo#quickfix#CmdPost() abort
18+
if exists("b:rust_compiler_cargo_qf_prev_cd_saved") && b:rust_compiler_cargo_qf_prev_cd_saved
19+
" Restore the current directory.
20+
if b:rust_compiler_cargo_qf_has_lcd
21+
execute 'lchdir! '.b:rust_compiler_cargo_qf_prev_cd
22+
else
23+
execute 'chdir! '.b:rust_compiler_cargo_qf_prev_cd
24+
endif
25+
let b:rust_compiler_cargo_qf_prev_cd_saved = 0
26+
endif
27+
endfunction
28+
29+
" vim: set et sw=4 sts=4 ts=8:

runtime/autoload/dist/man.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func dist#man#GetPage(cmdmods, ...)
196196

197197
" Emulate piping the buffer through the "col -b" command.
198198
" Ref: https://github.com/vim/vim/issues/12301
199-
silent! keepjumps keeppatterns %s/\v(.)\b\ze\1?//ge
199+
exe 'silent! keepjumps keeppatterns %s/\v(.)\b\ze\1?//e' .. (&gdefault ? '' : 'g')
200200

201201
if unsetwidth
202202
let $MANWIDTH = ''

runtime/autoload/netrw.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2998,7 +2998,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
29982998
" to process this detection correctly.
29992999
" call Decho("detect filetype of local version of remote file<".rfile.">",'~'.expand("<slnum>"))
30003000
" call Decho("..did_filetype()=".did_filetype())
3001-
setl ft=
3001+
" setl ft=
30023002
" call Decho("..initial filetype<".&ft."> for buf#".bufnr()."<".bufname().">")
30033003
let iskkeep= &isk
30043004
setl isk-=/

0 commit comments

Comments
 (0)