Skip to content

Commit 48eaf51

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents f39d218 + ad486a0 commit 48eaf51

61 files changed

Lines changed: 1413 additions & 311 deletions

Some content is hidden

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

.cirrus.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ freebsd_12_task:
1111
- NPROC=$(getconf _NPROCESSORS_ONLN)
1212
- ./configure --with-features=${FEATURES}
1313
- make -j${NPROC}
14-
- src/vim --version
1514
test_script:
16-
- make test
15+
- src/vim --version
16+
# run tests as user "cirrus" instead of root
17+
- pw useradd cirrus -m
18+
- chown -R cirrus:cirrus .
19+
- sudo -u cirrus make test

.github/workflows/ci-windows.yaml

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
name: GitHub CI
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
9+
env:
10+
VCVARSALL: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
11+
12+
# Interfaces
13+
# Lua
14+
LUA_VER: 54
15+
LUA_VER_DOT: '5.4'
16+
LUA_RELEASE: 5.4.0
17+
LUA32_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win32_dllw6_lib.zip
18+
LUA64_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win64_dllw6_lib.zip
19+
LUA_DIR: D:\Lua
20+
# Python 2
21+
PYTHON_VER: 27
22+
PYTHON_VER_DOT: '2.7'
23+
# Python 3
24+
PYTHON3_VER: 38
25+
PYTHON3_VER_DOT: '3.8'
26+
27+
# Other dependencies
28+
# winpty
29+
WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip
30+
31+
# Escape sequences
32+
COL_RED: "\x1b[31m"
33+
COL_GREEN: "\x1b[32m"
34+
COL_YELLOW: "\x1b[33m"
35+
COL_RESET: "\x1b[m"
36+
37+
jobs:
38+
build:
39+
runs-on: windows-latest
40+
41+
strategy:
42+
matrix:
43+
toolchain: [msvc, mingw]
44+
arch: [x64, x86]
45+
features: [HUGE, NORMAL]
46+
include:
47+
- arch: x64
48+
vcarch: amd64
49+
warch: x64
50+
bits: 64
51+
msystem: MINGW64
52+
cygreg: registry
53+
pyreg: ""
54+
- arch: x86
55+
vcarch: x86
56+
warch: ia32
57+
bits: 32
58+
msystem: MINGW32
59+
cygreg: registry32
60+
pyreg: "-32"
61+
exclude:
62+
- toolchain: msvc
63+
arch: x64
64+
features: NORMAL
65+
- toolchain: mingw
66+
arch: x86
67+
features: NORMAL
68+
69+
steps:
70+
- name: Initalize
71+
id: init
72+
shell: bash
73+
run: |
74+
git config --global core.autocrlf input
75+
python_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON_VER_DOT}/InstallPath/@")
76+
python3_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON3_VER_DOT}${{ matrix.pyreg }}/InstallPath/@")
77+
echo "::set-env name=PYTHON_DIR::$python_dir"
78+
echo "::set-env name=PYTHON3_DIR::$python3_dir"
79+
80+
- uses: msys2/setup-msys2@v2
81+
if: matrix.toolchain == 'mingw'
82+
with:
83+
msystem: ${{ matrix.msystem }}
84+
release: false
85+
86+
- uses: actions/checkout@v2
87+
88+
- name: Create a list of download URLs
89+
shell: cmd
90+
run: |
91+
type NUL > urls.txt
92+
echo %LUA_RELEASE%>> urls.txt
93+
echo %WINPTY_URL%>> urls.txt
94+
95+
- name: Cache downloaded files
96+
uses: actions/cache@v2
97+
with:
98+
path: downloads
99+
key: ${{ runner.os }}-${{ matrix.bits }}-${{ hashFiles('urls.txt') }}
100+
101+
- name: Download dependencies
102+
shell: cmd
103+
run: |
104+
path C:\Program Files\7-Zip;%path%
105+
if not exist downloads mkdir downloads
106+
107+
echo %COL_GREEN%Download Lua%COL_RESET%
108+
call :downloadfile %LUA${{ matrix.bits }}_URL% downloads\lua.zip
109+
7z x downloads\lua.zip -o%LUA_DIR% > nul || exit 1
110+
111+
echo %COL_GREEN%Download winpty%COL_RESET%
112+
call :downloadfile %WINPTY_URL% downloads\winpty.zip
113+
7z x -y downloads\winpty.zip -oD:\winpty > nul || exit 1
114+
copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty.dll src\winpty${{ matrix.bits }}.dll
115+
copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty-agent.exe src\
116+
117+
goto :eof
118+
119+
:downloadfile
120+
:: call :downloadfile <URL> <localfile>
121+
if not exist %2 (
122+
curl -f -L %1 -o %2
123+
)
124+
if ERRORLEVEL 1 (
125+
rem Retry once.
126+
curl -f -L %1 -o %2 || exit 1
127+
)
128+
goto :eof
129+
130+
- name: Build (MSVC)
131+
if: matrix.toolchain == 'msvc'
132+
shell: cmd
133+
run: |
134+
call "%VCVARSALL%" ${{ matrix.vcarch }}
135+
cd src
136+
:: Filter out the progress bar from the build log
137+
sed -e "s/@<<$/@<< | sed -e 's#.*\\\\r.*##'/" Make_mvc.mak > Make_mvc2.mak
138+
if "${{ matrix.features }}"=="HUGE" (
139+
nmake -nologo -f Make_mvc2.mak ^
140+
FEATURES=${{ matrix.features }} ^
141+
GUI=yes IME=yes ICONV=yes VIMDLL=yes ^
142+
DYNAMIC_LUA=yes LUA=%LUA_DIR% ^
143+
DYNAMIC_PYTHON=yes PYTHON=%PYTHON_DIR% ^
144+
DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR%
145+
) else (
146+
nmake -nologo -f Make_mvc2.mak ^
147+
FEATURES=${{ matrix.features }} ^
148+
GUI=yes IME=yes ICONV=yes VIMDLL=yes
149+
)
150+
if not exist vim${{ matrix.bits }}.dll (
151+
echo %COL_RED%Build failure.%COL_RESET%
152+
exit 1
153+
)
154+
155+
- name: Build (MinGW)
156+
if: matrix.toolchain == 'mingw'
157+
shell: msys2 {0}
158+
run: |
159+
cd src
160+
if [ "${{ matrix.features }}" = "HUGE" ]; then
161+
mingw32-make -f Make_ming.mak -j2 \
162+
FEATURES=${{ matrix.features }} \
163+
GUI=yes IME=yes ICONV=yes VIMDLL=yes \
164+
DYNAMIC_LUA=yes LUA=${LUA_DIR} \
165+
DYNAMIC_PYTHON=yes PYTHON=${PYTHON_DIR} \
166+
DYNAMIC_PYTHON3=yes PYTHON3=${PYTHON3_DIR} \
167+
STATIC_STDCPLUS=yes
168+
else
169+
mingw32-make -f Make_ming.mak -j2 \
170+
FEATURES=${{ matrix.features }} \
171+
GUI=yes IME=yes ICONV=yes VIMDLL=yes \
172+
STATIC_STDCPLUS=yes
173+
fi
174+
175+
# - name: Prepare Artifact
176+
# shell: cmd
177+
# run: |
178+
# mkdir artifacts
179+
# copy src\*vim.exe artifacts
180+
# copy src\vim*.dll artifacts
181+
#
182+
# - name: Upload Artifact
183+
# uses: actions/upload-artifact@v1
184+
# with:
185+
# name: vim${{ matrix.bits }}-${{ matrix.toolchain }}
186+
# path: ./artifacts
187+
188+
- name: Test
189+
shell: cmd
190+
timeout-minutes: 20
191+
run: |
192+
PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
193+
call "%VCVARSALL%" ${{ matrix.vcarch }}
194+
cd src
195+
echo.
196+
echo %COL_GREEN%vim version:%COL_RESET%
197+
.\vim --version || exit 1
198+
199+
mkdir ..\src2
200+
xcopy testdir ..\src2\testdir\ /E > nul || exit 1
201+
copy evalfunc.c ..\src2 > nul
202+
203+
echo %COL_GREEN%Start testing vim in background.%COL_RESET%
204+
start cmd /c "cd ..\src2\testdir & nmake -nologo -f Make_dos.mak VIMPROG=..\..\src\vim > nul & echo done>done.txt"
205+
206+
echo %COL_GREEN%Test gvim:%COL_RESET%
207+
cd testdir
208+
nmake -nologo -f Make_dos.mak VIMPROG=..\gvim || exit 1
209+
cd ..
210+
211+
echo %COL_GREEN%Wait for vim tests to finish.%COL_RESET%
212+
cd ..\src2\testdir
213+
:: Wait about 10 minutes.
214+
for /L %%i in (1,1,600) do (
215+
if exist done.txt goto exitloop
216+
ping -n 2 localhost > nul
217+
)
218+
set timeout=1
219+
:exitloop
220+
221+
echo %COL_GREEN%Test results of vim:%COL_RESET%
222+
if exist messages type messages
223+
nmake -nologo -f Make_dos.mak report VIMPROG=..\..\src\vim || exit 1
224+
if "%timeout%"=="1" (
225+
echo %COL_RED%Timed out.%COL_RESET%
226+
exit 1
227+
)

Filelist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ SRC_ALL = \
99
.lgtm.yml \
1010
.travis.yml \
1111
.cirrus.yml \
12+
.github/workflows/ci-windows.yaml \
1213
appveyor.yml \
1314
ci/appveyor.bat \
1415
ci/if_ver*.vim \

appveyor.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ skip_tags: true
55
environment:
66
matrix:
77
- FEATURE: HUGE
8-
- FEATURE: NORMAL
98
# disabled
109
# - FEATURE: TINY
1110
# - FEATURE: SMALL
11+
# - FEATURE: NORMAL
1212
# - FEATURE: BIG
1313

1414
matrix:
1515
fast_finish: true
1616

1717
before_build:
18+
# Use Windows SDK 7.1 (= MSVC 2010)
1819
- '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /release'
1920
- 'set INCLUDE=%INCLUDE%C:\Program Files (x86)\Windows Kits\8.1\Include\um'
2021

@@ -25,9 +26,9 @@ test_script:
2526
- cd src/testdir
2627
# Testing with MSVC gvim
2728
- path C:\Python35-x64;%PATH%
28-
- nmake -f Make_dos.mak POSTSCRIPT=yes VIMPROG=..\gvim
29+
- nmake -f Make_dos.mak VIMPROG=..\gvim
2930
- nmake -f Make_dos.mak clean
30-
# Testing with MingW console version
31-
- nmake -f Make_dos.mak POSTSCRIPT=yes VIMPROG=..\vim
31+
# Testing with MSVC console version
32+
- nmake -f Make_dos.mak VIMPROG=..\vim
3233

3334
# vim: sw=2 sts=2 et ts=8 sr

ci/appveyor.bat

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,48 +5,32 @@ setlocal ENABLEDELAYEDEXPANSION
55
cd %APPVEYOR_BUILD_FOLDER%
66

77
cd src
8-
echo "Building MinGW 32bit console version"
9-
set PATH=c:\msys64\mingw32\bin;%PATH%
10-
mingw32-make.exe -f Make_ming.mak GUI=no OPTIMIZE=speed IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
11-
.\vim -u NONE -c "redir @a | ver |0put a | wq" ver_ming.txt
12-
:: Save vim.exe before Make clean, moved back below.
13-
copy vim.exe testdir
14-
mingw32-make.exe -f Make_ming.mak clean
15-
16-
:: Build Mingw huge version with python and channel support, or
17-
:: with specified features without python.
18-
echo "Building MinGW 32bit GUI version"
19-
if "%FEATURE%" == "HUGE" (
20-
mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed CHANNEL=yes GUI=yes IME=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27 PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35 FEATURES=%FEATURE% || exit 1
21-
) ELSE (
22-
mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed GUI=yes IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
23-
)
24-
.\gvim -u NONE -c "redir @a | ver |0put a | wq" ver_ming_gui.txt
25-
268
:: Filter out the progress bar from the build log
279
sed -e "s/@<<$/@<< | sed -e 's#.*\\\\r.*##'/" Make_mvc.mak > Make_mvc2.mak
2810

2911
echo "Building MSVC 64bit console Version"
30-
nmake -f Make_mvc2.mak CPU=AMD64 OLE=no GUI=no IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
31-
:: The executable is not used
32-
nmake -f Make_mvc2.mak clean
12+
nmake -f Make_mvc2.mak CPU=AMD64 ^
13+
OLE=no GUI=no IME=yes ICONV=yes DEBUG=no ^
14+
FEATURES=%FEATURE% || exit 1
3315

3416
:: build MSVC huge version with python and channel support
3517
:: GUI needs to be last, so that testing works
3618
echo "Building MSVC 64bit GUI Version"
3719
if "%FEATURE%" == "HUGE" (
38-
nmake -f Make_mvc2.mak DIRECTX=yes CPU=AMD64 CHANNEL=yes OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35-x64 FEATURES=%FEATURE% || exit 1
20+
nmake -f Make_mvc2.mak CPU=AMD64 ^
21+
OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no POSTSCRIPT=yes ^
22+
PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 ^
23+
PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35-x64 ^
24+
FEATURES=%FEATURE% || exit 1
3925
) ELSE (
40-
nmake -f Make_mvc2.mak CPU=AMD64 OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
26+
nmake -f Make_mvc2.mak CPU=AMD64 ^
27+
OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no ^
28+
FEATURES=%FEATURE% || exit 1
4129
)
4230
.\gvim -u NONE -c "redir @a | ver |0put a | wq" ver_msvc.txt
4331

44-
:: Restore vim.exe, tests will run with this.
45-
move /Y testdir\vim.exe .
46-
echo "version output MinGW"
47-
type ver_ming.txt
48-
echo "version output MinGW GUI"
49-
type ver_ming_gui.txt
50-
echo "version output MVC"
32+
echo "version output MSVC console"
33+
.\vim --version
34+
echo "version output MSVC GUI"
5135
type ver_msvc.txt
5236
cd ..

runtime/doc/map.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,10 @@ When executing an autocommand or a user command, it will run in the context of
11671167
the script it was defined in. This makes it possible that the command calls a
11681168
local function or uses a local mapping.
11691169

1170+
In case the value is used in a context where <SID> cannot be correctly
1171+
expanded, use the expand() function: >
1172+
let &includexpr = expand('<SID>') .. 'My_includeexpr()'
1173+
11701174
Otherwise, using "<SID>" outside of a script context is an error.
11711175

11721176
If you need to get the script number to use in a complicated script, you can

runtime/doc/vim9.txt

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,13 @@ Functions and variables are script-local by default ~
118118
*vim9-scopes*
119119
When using `:function` or `:def` to specify a new function at the script level
120120
in a Vim9 script, the function is local to the script, as if "s:" was
121-
prefixed. Using the "s:" prefix is optional.
122-
123-
To define or use a global function or variable the "g:" prefix must be used.
121+
prefixed. Using the "s:" prefix is optional. To define or use a global
122+
function or variable the "g:" prefix must be used. For functions in an
123+
autoload script the "name#" prefix is sufficient. >
124+
def ThisFunction() # script-local
125+
def s:ThisFunction() # script-local
126+
def g:ThatFunction() # global
127+
def scriptname#function() # autoload
124128
125129
When using `:function` or `:def` to specify a new function inside a function,
126130
the function is local to the function. It is not possible to define a
@@ -186,8 +190,8 @@ To intentionally avoid a variable being available later, a block can be used:
186190
187191
An existing variable cannot be assigned to with `:let`, since that implies a
188192
declaration. Global, window, tab, buffer and Vim variables can only be used
189-
without `:let`, because they are are not really declared, they can also be
190-
deleted with `:unlet`.
193+
without `:let`, because they are not really declared, they can also be deleted
194+
with `:unlet`.
191195

192196
Variables cannot shadow previously defined variables.
193197
Variables may shadow Ex commands, rename the variable if needed.
@@ -348,10 +352,11 @@ No curly braces expansion ~
348352
|curly-braces-names| cannot be used.
349353

350354

351-
No :xit, :append, :change or :insert ~
355+
No :xit, :t, :append, :change or :insert ~
352356

353-
These commands are too easily confused with local variable names. Instead of
354-
`:x` or `:xit` you can use `:exit`.
357+
These commands are too easily confused with local variable names.
358+
Instead of `:x` or `:xit` you can use `:exit`.
359+
Instead of `:t` you can use `:copy`.
355360

356361

357362
Comparators ~

0 commit comments

Comments
 (0)