mirror of
https://github.com/zoriya/vim.git
synced 2025-12-09 08:46:17 +00:00
Compare commits
313 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5a2be26fe | ||
|
|
37c64c78fd | ||
|
|
e22bbf6508 | ||
|
|
a8e93d63e3 | ||
|
|
71b2964066 | ||
|
|
d326ad6e93 | ||
|
|
f16c71b669 | ||
|
|
1b9645de3c | ||
|
|
dde403c2d8 | ||
|
|
49150a41f8 | ||
|
|
63c4e8a198 | ||
|
|
8adb0d03ca | ||
|
|
4033c55eca | ||
|
|
e738a1a033 | ||
|
|
1514e8f427 | ||
|
|
495b7dd213 | ||
|
|
4cf56bbc85 | ||
|
|
eef9adddab | ||
|
|
fc2b270cfd | ||
|
|
b5e79ef5a9 | ||
|
|
e8ff56b28e | ||
|
|
f5291f301e | ||
|
|
69fbc9e1da | ||
|
|
38baa3e634 | ||
|
|
69e8aa7511 | ||
|
|
1190cf68e2 | ||
|
|
ef6b8de42f | ||
|
|
478e3a78c3 | ||
|
|
c71053c611 | ||
|
|
71eeb74a60 | ||
|
|
072412ed45 | ||
|
|
518d699699 | ||
|
|
b984b80cd8 | ||
|
|
49a613f84a | ||
|
|
238d43b328 | ||
|
|
a038cb5eab | ||
|
|
c212798333 | ||
|
|
b4d5fbabc9 | ||
|
|
45d5f26d11 | ||
|
|
95c83c64be | ||
|
|
65f084749b | ||
|
|
c168bd4bd3 | ||
|
|
414168d97f | ||
|
|
e9f6fd27d0 | ||
|
|
8696bbaf52 | ||
|
|
e09ba7bae5 | ||
|
|
7be9b50fd7 | ||
|
|
5b5adf5b9c | ||
|
|
9d18961323 | ||
|
|
aba680a851 | ||
|
|
74121231be | ||
|
|
09d6c3818d | ||
|
|
b4ea1914b8 | ||
|
|
fe386641b0 | ||
|
|
3c518400d1 | ||
|
|
1a735d6c9b | ||
|
|
2dc9d26c14 | ||
|
|
ba2929b6af | ||
|
|
99433291b1 | ||
|
|
c6da01a5b8 | ||
|
|
75a60f74ce | ||
|
|
37b53270e1 | ||
|
|
618d6d277e | ||
|
|
e723c42836 | ||
|
|
2e49b6b20c | ||
|
|
c35e4cb4fe | ||
|
|
1b9f9d315f | ||
|
|
28550b74bb | ||
|
|
c3f81394ef | ||
|
|
6756c7037f | ||
|
|
3971905bac | ||
|
|
3d8d2c7ca5 | ||
|
|
8b53b79ea5 | ||
|
|
1bfdc07a49 | ||
|
|
6e32f615eb | ||
|
|
11aa62f8f9 | ||
|
|
178333783f | ||
|
|
9d954207e2 | ||
|
|
e88fc7a574 | ||
|
|
9d654a8d8c | ||
|
|
595a40226e | ||
|
|
d8d85bfb7d | ||
|
|
5e80de3f3e | ||
|
|
00ccf54630 | ||
|
|
ae96b8d058 | ||
|
|
6a8691d483 | ||
|
|
2254a8ad0c | ||
|
|
4ec86ddd77 | ||
|
|
9f45ccd1bf | ||
|
|
e2e69e4813 | ||
|
|
3653822546 | ||
|
|
b31cf2bb0b | ||
|
|
cf4b00c856 | ||
|
|
da22b8cc8b | ||
|
|
dada6d2a8e | ||
|
|
ef68e4fa52 | ||
|
|
3346cc4ffb | ||
|
|
995e4afcfe | ||
|
|
9ac9dfa9e2 | ||
|
|
2c809b7c7d | ||
|
|
9e8dcf9d6f | ||
|
|
da73253a0b | ||
|
|
3d593c2dc9 | ||
|
|
2db0ec4b2e | ||
|
|
5c6dbcb03f | ||
|
|
4e83961985 | ||
|
|
4bebc9a056 | ||
|
|
a539f4f1ae | ||
|
|
1a333bc44a | ||
|
|
dc5471d482 | ||
|
|
0f0f230012 | ||
|
|
d41babef89 | ||
|
|
4ad3b2b588 | ||
|
|
dde6034111 | ||
|
|
f3af54eeb1 | ||
|
|
97a80e440a | ||
|
|
b47a2597e6 | ||
|
|
e561a7e2fa | ||
|
|
48340b62e8 | ||
|
|
97f65fafdb | ||
|
|
3c37a8e660 | ||
|
|
4db2554954 | ||
|
|
1dccf6351d | ||
|
|
cbe6944956 | ||
|
|
c572da5f67 | ||
|
|
7adf06f4e2 | ||
|
|
4ab7968aa9 | ||
|
|
8d9f0ef5c6 | ||
|
|
e85928a324 | ||
|
|
02e177d3e8 | ||
|
|
0903d56f5c | ||
|
|
13ebb03e75 | ||
|
|
dde81312b0 | ||
|
|
a4f99f5a8b | ||
|
|
e922460394 | ||
|
|
833e0e3c8c | ||
|
|
753289f9bf | ||
|
|
be0b72977f | ||
|
|
f6d9f96b2d | ||
|
|
33d66bd9fa | ||
|
|
6c4d12c527 | ||
|
|
285f243e50 | ||
|
|
77f7474d08 | ||
|
|
829aa64cf5 | ||
|
|
d2c45a1964 | ||
|
|
ec0e07a324 | ||
|
|
6d0826dfbb | ||
|
|
5830232c02 | ||
|
|
3f9a1ff141 | ||
|
|
740c433c59 | ||
|
|
0cbba82359 | ||
|
|
b109bb4e12 | ||
|
|
eef0531621 | ||
|
|
37819ed540 | ||
|
|
5983d50247 | ||
|
|
b241208a13 | ||
|
|
edbc0d46cf | ||
|
|
8efa026a25 | ||
|
|
ce1c32780a | ||
|
|
37b9b81997 | ||
|
|
0aed9a2e2e | ||
|
|
d6a7b3e6bb | ||
|
|
dc926dd0dd | ||
|
|
77ac9b5c62 | ||
|
|
93c92eff26 | ||
|
|
fc8bec0be4 | ||
|
|
3eee06e7d4 | ||
|
|
683b796725 | ||
|
|
d21f8b54b2 | ||
|
|
9aa1569128 | ||
|
|
98ebd2bbec | ||
|
|
8e539c51c3 | ||
|
|
f66a2cda2c | ||
|
|
ea5d6fadbb | ||
|
|
97bd5e6527 | ||
|
|
cfce71710b | ||
|
|
82de3c2c03 | ||
|
|
bc906e445c | ||
|
|
f5be7cd016 | ||
|
|
a83e3962ac | ||
|
|
84ed4ad084 | ||
|
|
ade59630c7 | ||
|
|
9e13aa7729 | ||
|
|
989a70c590 | ||
|
|
6fe15bbc87 | ||
|
|
a9f8ee05f4 | ||
|
|
60104f183c | ||
|
|
d21b16f3c0 | ||
|
|
3678393baa | ||
|
|
4fa1019f80 | ||
|
|
05fbfdcda4 | ||
|
|
c08706135d | ||
|
|
51c23687a9 | ||
|
|
6bb18a878c | ||
|
|
bce4f62d30 | ||
|
|
2bb7b6b0e4 | ||
|
|
304b64c9e6 | ||
|
|
6b93b0e838 | ||
|
|
9f0139a2a8 | ||
|
|
4f44b88684 | ||
|
|
69905d108b | ||
|
|
e62780543f | ||
|
|
2438ae3d67 | ||
|
|
dcaa61384c | ||
|
|
274a52fd58 | ||
|
|
e0f314aa8d | ||
|
|
62426e168e | ||
|
|
5cc1f2c477 | ||
|
|
679653e59c | ||
|
|
55b6926450 | ||
|
|
3d9bdfebf1 | ||
|
|
893029ab20 | ||
|
|
c977092053 | ||
|
|
3cd43ccccb | ||
|
|
589b1109c5 | ||
|
|
37c4583594 | ||
|
|
7eedd4398a | ||
|
|
0cd2a94a40 | ||
|
|
9698ad7201 | ||
|
|
8cad930a25 | ||
|
|
b81bc77ae7 | ||
|
|
da43b61ddd | ||
|
|
8ed5400739 | ||
|
|
08d384ff3a | ||
|
|
89e06c807a | ||
|
|
d9bc8a801a | ||
|
|
444fda2084 | ||
|
|
ae33833850 | ||
|
|
cf8d840ce9 | ||
|
|
1ccd8fff8a | ||
|
|
05aafed54b | ||
|
|
76ca1b4041 | ||
|
|
ab6c8587ba | ||
|
|
2d33e90f81 | ||
|
|
e41e3b41f9 | ||
|
|
f1237f1814 | ||
|
|
dd693ce28b | ||
|
|
8ab3c1dc6b | ||
|
|
0a0217abfa | ||
|
|
82b9ca05f4 | ||
|
|
292d569935 | ||
|
|
7fadbf8325 | ||
|
|
75373f3808 | ||
|
|
e20b3eba73 | ||
|
|
116a0f800c | ||
|
|
6d87e9e1c6 | ||
|
|
f8d57a5049 | ||
|
|
33a43bee9c | ||
|
|
f3402b1b7f | ||
|
|
1c864093f9 | ||
|
|
4535654246 | ||
|
|
e16b00a158 | ||
|
|
02113ed4df | ||
|
|
bae5a17a73 | ||
|
|
cae92dc3d5 | ||
|
|
6d8197485d | ||
|
|
39d21e3c30 | ||
|
|
0af2d32c21 | ||
|
|
22aa23fd8c | ||
|
|
aaa8a35fbd | ||
|
|
98fd66d311 | ||
|
|
086d535f77 | ||
|
|
b9279e73ae | ||
|
|
a9f028103f | ||
|
|
cfcc022c54 | ||
|
|
35422f45ba | ||
|
|
d53109886b | ||
|
|
8456ea8050 | ||
|
|
78712a7733 | ||
|
|
69198197fd | ||
|
|
07c043af5f | ||
|
|
4a137b4586 | ||
|
|
6b7355a30d | ||
|
|
8e5eece8c5 | ||
|
|
eb44a68b42 | ||
|
|
620d064b0b | ||
|
|
102dc7f891 | ||
|
|
5be8dd087f | ||
|
|
e9c21aed62 | ||
|
|
b4a6721a28 | ||
|
|
1b66c00aec | ||
|
|
69a76feda9 | ||
|
|
01efafad12 | ||
|
|
3c3a80dc59 | ||
|
|
2f3a90a3bd | ||
|
|
398ee7326b | ||
|
|
7c9aec4ac8 | ||
|
|
d8dc179937 | ||
|
|
e0ab979fa7 | ||
|
|
66cd19fef1 | ||
|
|
223896d3e9 | ||
|
|
5c838a3e71 | ||
|
|
b6843a007d | ||
|
|
fae4283542 | ||
|
|
94053a5125 | ||
|
|
0792048842 | ||
|
|
f55e4c867f | ||
|
|
20e6cd07ba | ||
|
|
65cedb2074 | ||
|
|
2a4f06f370 | ||
|
|
9c8448472f | ||
|
|
c2ce52c011 | ||
|
|
12d853fae1 | ||
|
|
aaef1bae3c | ||
|
|
7da346035b | ||
|
|
983b3a5bc4 | ||
|
|
979e8c5346 | ||
|
|
662d938666 | ||
|
|
3633cf5201 | ||
|
|
392d1bfa5e | ||
|
|
c9456cec0c | ||
|
|
d09be32142 | ||
|
|
b000e328ef |
24
.travis.yml
24
.travis.yml
@@ -1,6 +1,5 @@
|
||||
language: c
|
||||
# trusty still has a few problems, use precise until they are solved.
|
||||
dist: precise
|
||||
dist: trusty
|
||||
|
||||
os:
|
||||
- osx
|
||||
@@ -22,7 +21,7 @@ env:
|
||||
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp'"
|
||||
# ASAN build
|
||||
- BUILD=yes TEST=test SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize=address -fno-omit-frame-pointer"
|
||||
FEATURES=huge SRCDIR=./src CHECK_AUTOCONF=no ASAN_OPTIONS="print_stacktrace=1 log_path=asan"
|
||||
FEATURES=huge SRCDIR=./src CHECK_AUTOCONF=no ASAN_OPTIONS="print_stacktrace=1 log_path=asan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt"
|
||||
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp'"
|
||||
|
||||
sudo: false
|
||||
@@ -43,12 +42,12 @@ matrix:
|
||||
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp'"
|
||||
- os: osx
|
||||
env: BUILD=yes TEST=test SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize=address -fno-omit-frame-pointer"
|
||||
FEATURES=huge SRCDIR=./src CHECK_AUTOCONF=no ASAN_OPTIONS="print_stacktrace=1 log_path=asan"
|
||||
FEATURES=huge SRCDIR=./src CHECK_AUTOCONF=no ASAN_OPTIONS="print_stacktrace=1 log_path=asan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt"
|
||||
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp'"
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
compiler: clang
|
||||
env: BUILD=yes TEST=test SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize=address -fno-omit-frame-pointer"
|
||||
FEATURES=huge SRCDIR=./src CHECK_AUTOCONF=no ASAN_OPTIONS="print_stacktrace=1 log_path=asan"
|
||||
FEATURES=huge SRCDIR=./src CHECK_AUTOCONF=no ASAN_OPTIONS="print_stacktrace=1 log_path=asan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt"
|
||||
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp'"
|
||||
- os: linux
|
||||
compiler: clang
|
||||
@@ -74,15 +73,23 @@ addons:
|
||||
- python3-dev
|
||||
- liblua5.2-dev
|
||||
- lua5.2
|
||||
- ruby-dev
|
||||
- cscope
|
||||
- libgtk2.0-dev
|
||||
|
||||
before_install:
|
||||
- if [ "$COVERAGE" = "yes" ]; then pip install --user cpp-coveralls==0.3.12; fi
|
||||
- rvm reset
|
||||
# Remove /opt/python/3.x.x/bin from $PATH for using system python3.
|
||||
# ("pyenv global system" doesn't seem to work.)
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ] && which python3 | grep '/opt/python/' > /dev/null; then export PATH=$(echo $PATH | sed -e "s#$(echo $(which python3) | sed -e 's#/python3$##'):##"); fi
|
||||
- if [ "$COVERAGE" = "yes" ]; then pip install --user cpp-coveralls; fi
|
||||
# needed for https support for coveralls
|
||||
# building cffi only works with gcc, not with clang
|
||||
- if [ "$COVERAGE" = "yes" ]; then CC=gcc pip install --user pyopenssl ndg-httpsclient pyasn1; fi
|
||||
# Lua is not installed on Travis OSX
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install lua; export LUA_PREFIX=/usr/local; fi
|
||||
# Use llvm-cov instead of gcov when compiler is clang.
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$CC" = "clang" ]; then ln -sf $(which llvm-cov) /home/travis/bin/gcov; fi
|
||||
|
||||
# Start virtual framebuffer to be able to test the GUI. Does not work on OS X.
|
||||
before_script:
|
||||
@@ -93,7 +100,8 @@ script:
|
||||
- if [ "$CHECK_AUTOCONF" = "yes" -a "$CC" = "gcc" ]; then make -C src autoconf; fi
|
||||
- if [ "x$SHADOWOPT" != x ]; then make -C src shadow; fi
|
||||
- (cd ${SRCDIR} && ./configure --with-features=$FEATURES $CONFOPT --enable-fail-if-missing && if [ "$BUILD" = "yes" ]; then make -j$NPROC; fi)
|
||||
- if [ "$BUILD" = "yes" ]; then ${SRCDIR}/vim --version; fi
|
||||
# Show Vim version and also if_xx versions.
|
||||
- if [ "$BUILD" = "yes" ]; then ${SRCDIR}/vim --version; ${SRCDIR}/vim --not-a-term -u NONE -S ${SRCDIR}/testdir/if_ver-1.vim -c quit > /dev/null; ${SRCDIR}/vim --not-a-term -u NONE -S ${SRCDIR}/testdir/if_ver-2.vim -c quit > /dev/null; cat if_ver.txt; fi
|
||||
- if [ -n "$ASAN_OPTIONS" ]; then export PATH=/usr/lib/llvm-$(clang -v 2>&1 | sed -n 's/.*version \([1-9]\.[0-9][0-9]*\).*/\1/p')/bin:$PATH; fi
|
||||
- make $SHADOWOPT $TEST
|
||||
- if [ -n "$ASAN_OPTIONS" ]; then for log in $(find -type f -name 'asan.*' -size +0); do cat "$log"; err=1; done; fi
|
||||
|
||||
3
Filelist
3
Filelist
@@ -105,6 +105,7 @@ SRC_ALL = \
|
||||
src/testdir/Make_all.mak \
|
||||
src/testdir/*.in \
|
||||
src/testdir/*.py \
|
||||
src/testdir/lsan-suppress.txt \
|
||||
src/testdir/sautest/autoload/*.vim \
|
||||
src/testdir/runtest.vim \
|
||||
src/testdir/shared.vim \
|
||||
@@ -134,6 +135,7 @@ SRC_ALL = \
|
||||
src/testdir/bench*.in \
|
||||
src/testdir/bench*.vim \
|
||||
src/testdir/samples/*.txt \
|
||||
src/testdir/if_ver*.vim \
|
||||
src/proto.h \
|
||||
src/proto/arabic.pro \
|
||||
src/proto/blowfish.pro \
|
||||
@@ -636,6 +638,7 @@ RT_ALL = \
|
||||
runtime/pack/dist/opt/matchit/doc/tags \
|
||||
runtime/pack/dist/opt/shellmenu/plugin/shellmenu.vim \
|
||||
runtime/pack/dist/opt/swapmouse/plugin/swapmouse.vim \
|
||||
runtime/pack/dist/opt/termdebug/plugin/termdebug.vim \
|
||||
|
||||
# runtime files for all distributions without CR-NL translation
|
||||
RT_ALL_BIN = \
|
||||
|
||||
@@ -179,7 +179,7 @@ FunctionEnd
|
||||
|
||||
##########################################################
|
||||
Section "Vim executables and runtime files"
|
||||
SectionIn 1 2 3
|
||||
SectionIn 1 2 3 RO
|
||||
|
||||
# we need also this here if the user changes the instdir
|
||||
StrCpy $0 "$INSTDIR\vim${VER_MAJOR}${VER_MINOR}"
|
||||
@@ -191,13 +191,16 @@ Section "Vim executables and runtime files"
|
||||
File ${VIMSRC}\vimrun.exe
|
||||
File /oname=tee.exe ${VIMSRC}\teew32.exe
|
||||
File /oname=xxd.exe ${VIMSRC}\xxdw32.exe
|
||||
File ${VIMTOOLS}\diff.exe
|
||||
File ${VIMRT}\vimtutor.bat
|
||||
File ${VIMRT}\README.txt
|
||||
File ..\uninstal.txt
|
||||
File ${VIMRT}\*.vim
|
||||
File ${VIMRT}\rgb.txt
|
||||
|
||||
File ${VIMTOOLS}\diff.exe
|
||||
File ${VIMTOOLS}\winpty32.dll
|
||||
File ${VIMTOOLS}\winpty-agent.exe
|
||||
|
||||
SetOutPath $0\colors
|
||||
File ${VIMRT}\colors\*.*
|
||||
|
||||
@@ -216,6 +219,14 @@ Section "Vim executables and runtime files"
|
||||
|
||||
SetOutPath $0\macros
|
||||
File ${VIMRT}\macros\*.*
|
||||
SetOutPath $0\macros\hanoi
|
||||
File ${VIMRT}\macros\hanoi\*.*
|
||||
SetOutPath $0\macros\life
|
||||
File ${VIMRT}\macros\life\*.*
|
||||
SetOutPath $0\macros\maze
|
||||
File ${VIMRT}\macros\maze\*.*
|
||||
SetOutPath $0\macros\urm
|
||||
File ${VIMRT}\macros\urm\*.*
|
||||
|
||||
SetOutPath $0\pack\dist\opt\dvorak\dvorak
|
||||
File ${VIMRT}\pack\dist\opt\dvorak\dvorak\*.*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim support file to help with paste mappings and menus
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2006 Jun 23
|
||||
" Last Change: 2017 Aug 30
|
||||
|
||||
" Define the string to use for items that are present both in Edit, Popup and
|
||||
" Toolbar menu. Also used in mswin.vim and macmap.vim.
|
||||
@@ -12,7 +12,7 @@
|
||||
if has("virtualedit")
|
||||
let paste#paste_cmd = {'n': ":call paste#Paste()<CR>"}
|
||||
let paste#paste_cmd['v'] = '"-c<Esc>' . paste#paste_cmd['n']
|
||||
let paste#paste_cmd['i'] = 'x<BS><Esc>' . paste#paste_cmd['n'] . 'gi'
|
||||
let paste#paste_cmd['i'] = "\<c-\>\<c-o>\"+gP"
|
||||
|
||||
func! paste#Paste()
|
||||
let ove = &ve
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*channel.txt* For Vim version 8.0. Last change: 2017 Jul 22
|
||||
*channel.txt* For Vim version 8.0. Last change: 2017 Aug 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -427,8 +427,8 @@ When no message was available then the result is v:none for a JSON or JS mode
|
||||
channels, an empty string for a RAW or NL channel. You can use |ch_canread()|
|
||||
to check if there is something to read.
|
||||
|
||||
Note that when there is no callback message are dropped. To avoid that add a
|
||||
close callback to the channel.
|
||||
Note that when there is no callback, messages are dropped. To avoid that add
|
||||
a close callback to the channel.
|
||||
|
||||
To read all output from a RAW channel that is available: >
|
||||
let output = ch_readraw(channel)
|
||||
@@ -696,6 +696,10 @@ See |job_setoptions()| and |ch_setoptions()|.
|
||||
"block_write": number only for testing: pretend every other write to stdin
|
||||
will block
|
||||
|
||||
"env": dict environment variables for the new process
|
||||
"cwd": "/path/to/dir" current working directory for the new process;
|
||||
if the directory does not exist an error is given
|
||||
|
||||
|
||||
Writing to a buffer ~
|
||||
*out_io-buffer*
|
||||
@@ -731,10 +735,6 @@ The "out_msg" option can be used to specify whether a new buffer will have the
|
||||
first line set to "Reading from channel output...". The default is to add the
|
||||
message. "err_msg" does the same for channel error.
|
||||
|
||||
'modifiable' option off, or write to a buffer that has 'modifiable' off. That
|
||||
means that lines will be appended to the buffer, but the user can't easily
|
||||
change the buffer.
|
||||
|
||||
When an existing buffer is to be written where 'modifiable' is off and the
|
||||
"out_modifiable" or "err_modifiable" options is not zero, an error is given
|
||||
and the buffer will not be written to.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*cmdline.txt* For Vim version 8.0. Last change: 2017 Jul 11
|
||||
*cmdline.txt* For Vim version 8.0. Last change: 2017 Sep 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -826,10 +826,16 @@ Also see |`=|.
|
||||
*:<cword>* *:<cWORD>* *:<cfile>* *<cfile>*
|
||||
*:<sfile>* *<sfile>* *:<afile>* *<afile>*
|
||||
*:<abuf>* *<abuf>* *:<amatch>* *<amatch>*
|
||||
*:<cexpr>* *<cexpr>*
|
||||
*<slnum>* *E495* *E496* *E497* *E499* *E500*
|
||||
Note: these are typed literally, they are not special keys!
|
||||
<cword> is replaced with the word under the cursor (like |star|)
|
||||
<cWORD> is replaced with the WORD under the cursor (see |WORD|)
|
||||
<cexpr> is replaced with the word under the cursor, including more
|
||||
to form a C expression. E.g., when the cursor is on "arg"
|
||||
of "ptr->arg" then the result is "ptr->arg"; when the
|
||||
cursor is on "]" of "list[idx]" then the result is
|
||||
"list[idx]". This is used for |v:beval_text|.
|
||||
<cfile> is replaced with the path name under the cursor (like what
|
||||
|gf| uses)
|
||||
<afile> When executing autocommands, is replaced with the file name
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*develop.txt* For Vim version 8.0. Last change: 2017 Jan 05
|
||||
*develop.txt* For Vim version 8.0. Last change: 2017 Jul 31
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -143,9 +143,10 @@ and its environment.
|
||||
|
||||
VIM IS... NOT *design-not*
|
||||
|
||||
- Vim is not a shell or an Operating System. You will not be able to run a
|
||||
shell inside Vim or use it to control a debugger. This should work the
|
||||
other way around: Use Vim as a component from a shell or in an IDE.
|
||||
- Vim is not a shell or an Operating System. It does provide a terminal
|
||||
window, in which you can run a shell or debugger. E.g. to be able to do
|
||||
this over an ssh connection. But if you don't need a text editor with that
|
||||
it is out of scope (use something like screen or tmux instead).
|
||||
A satirical way to say this: "Unlike Emacs, Vim does not attempt to include
|
||||
everything but the kitchen sink, but some people say that you can clean one
|
||||
with it. ;-)"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*diff.txt* For Vim version 8.0. Last change: 2017 Feb 03
|
||||
*diff.txt* For Vim version 8.0. Last change: 2017 Sep 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -226,8 +226,8 @@ The diffs are highlighted with these groups:
|
||||
(searching from the end of the line). The
|
||||
text in between is highlighted. This means
|
||||
that parts in the middle that are still the
|
||||
same are highlighted anyway. Only "iwhite" of
|
||||
'diffopt' is used here.
|
||||
same are highlighted anyway. The 'diffopt'
|
||||
flags "iwhite" and "icase" are used here.
|
||||
|hl-DiffDelete| DiffDelete Deleted lines. Also called filler lines,
|
||||
because they don't really exist in this
|
||||
buffer.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 8.0. Last change: 2017 Jul 16
|
||||
*editing.txt* For Vim version 8.0. Last change: 2017 Aug 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1109,6 +1109,7 @@ The names can be in upper- or lowercase.
|
||||
window in the current tab page the current tab page is
|
||||
closed |tab-page|.
|
||||
Triggers the |QuitPre| autocommand event.
|
||||
See |CTRL-W_q| for quitting another window.
|
||||
|
||||
:conf[irm] q[uit] Quit, but give prompt when changes have been made, or
|
||||
the last file in the argument list has not been
|
||||
@@ -1737,7 +1738,7 @@ There are three different types of searching:
|
||||
This searches the same directories, but in a different order.
|
||||
|
||||
Note that completion for ":find", ":sfind", and ":tabfind" commands do not
|
||||
currently work with 'path' items that contain a url or use the double star
|
||||
currently work with 'path' items that contain a URL or use the double star
|
||||
with depth limiter (/usr/**2) or upward search (;) notations.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Jul 30
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Sep 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1449,7 +1449,7 @@ v:beval_text The text under or after the mouse pointer. Usually a word as
|
||||
but a dot and "->" before the position is included. When on a
|
||||
']' the text before it is used, including the matching '[' and
|
||||
word before it. When on a Visual area within one line the
|
||||
highlighted text is used.
|
||||
highlighted text is used. Also see |<cexpr>|.
|
||||
Only valid while evaluating the 'balloonexpr' option.
|
||||
|
||||
*v:beval_winnr* *beval_winnr-variable*
|
||||
@@ -1815,7 +1815,7 @@ v:scrollstart String describing the script or function that caused the
|
||||
hit-enter prompt.
|
||||
|
||||
*v:servername* *servername-variable*
|
||||
v:servername The resulting registered |x11-clientserver| name if any.
|
||||
v:servername The resulting registered |client-server-name| if any.
|
||||
Read-only.
|
||||
|
||||
|
||||
@@ -1902,6 +1902,26 @@ v:termresponse The escape sequence returned by the terminal for the |t_RV|
|
||||
always 95 or bigger). Pc is always zero.
|
||||
{only when compiled with |+termresponse| feature}
|
||||
|
||||
*v:termblinkresp*
|
||||
v:termblinkresp The escape sequence returned by the terminal for the |t_RC|
|
||||
termcap entry. This is used to find out whether the terminal
|
||||
cursor is blinking. This is used by |term_getcursor()|.
|
||||
|
||||
*v:termstyleresp*
|
||||
v:termstyleresp The escape sequence returned by the terminal for the |t_RS|
|
||||
termcap entry. This is used to find out what the shape of the
|
||||
cursor is. This is used by |term_getcursor()|.
|
||||
|
||||
*v:termrgbresp*
|
||||
v:termrgbresp The escape sequence returned by the terminal for the |t_RB|
|
||||
termcap entry. This is used to find out what the terminal
|
||||
background color is, see 'background'.
|
||||
|
||||
*v:termu7resp*
|
||||
v:termu7resp The escape sequence returned by the terminal for the |t_u7|
|
||||
termcap entry. This is used to find out what the terminal
|
||||
does with ambiguous width characters, see 'ambiwidth'.
|
||||
|
||||
*v:testing* *testing-variable*
|
||||
v:testing Must be set before using `test_garbagecollect_now()`.
|
||||
Also, when set certain error messages won't be shown for 2
|
||||
@@ -2296,6 +2316,9 @@ searchpos({pattern} [, {flags} [, {stopline} [, {timeout}]]])
|
||||
server2client({clientid}, {string})
|
||||
Number send reply string
|
||||
serverlist() String get a list of available servers
|
||||
setbufline( {expr}, {lnum}, {line})
|
||||
Number set line {lnum} to {line} in buffer
|
||||
{expr}
|
||||
setbufvar({expr}, {varname}, {val})
|
||||
none set {varname} in buffer {expr} to {val}
|
||||
setcharsearch({dict}) Dict set character search from {dict}
|
||||
@@ -2369,19 +2392,25 @@ tagfiles() List tags files used
|
||||
tan({expr}) Float tangent of {expr}
|
||||
tanh({expr}) Float hyperbolic tangent of {expr}
|
||||
tempname() String name for a temporary file
|
||||
term_getattr({attr}, {what} Number get the value of attribute {what}
|
||||
term_getaltscreen({buf}) Number get the alternate screen flag
|
||||
term_getattr({attr}, {what}) Number get the value of attribute {what}
|
||||
term_getcursor({buf}) List get the cursor position of a terminal
|
||||
term_getjob({buf}) Job get the job associated with a terminal
|
||||
term_getline({buf}[, {row}]) String get a line of text from a terminal
|
||||
term_getline({buf}, {row}) String get a line of text from a terminal
|
||||
term_getscrolled({buf}) Number get the scroll count of a terminal
|
||||
term_getsize({buf}) List get the size of a terminal
|
||||
term_getstatus({buf}) String get the status of a terminal
|
||||
term_gettitle({buf}) String get the title of a terminal
|
||||
term_getttty({buf}, [{input}]) String get the tty name of a terminal
|
||||
term_list() List get the list of terminal buffers
|
||||
term_scrape({buf}[, {row}]) List get row of a terminal screen
|
||||
term_scrape({buf}, {row}) List get row of a terminal screen
|
||||
term_sendkeys({buf}, {keys}) none send keystrokes to a terminal
|
||||
term_start({cmd}, {options}) Job open a terminal window and run a job
|
||||
term_wait({buf}) Number wait for screen to be updated
|
||||
term_wait({buf} [, {time}]) Number wait for screen to be updated
|
||||
test_alloc_fail({id}, {countdown}, {repeat})
|
||||
none make memory allocation fail
|
||||
test_autochdir() none enable 'autochdir' during startup
|
||||
test_feedinput() none add key sequence to input buffer
|
||||
test_garbagecollect_now() none free memory right now for testing
|
||||
test_ignore_error({expr}) none ignore a specific error
|
||||
test_null_channel() Channel null value for testing
|
||||
@@ -2981,6 +3010,11 @@ ch_logfile({fname} [, {mode}]) *ch_logfile()*
|
||||
The file is flushed after every message, on Unix you can use
|
||||
"tail -f" to see what is going on in real time.
|
||||
|
||||
This function is not available in the |sandbox|.
|
||||
NOTE: the channel communication is stored in the file, be
|
||||
aware that this may contain confidential and privacy sensitive
|
||||
information, e.g. a password you type in a terminal window.
|
||||
|
||||
|
||||
ch_open({address} [, {options}]) *ch_open()*
|
||||
Open a channel to {address}. See |channel|.
|
||||
@@ -3267,7 +3301,7 @@ count({comp}, {expr} [, {ic} [, {start}]]) *count()*
|
||||
When {ic} is given and it's |TRUE| then case is ignored.
|
||||
|
||||
When {comp} is a string then the number of not overlapping
|
||||
occurences of {expr} is returned.
|
||||
occurrences of {expr} is returned.
|
||||
|
||||
|
||||
*cscope_connection()*
|
||||
@@ -3433,7 +3467,7 @@ escape({string}, {chars}) *escape()*
|
||||
:echo escape('c:\program files\vim', ' \')
|
||||
< results in: >
|
||||
c:\\program\ files\\vim
|
||||
< Also see |shellescape()|.
|
||||
< Also see |shellescape()| and |fnameescape()|.
|
||||
|
||||
*eval()*
|
||||
eval({string}) Evaluate {string} and return the result. Especially useful to
|
||||
@@ -3853,7 +3887,7 @@ float2nr({expr}) *float2nr()*
|
||||
When the value of {expr} is out of range for a |Number| the
|
||||
result is truncated to 0x7fffffff or -0x7fffffff (or when
|
||||
64-bit Number support is enabled, 0x7fffffffffffffff or
|
||||
-0x7fffffffffffffff. NaN results in -0x80000000 (or when
|
||||
-0x7fffffffffffffff). NaN results in -0x80000000 (or when
|
||||
64-bit Number support is enabled, -0x8000000000000000).
|
||||
Examples: >
|
||||
echo float2nr(3.95)
|
||||
@@ -4365,6 +4399,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
|
||||
highlight highlight groups
|
||||
history :history suboptions
|
||||
locale locale names (as output of locale -a)
|
||||
mapclear buffer argument
|
||||
mapping mapping name
|
||||
menu menus
|
||||
messages |:messages| suboptions
|
||||
@@ -4601,31 +4636,52 @@ getqflist([{what}]) *getqflist()*
|
||||
returns only the items listed in {what} as a dictionary. The
|
||||
following string items are supported in {what}:
|
||||
context get the context stored with |setqflist()|
|
||||
efm errorformat to use when parsing "lines". If
|
||||
not present, then the 'erroformat' option
|
||||
value is used.
|
||||
id get information for the quickfix list with
|
||||
|quickfix-ID|; zero means the id for the
|
||||
current list or the list specifed by "nr"
|
||||
idx index of the current entry in the list
|
||||
items quickfix list entries
|
||||
lines use 'errorformat' to extract items from a list
|
||||
of lines and return the resulting entries.
|
||||
Only a |List| type is accepted. The current
|
||||
quickfix list is not modified.
|
||||
nr get information for this quickfix list; zero
|
||||
means the current quickfix list and '$' means
|
||||
means the current quickfix list and "$" means
|
||||
the last quickfix list
|
||||
size number of entries in the quickfix list
|
||||
title get the list title
|
||||
winid get the |window-ID| (if opened)
|
||||
all all of the above quickfix properties
|
||||
Non-string items in {what} are ignored.
|
||||
If "nr" is not present then the current quickfix list is used.
|
||||
To get the number of lists in the quickfix stack, set 'nr' to
|
||||
'$' in {what}. The 'nr' value in the returned dictionary
|
||||
If both "nr" and a non-zero "id" are specified, then the list
|
||||
specified by "id" is used.
|
||||
To get the number of lists in the quickfix stack, set "nr" to
|
||||
"$" in {what}. The "nr" value in the returned dictionary
|
||||
contains the quickfix stack size.
|
||||
When "lines" is specified, all the other items except "efm"
|
||||
are ignored. The returned dictionary contains the entry
|
||||
"items" with the list of entries.
|
||||
In case of error processing {what}, an empty dictionary is
|
||||
returned.
|
||||
|
||||
The returned dictionary contains the following entries:
|
||||
context context information stored with |setqflist()|
|
||||
id quickfix list ID |quickfix-ID|
|
||||
idx index of the current entry in the list
|
||||
items quickfix list entries
|
||||
nr quickfix list number
|
||||
size number of entries in the quickfix list
|
||||
title quickfix list title text
|
||||
winid quickfix |window-ID| (if opened)
|
||||
|
||||
Examples: >
|
||||
:echo getqflist({'all': 1})
|
||||
:echo getqflist({'nr': 2, 'title': 1})
|
||||
:echo getqflist({'lines' : ["F1:10:L10"]})
|
||||
<
|
||||
|
||||
getreg([{regname} [, 1 [, {list}]]]) *getreg()*
|
||||
@@ -4731,11 +4787,15 @@ getwininfo([{winid}]) *getwininfo()*
|
||||
|
||||
Each List item is a Dictionary with the following entries:
|
||||
bufnr number of buffer in the window
|
||||
height window height
|
||||
height window height (excluding winbar)
|
||||
winbar 1 if the window has a toolbar, 0
|
||||
otherwise
|
||||
loclist 1 if showing a location list
|
||||
{only with the +quickfix feature}
|
||||
quickfix 1 if quickfix or location list window
|
||||
{only with the +quickfix feature}
|
||||
terminal 1 if a terminal window
|
||||
{only with the +terminal feature}
|
||||
tabnr tab page number
|
||||
variables a reference to the dictionary with
|
||||
window-local variables
|
||||
@@ -5190,6 +5250,9 @@ job_info({job}) *job_info()*
|
||||
Returns a Dictionary with information about {job}:
|
||||
"status" what |job_status()| returns
|
||||
"channel" what |job_getchannel()| returns
|
||||
"process" process ID
|
||||
"tty_in" terminal input name, empty when none
|
||||
"tty_out" terminal output name, empty when none
|
||||
"exitval" only valid when "status" is "dead"
|
||||
"exit_cb" function to be called on exit
|
||||
"stoponexit" |job-stoponexit|
|
||||
@@ -5202,6 +5265,7 @@ job_setoptions({job}, {options}) *job_setoptions()*
|
||||
job_start({command} [, {options}]) *job_start()*
|
||||
Start a job and return a Job object. Unlike |system()| and
|
||||
|:!cmd| this does not wait for the job to finish.
|
||||
To start a job in a terminal window see |term_start()|.
|
||||
|
||||
{command} can be a String. This works best on MS-Windows. On
|
||||
Unix it is split up in white-separated parts to be passed to
|
||||
@@ -5614,6 +5678,7 @@ maparg({name}[, {mode} [, {abbr} [, {dict}]]]) *maparg()*
|
||||
"s" Select
|
||||
"x" Visual
|
||||
"l" langmap |language-mapping|
|
||||
"t" Terminal-Job
|
||||
"" Normal, Visual and Operator-pending
|
||||
When {mode} is omitted, the modes for "" are used.
|
||||
|
||||
@@ -5940,7 +6005,7 @@ mode([expr]) Return a string that indicates the current mode.
|
||||
a non-empty String (|non-zero-arg|), then the full mode is
|
||||
returned, otherwise only the first letter is returned.
|
||||
|
||||
n Normal
|
||||
n Normal, Terminal-Normal
|
||||
no Operator-pending
|
||||
v Visual by character
|
||||
V Visual by line
|
||||
@@ -5962,6 +6027,7 @@ mode([expr]) Return a string that indicates the current mode.
|
||||
rm The -- more -- prompt
|
||||
r? A |:confirm| query of some sort
|
||||
! Shell or external command is executing
|
||||
t Terminal-Job mode: keys go to the job
|
||||
This is useful in the 'statusline' option or when used
|
||||
with |remote_expr()| In most other places it always returns
|
||||
"c" or "n".
|
||||
@@ -6807,6 +6873,19 @@ serverlist() *serverlist()*
|
||||
Example: >
|
||||
:echo serverlist()
|
||||
<
|
||||
setbufline({expr}, {lnum}, {text}) *setbufline()*
|
||||
Set line {lnum} to {text} in buffer {expr}. To insert
|
||||
lines use |append()|.
|
||||
|
||||
For the use of {expr}, see |bufname()| above.
|
||||
|
||||
{lnum} is used like with |setline()|.
|
||||
This works like |setline()| for the specified buffer.
|
||||
On success 0 is returned, on failure 1 is returned.
|
||||
|
||||
If {expr} is not a valid buffer or {lnum} is not valid, an
|
||||
error message is given.
|
||||
|
||||
setbufvar({expr}, {varname}, {val}) *setbufvar()*
|
||||
Set option or local variable {varname} in buffer {expr} to
|
||||
{val}.
|
||||
@@ -6875,13 +6954,19 @@ setfperm({fname}, {mode}) *setfperm()* *chmod*
|
||||
|
||||
setline({lnum}, {text}) *setline()*
|
||||
Set line {lnum} of the current buffer to {text}. To insert
|
||||
lines use |append()|.
|
||||
lines use |append()|. To set lines in another buffer use
|
||||
|setbufline()|.
|
||||
|
||||
{lnum} is used like with |getline()|.
|
||||
When {lnum} is just below the last line the {text} will be
|
||||
added as a new line.
|
||||
|
||||
If this succeeds, 0 is returned. If this fails (most likely
|
||||
because {lnum} is invalid) 1 is returned. Example: >
|
||||
because {lnum} is invalid) 1 is returned.
|
||||
|
||||
Example: >
|
||||
:call setline(5, strftime("%c"))
|
||||
|
||||
< When {text} is a |List| then line {lnum} and following lines
|
||||
will be set to the items in the list. Example: >
|
||||
:call setline(5, ['aaa', 'bbb', 'ccc'])
|
||||
@@ -6889,6 +6974,7 @@ setline({lnum}, {text}) *setline()*
|
||||
:for [n, l] in [[5, 'aaa'], [6, 'bbb'], [7, 'ccc']]
|
||||
: call setline(n, l)
|
||||
:endfor
|
||||
|
||||
< Note: The '[ and '] marks are not set.
|
||||
|
||||
setloclist({nr}, {list}[, {action}[, {what}]]) *setloclist()*
|
||||
@@ -6960,10 +7046,12 @@ setpos({expr}, {list})
|
||||
|winrestview()|.
|
||||
|
||||
setqflist({list} [, {action}[, {what}]]) *setqflist()*
|
||||
Create or replace or add to the quickfix list using the items
|
||||
in {list}. Each item in {list} is a dictionary.
|
||||
Non-dictionary items in {list} are ignored. Each dictionary
|
||||
item can contain the following entries:
|
||||
Create or replace or add to the quickfix list.
|
||||
|
||||
When {what} is not present, use the items in {list}. Each
|
||||
item must be a dictionary. Non-dictionary items in {list} are
|
||||
ignored. Each dictionary item can contain the following
|
||||
entries:
|
||||
|
||||
bufnr buffer number; must be the number of a valid
|
||||
buffer
|
||||
@@ -7008,27 +7096,41 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
|
||||
freed.
|
||||
|
||||
If {action} is not present or is set to ' ', then a new list
|
||||
is created.
|
||||
is created. The new quickfix list is added after the current
|
||||
quickfix list in the stack and all the following lists are
|
||||
freed. To add a new quickfix list at the end of the stack,
|
||||
set "nr" in {what} to "$".
|
||||
|
||||
If the optional {what} dictionary argument is supplied, then
|
||||
only the items listed in {what} are set. The first {list}
|
||||
argument is ignored. The following items can be specified in
|
||||
{what}:
|
||||
context any Vim type can be stored as a context
|
||||
efm errorformat to use when parsing text from
|
||||
"lines". If this is not present, then the
|
||||
'errorformat' option value is used.
|
||||
id quickfix list identifier |quickfix-ID|
|
||||
items list of quickfix entries. Same as the {list}
|
||||
argument.
|
||||
lines use 'errorformat' to parse a list of lines and
|
||||
add the resulting entries to the quickfix list
|
||||
{nr} or {id}. Only a |List| value is supported.
|
||||
nr list number in the quickfix stack; zero
|
||||
means the current quickfix list and '$' means
|
||||
means the current quickfix list and "$" means
|
||||
the last quickfix list
|
||||
title quickfix list title text
|
||||
Unsupported keys in {what} are ignored.
|
||||
If the "nr" item is not present, then the current quickfix list
|
||||
is modified. When creating a new quickfix list, "nr" can be
|
||||
set to a value one greater than the quickfix stack size.
|
||||
When modifying a quickfix list, to guarantee that the correct
|
||||
list is modified, "id" should be used instead of "nr" to
|
||||
specify the list.
|
||||
|
||||
Examples: >
|
||||
:call setqflist([], 'r', {'title': 'My search'})
|
||||
:call setqflist([], 'r', {'nr': 2, 'title': 'Errors'})
|
||||
:call setqflist([], 'r', {'title': 'My search'})
|
||||
:call setqflist([], 'r', {'nr': 2, 'title': 'Errors'})
|
||||
:call setqflist([], 'a', {'id':myid, 'lines':["F1:10:L10"]})
|
||||
<
|
||||
Returns zero for success, -1 for failure.
|
||||
|
||||
@@ -7070,16 +7172,17 @@ setreg({regname}, {value} [, {options}])
|
||||
:call setreg('a', "1\n2\n3", 'b5')
|
||||
|
||||
< This example shows using the functions to save and restore a
|
||||
register (note: you may not reliably restore register value
|
||||
without using the third argument to |getreg()| as without it
|
||||
newlines are represented as newlines AND Nul bytes are
|
||||
represented as newlines as well, see |NL-used-for-Nul|). >
|
||||
register: >
|
||||
:let var_a = getreg('a', 1, 1)
|
||||
:let var_amode = getregtype('a')
|
||||
....
|
||||
:call setreg('a', var_a, var_amode)
|
||||
< Note: you may not reliably restore register value
|
||||
without using the third argument to |getreg()| as without it
|
||||
newlines are represented as newlines AND Nul bytes are
|
||||
represented as newlines as well, see |NL-used-for-Nul|.
|
||||
|
||||
< You can also change the type of a register by appending
|
||||
You can also change the type of a register by appending
|
||||
nothing: >
|
||||
:call setreg('a', '', 'al')
|
||||
|
||||
@@ -7659,6 +7762,7 @@ synIDattr({synID}, {what} [, {mode}]) *synIDattr()*
|
||||
"standout" "1" if standout
|
||||
"underline" "1" if underlined
|
||||
"undercurl" "1" if undercurled
|
||||
"strike" "1" if strikethrough
|
||||
|
||||
Example (echoes the color of the syntax item under the
|
||||
cursor): >
|
||||
@@ -7688,12 +7792,12 @@ synconcealed({lnum}, {col}) *synconcealed()*
|
||||
the text is "123456" and both "23" and "45" are concealed
|
||||
and replace by the character "X", then:
|
||||
call returns ~
|
||||
synconcealed(lnum, 1) [0, '', 0]
|
||||
synconcealed(lnum, 2) [1, 'X', 1]
|
||||
synconcealed(lnum, 3) [1, 'X', 1]
|
||||
synconcealed(lnum, 4) [1, 'X', 2]
|
||||
synconcealed(lnum, 5) [1, 'X', 2]
|
||||
synconcealed(lnum, 6) [0, '', 0]
|
||||
synconcealed(lnum, 1) [0, '', 0]
|
||||
synconcealed(lnum, 2) [1, 'X', 1]
|
||||
synconcealed(lnum, 3) [1, 'X', 1]
|
||||
synconcealed(lnum, 4) [1, 'X', 2]
|
||||
synconcealed(lnum, 5) [1, 'X', 2]
|
||||
synconcealed(lnum, 6) [0, '', 0]
|
||||
|
||||
|
||||
synstack({lnum}, {col}) *synstack()*
|
||||
@@ -7902,6 +8006,12 @@ tempname() *tempname()* *temp-file-name*
|
||||
For MS-Windows forward slashes are used when the 'shellslash'
|
||||
option is set or when 'shellcmdflag' starts with '-'.
|
||||
|
||||
term_getaltscreen({buf}) *term_getaltscreen()*
|
||||
Returns 1 if the terminal of {buf} is using the alternate
|
||||
screen.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getattr({attr}, {what}) *term_getattr()*
|
||||
Given {attr}, a value returned by term_scrape() in the "attr"
|
||||
item, return whether {what} is on. {what} can be one of:
|
||||
@@ -7910,59 +8020,118 @@ term_getattr({attr}, {what}) *term_getattr()*
|
||||
underline
|
||||
strike
|
||||
reverse
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getcursor({buf}) *term_getcursor()*
|
||||
Get the cusor position of terminal {buf}. Returns a list with
|
||||
three numbers: [rows, cols, visible]. "rows" and "cols" are
|
||||
zero based. "visible" is one when the cursor is visible, zero
|
||||
when it is hidden.
|
||||
|
||||
This is the cursor position of the terminal itself, not of the
|
||||
Vim window.
|
||||
Get the cursor position of terminal {buf}. Returns a list with
|
||||
two numbers and a dictionary: [row, col, dict].
|
||||
|
||||
"row" and "col" are one based, the first screen cell is row
|
||||
1, column 1. This is the cursor position of the terminal
|
||||
itself, not of the Vim window.
|
||||
|
||||
"dict" can have these members:
|
||||
"visible" one when the cursor is visible, zero when it
|
||||
is hidden.
|
||||
"blink" one when the cursor is visible, zero when it
|
||||
is hidden.
|
||||
"shape" 1 for a block cursor, 2 for underline and 3
|
||||
for a vertical bar.
|
||||
|
||||
{buf} must be the buffer number of a terminal window. If the
|
||||
buffer does not exist or is not a terminal window, an empty
|
||||
list is returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getjob({buf}) *term_getjob()*
|
||||
Get the Job associated with terminal window {buf}.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
Returns |v:null| when there is no job.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getline({buf} [, {row}]) *term_getline()*
|
||||
term_getline({buf}, {row}) *term_getline()*
|
||||
Get a line of text from the terminal window of {buf}.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
|
||||
The first line has {row} zero. When {row} is invalid an empty
|
||||
string is returned. When {row} is omitted, the cursor line is
|
||||
used.
|
||||
The first line has {row} one. When {row} is "." the cursor
|
||||
line is used. When {row} is invalid an empty string is
|
||||
returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getscrolled({buf}) *term_getscrolled()*
|
||||
Return the number of lines that scrolled to above the top of
|
||||
terminal {buf}. This is the offset between the row number
|
||||
used for |term_getline()| and |getline()|, so that: >
|
||||
term_getline(buf, N)
|
||||
< is equal to: >
|
||||
`getline(N + term_getscrolled(buf))
|
||||
< (if that line exists).
|
||||
|
||||
{buf} is used as with |term_getsize()|.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getsize({buf}) *term_getsize()*
|
||||
Get the size of terminal {buf}. Returns a list with two
|
||||
numbers: [rows, cols]. This is the size of the terminal, not
|
||||
the window containing the terminal.
|
||||
|
||||
{buf} must be the buffer number of a terminal window. Use an
|
||||
empty string for the current buffer. If the buffer does not
|
||||
exist or is not a terminal window, an empty list is returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getstatus({buf}) *term_getstatus()*
|
||||
Get the status of terminal {buf}. This returns a comma
|
||||
separated list of these items:
|
||||
running job is running
|
||||
finished job has finished
|
||||
normal in Terminal-Normal mode
|
||||
One of "running" or "finished" is always present.
|
||||
|
||||
{buf} must be the buffer number of a terminal window. If the
|
||||
buffer does not exist or is not a terminal window, an empty
|
||||
list is returned.
|
||||
string is returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_gettitle({buf}) *term_gettitle()*
|
||||
Get the title of terminal {buf}. This is the title that the
|
||||
job in the terminal has set.
|
||||
|
||||
{buf} must be the buffer number of a terminal window. If the
|
||||
buffer does not exist or is not a terminal window, an empty
|
||||
string is returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_gettty({buf} [, {input}]) *term_gettty()*
|
||||
Get the name of the controlling terminal associated with
|
||||
terminal window {buf}. {buf} is used as with |term_getsize()|.
|
||||
|
||||
When {input} is omitted or 0, return the name for writing
|
||||
(stdout). When {input} is 1 return the name for reading
|
||||
(stdin). On UNIX, both return same name.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_list() *term_list()*
|
||||
Return a list with the buffer numbers of all buffers for
|
||||
terminal windows.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_scrape({buf} [, {row}]) *term_scrape()*
|
||||
term_scrape({buf}, {row}) *term_scrape()*
|
||||
Get the contents of {row} of terminal screen of {buf}.
|
||||
For {buf} see |term_getsize()|.
|
||||
|
||||
The first {row} is zero. When {row} is invalid an empty list
|
||||
is returned. When {row} is omitted the cursor line is used.
|
||||
The first line has {row} one. When {row} is "." the cursor
|
||||
line is used. When {row} is invalid an empty string is
|
||||
returned.
|
||||
|
||||
Return a List containing a Dict for each screen cell:
|
||||
"chars" character(s) at the cell
|
||||
"fg" foreground color as #rrggbb
|
||||
"bg" background color as #rrggbb
|
||||
"attr" attributes of the cell, use term_getattr()
|
||||
to get the individual flags
|
||||
"attr" attributes of the cell, use |term_getattr()|
|
||||
to get the individual flags
|
||||
"width" cell width: 1 or 2
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_sendkeys({buf}, {keys}) *term_sendkeys()*
|
||||
Send keystrokes {keys} to terminal {buf}.
|
||||
@@ -7970,18 +8139,70 @@ term_sendkeys({buf}, {keys}) *term_sendkeys()*
|
||||
|
||||
{keys} are translated as key sequences. For example, "\<c-x>"
|
||||
means the character CTRL-X.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_setsize({buf}, {expr}) *term_setsize()*
|
||||
Not implemented yet.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_start({cmd}, {options}) *term_start()*
|
||||
Open a terminal window and run {cmd} in it.
|
||||
|
||||
Returns the buffer number of the terminal window.
|
||||
When opening the window fails zero is returned.
|
||||
Returns the buffer number of the terminal window. If {cmd}
|
||||
cannot be executed the window does open and shows an error
|
||||
message.
|
||||
If opening the window fails zero is returned.
|
||||
|
||||
{options} are not implemented yet.
|
||||
{options} are similar to what is used for |job_start()|, see
|
||||
|job-options|. However, not all options can be used. These
|
||||
are supported:
|
||||
all timeout options
|
||||
"stoponexit"
|
||||
"callback", "out_cb", "err_cb"
|
||||
"exit_cb", "close_cb"
|
||||
"in_io", "in_top", "in_bot", "in_name", "in_buf"
|
||||
"out_io", "out_name", "out_buf", "out_modifiable", "out_msg"
|
||||
"err_io", "err_name", "err_buf", "err_modifiable", "err_msg"
|
||||
However, at least one of stdin, stdout or stderr must be
|
||||
connected to the terminal. When I/O is connected to the
|
||||
terminal then the callback function for that part is not used.
|
||||
|
||||
term_wait({buf}) *term_wait()*
|
||||
There are extra options:
|
||||
"term_name" name to use for the buffer name, instead
|
||||
of the command name.
|
||||
"term_rows" vertical size to use for the terminal,
|
||||
instead of using 'termsize'
|
||||
"term_cols" horizontal size to use for the terminal,
|
||||
instead of using 'termsize'
|
||||
"vertical" split the window vertically
|
||||
"curwin" use the current window, do not split the
|
||||
window; fails if the current buffer
|
||||
cannot be |abandon|ed
|
||||
"hidden" do not open a window
|
||||
"term_finish" What to do when the job is finished:
|
||||
"close": close any windows
|
||||
"open": open window if needed
|
||||
Note that "open" can be interruptive.
|
||||
See |term++close| and |term++open|.
|
||||
"term_opencmd" command to use for opening the window when
|
||||
"open" is used for "term_finish"; must
|
||||
have "%d" where the buffer number goes,
|
||||
e.g. "10split|buffer %d"; when not
|
||||
specified "botright sbuf %d" is used
|
||||
"eof_chars" Text to send after all buffer lines were
|
||||
written to the terminal. When not set
|
||||
CTRL-D is used on MS-Windows. For Python
|
||||
use CTRL-Z or "exit()". For a shell use
|
||||
"exit". A CR is always added.
|
||||
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_wait({buf} [, {time}]) *term_wait()*
|
||||
Wait for pending updates of {buf} to be handled.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
{time} is how long to wait for updates to arrive in msec. If
|
||||
not set then 10 msec will be used.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
test_alloc_fail({id}, {countdown}, {repeat}) *test_alloc_fail()*
|
||||
This is for testing: If the memory allocation with {id} is
|
||||
@@ -7993,6 +8214,11 @@ test_autochdir() *test_autochdir()*
|
||||
Set a flag to enable the effect of 'autochdir' before Vim
|
||||
startup has finished.
|
||||
|
||||
test_feedinput({string}) *test_feedinput()*
|
||||
Characters in {string} are queued for processing as if they
|
||||
were typed by the user. This uses a low level input buffer.
|
||||
This function works only when with |+unix| or GUI is running.
|
||||
|
||||
test_garbagecollect_now() *test_garbagecollect_now()*
|
||||
Like garbagecollect(), but executed right away. This must
|
||||
only be called directly to avoid any structure to exist
|
||||
@@ -8048,7 +8274,7 @@ test_override({name}, {val}) *test_override()*
|
||||
in a way that the test doesn't work properly.
|
||||
When using: >
|
||||
call test_override('starting', 1)
|
||||
< The value of "starting" is saved. It is restored by: >
|
||||
< The value of "starting" is saved. It is restored by: >
|
||||
call test_override('starting', 0)
|
||||
|
||||
test_settime({expr}) *test_settime()*
|
||||
@@ -8350,7 +8576,7 @@ win_getid([{win} [, {tab}]]) *win_getid()*
|
||||
Get the |window-ID| for the specified window.
|
||||
When {win} is missing use the current window.
|
||||
With {win} this is the window number. The top window has
|
||||
number 1.
|
||||
number 1. Use `win_getid(winnr())` for the current window.
|
||||
Without {tab} use the current tab, otherwise the tab with
|
||||
number {tab}. The first tab has number one.
|
||||
Return zero if the window cannot be found.
|
||||
@@ -8390,6 +8616,7 @@ winheight({nr}) *winheight()*
|
||||
When {nr} is zero, the height of the current window is
|
||||
returned. When window {nr} doesn't exist, -1 is returned.
|
||||
An existing window always has a height of zero or more.
|
||||
This excludes any window toolbar line.
|
||||
Examples: >
|
||||
:echo "The current window has " . winheight(0) . " lines."
|
||||
<
|
||||
@@ -8497,7 +8724,7 @@ wordcount() *wordcount()*
|
||||
(only in Visual mode)
|
||||
visual_chars Number of chars visually selected
|
||||
(only in Visual mode)
|
||||
visual_words Number of chars visually selected
|
||||
visual_words Number of words visually selected
|
||||
(only in Visual mode)
|
||||
|
||||
|
||||
@@ -8706,6 +8933,7 @@ tag_any_white Compiled with support for any white characters in tags
|
||||
files |tag-any-white|.
|
||||
tcl Compiled with Tcl interface.
|
||||
termguicolors Compiled with true color in terminal support.
|
||||
terminal Compiled with |terminal| support.
|
||||
terminfo Compiled with terminfo instead of termcap.
|
||||
termresponse Compiled with support for |t_RV| and |v:termresponse|.
|
||||
textobjects Compiled with support for |text-objects|.
|
||||
@@ -8716,7 +8944,7 @@ title Compiled with window title support |'title'|.
|
||||
toolbar Compiled with support for |gui-toolbar|.
|
||||
ttyin input is a terminal (tty)
|
||||
ttyout output is a terminal (tty)
|
||||
unix Unix version of Vim.
|
||||
unix Unix version of Vim. *+unix*
|
||||
unnamedplus Compiled with support for "unnamedplus" in 'clipboard'
|
||||
user_commands User-defined commands.
|
||||
vertsplit Compiled with vertically split windows |:vsplit|.
|
||||
|
||||
@@ -116,13 +116,13 @@ g:rustfmt_options~
|
||||
|
||||
*g:rust_playpen_url*
|
||||
g:rust_playpen_url~
|
||||
Set this option to override the url for the playpen to use: >
|
||||
Set this option to override the URL for the playpen to use: >
|
||||
let g:rust_playpen_url = 'https://play.rust-lang.org/'
|
||||
<
|
||||
|
||||
*g:rust_shortener_url*
|
||||
g:rust_shortener_url~
|
||||
Set this option to override the url for the url shortener: >
|
||||
Set this option to override the URL for the URL shortener: >
|
||||
let g:rust_shortener_url = 'https://is.gd/'
|
||||
<
|
||||
|
||||
@@ -199,7 +199,7 @@ COMMANDS *rust-commands*
|
||||
|g:rust_playpen_url| is the base URL to the playpen, by default
|
||||
"https://play.rust-lang.org/".
|
||||
|
||||
|g:rust_shortener_url| is the base url for the shorterner, by
|
||||
|g:rust_shortener_url| is the base URL for the shorterner, by
|
||||
default "https://is.gd/"
|
||||
|
||||
:RustFmt *:RustFmt*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*gui.txt* For Vim version 8.0. Last change: 2017 Jul 15
|
||||
*gui.txt* For Vim version 8.0. Last change: 2017 Sep 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -67,7 +67,7 @@ When the GUI starts up initializations are carried out, in this order:
|
||||
executed as an Ex command.
|
||||
- If the user gvimrc file exists, it is sourced. The name of this file is
|
||||
normally "$HOME/.gvimrc". You can check this with ":version".
|
||||
- For Win32, when $HOME is not set, "$VIM\_gvimrc" is used.
|
||||
- For Win32, $HOME is set by Vim if needed, see |$HOME-windows|.
|
||||
- When a "_gvimrc" file is not found, ".gvimrc" is tried too. And vice
|
||||
versa.
|
||||
The name of the first file found is stored in $MYGVIMRC, unless it was
|
||||
@@ -784,10 +784,34 @@ In the Win32 and GTK+ GUI, starting a menu name with ']' excludes that menu
|
||||
from the main menu bar. You must then use the |:popup| or |:tearoff| command
|
||||
to display it.
|
||||
|
||||
*window-toolbar* *WinBar*
|
||||
Each window can have a local toolbar. This uses the first line of the window,
|
||||
thus reduces the space for the text by one line. The items in the toolbar
|
||||
must start with "WinBar".
|
||||
|
||||
Only text can be used. When using Unicode, special characters can be used to
|
||||
make the items look like icons.
|
||||
|
||||
If the items do not fit then the last ones cannot be used. The toolbar does
|
||||
not wrap.
|
||||
|
||||
Example for debugger tools: >
|
||||
amenu 1.10 WinBar.Step :Step<CR>
|
||||
amenu 1.20 WinBar.Next :Next<CR>
|
||||
amenu 1.30 WinBar.Finish :Finish<CR>
|
||||
amenu 1.40 WinBar.Cont :Continue<CR>
|
||||
<
|
||||
The window toolbar uses the ToolbarLine and ToolbarButton highlight groups.
|
||||
|
||||
When splitting the window the window toolbar is not copied to the new window.
|
||||
|
||||
*popup-menu*
|
||||
In the Win32, GTK+, Motif, Athena and Photon GUI, you can define the
|
||||
special menu "PopUp". This is the menu that is displayed when the right mouse
|
||||
button is pressed, if 'mousemodel' is set to popup or popup_setpos.
|
||||
Example: >
|
||||
nnoremenu 1.40 PopUp.&Paste "+gP
|
||||
menu PopUp
|
||||
|
||||
|
||||
5.3 Showing What Menus Are Mapped To *showing-menus*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*gui_x11.txt* For Vim version 8.0. Last change: 2017 Jun 27
|
||||
*gui_x11.txt* For Vim version 8.0. Last change: 2017 Jul 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -673,7 +673,7 @@ Of these three, Vim uses PRIMARY when reading and writing the "* register
|
||||
register. Vim does not access the SECONDARY selection.
|
||||
|
||||
Examples: (assuming the default option values)
|
||||
- Select an URL in Visual mode in Vim. Go to your browser and click the
|
||||
- Select a URL in Visual mode in Vim. Go to your browser and click the
|
||||
middle mouse button in the URL text field. The selected text will be
|
||||
inserted (hopefully!). Note: in Firefox you can set the
|
||||
middlemouse.contentLoadURL preference to true in about:config, then the
|
||||
|
||||
@@ -894,10 +894,10 @@ On Ubuntu you will want to install these packages for Python 2:
|
||||
python-dev
|
||||
For Python 3:
|
||||
python3
|
||||
pytyon3-dev
|
||||
python3-dev
|
||||
For Python 3.6:
|
||||
python3.6
|
||||
pytyon3.6-dev
|
||||
python3.6-dev
|
||||
|
||||
If you have more than one version of Python 3, you need to link python3 to the
|
||||
one you prefer, before running configure.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 8.0. Last change: 2017 Jul 16
|
||||
*index.txt* For Vim version 8.0. Last change: 2017 Aug 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -528,8 +528,10 @@ tag command action in Normal mode ~
|
||||
|CTRL-W_CTRL-]| CTRL-W CTRL-] same as "CTRL-W ]"
|
||||
|CTRL-W_CTRL-^| CTRL-W CTRL-^ same as "CTRL-W ^"
|
||||
|CTRL-W_CTRL-_| CTRL-W CTRL-_ same as "CTRL-W _"
|
||||
|CTRL-W_quote| CTRL-W " terminal window: paste register
|
||||
|CTRL-W_+| CTRL-W + increase current window height N lines
|
||||
|CTRL-W_-| CTRL-W - decrease current window height N lines
|
||||
|CTRL-W_.| CTRL-W . terminal window: type CTRL-W
|
||||
|CTRL-W_:| CTRL-W : same as |:|, edit a command line
|
||||
|CTRL-W_<| CTRL-W < decrease current window width N columns
|
||||
|CTRL-W_=| CTRL-W = make all windows the same height & width
|
||||
@@ -538,6 +540,7 @@ tag command action in Normal mode ~
|
||||
|CTRL-W_J| CTRL-W J move current window to the very bottom
|
||||
|CTRL-W_K| CTRL-W K move current window to the very top
|
||||
|CTRL-W_L| CTRL-W L move current window to the far right
|
||||
|CTRL-W_N| CTRL-W N terminal window: go to Terminal Normal mode
|
||||
|CTRL-W_P| CTRL-W P go to preview window
|
||||
|CTRL-W_R| CTRL-W R rotate windows upwards N times
|
||||
|CTRL-W_S| CTRL-W S same as "CTRL-W s"
|
||||
@@ -1580,13 +1583,17 @@ tag command action ~
|
||||
|:tjump| :tj[ump] like ":tselect", but jump directly when there
|
||||
is only one match
|
||||
|:tlast| :tl[ast] jump to last matching tag
|
||||
|:tmapclear| :tmapc[lear] remove all mappings for Terminal-Job mode
|
||||
|:tmap| :tma[p] like ":map" but for Terminal-Job mode
|
||||
|:tmenu| :tm[enu] define menu tooltip
|
||||
|:tnext| :tn[ext] jump to next matching tag
|
||||
|:tnoremap| :tno[remap] like ":noremap" but for Terminal-Job mode
|
||||
|:topleft| :to[pleft] make split window appear at top or far left
|
||||
|:tprevious| :tp[revious] jump to previous matching tag
|
||||
|:trewind| :tr[ewind] jump to first matching tag
|
||||
|:try| :try execute commands, abort on error or exception
|
||||
|:tselect| :ts[elect] list matching tags and select one
|
||||
|:tunmap| :tunma[p] like ":unmap" but for Terminal-Job mode
|
||||
|:tunmenu| :tu[nmenu] remove menu tooltip
|
||||
|:undo| :u[ndo] undo last change(s)
|
||||
|:undojoin| :undoj[oin] join next change with previous undo block
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*intro.txt* For Vim version 8.0. Last change: 2017 Jul 17
|
||||
*intro.txt* For Vim version 8.0. Last change: 2017 Sep 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -264,6 +264,10 @@ Vim would never have become what it is now, without the help of these people!
|
||||
Juergen Weigert Lattice version, AUX improvements, UNIX and
|
||||
MS-DOS ports, autoconf
|
||||
Stefan 'Sec' Zehl Maintainer of vim.org
|
||||
Yasuhiro Matsumoto many MS-Windows improvements
|
||||
Ken Takata fixes and features
|
||||
Kazunobu Kuriyama GTK 3
|
||||
Christian Brabandt many fixes, features, user support, etc.
|
||||
|
||||
I wish to thank all the people that sent me bug reports and suggestions. The
|
||||
list is too long to mention them all here. Vim would not be the same without
|
||||
@@ -530,7 +534,7 @@ examples and use them directly. Or type them literally, including the '<' and
|
||||
==============================================================================
|
||||
5. Modes, introduction *vim-modes-intro* *vim-modes*
|
||||
|
||||
Vim has six BASIC modes:
|
||||
Vim has seven BASIC modes:
|
||||
|
||||
*Normal* *Normal-mode* *command-mode*
|
||||
Normal mode In Normal mode you can enter all the normal editor
|
||||
@@ -566,7 +570,12 @@ Ex mode Like Command-line mode, but after entering a command
|
||||
you remain in Ex mode. Very limited editing of the
|
||||
command line. |Ex-mode|
|
||||
|
||||
There are six ADDITIONAL modes. These are variants of the BASIC modes:
|
||||
Terminal-Job mode Interacting with a job in a terminal window. Typed
|
||||
keys go to the job and the job output is displayed in
|
||||
the terminal window. See |terminal| about how to
|
||||
switch to other modes.
|
||||
|
||||
There are seven ADDITIONAL modes. These are variants of the BASIC modes:
|
||||
|
||||
*Operator-pending* *Operator-pending-mode*
|
||||
Operator-pending mode This is like Normal mode, but after an operator
|
||||
@@ -592,6 +601,10 @@ Insert Normal mode Entered when CTRL-O given in Insert mode. This is
|
||||
If the 'showmode' option is on "-- (insert) --" is
|
||||
shown at the bottom of the window.
|
||||
|
||||
Terminal-Normal mode Using Normal mode in a terminal window. Making
|
||||
changes is impossible. Use an insert command, such as
|
||||
"a" or "i", to return to Terminal-Job mode.
|
||||
|
||||
Insert Visual mode Entered when starting a Visual selection from Insert
|
||||
mode, e.g., by using CTRL-O and then "v", "V" or
|
||||
CTRL-V. When the Visual selection ends, Vim returns
|
||||
@@ -666,6 +679,8 @@ Normal mode from any other mode. This can be used to make sure Vim is in
|
||||
Normal mode, without causing a beep like <Esc> would. However, this does not
|
||||
work in Ex mode. When used after a command that takes an argument, such as
|
||||
|f| or |m|, the timeout set with 'ttimeoutlen' applies.
|
||||
When focus is in a terminal window, CTRL-\ CTRL-N goes to Normal mode for only
|
||||
one command, see |t_CTRL-\_CTRL-N|.
|
||||
|
||||
*CTRL-\_CTRL-G* *i_CTRL-\_CTRL-G* *c_CTRL-\_CTRL-G* *v_CTRL-\_CTRL-G*
|
||||
The command CTRL-\ CTRL-G or <C-\><C-G> can be used to go to Insert mode when
|
||||
@@ -828,10 +843,12 @@ by Vim. {Vi: not ok}
|
||||
==============================================================================
|
||||
8. Definitions *definitions*
|
||||
|
||||
buffer Contains lines of text, usually read from a file.
|
||||
screen The whole area that Vim uses to work in. This can be
|
||||
a terminal emulator window. Also called "the Vim
|
||||
window".
|
||||
window A view on a buffer.
|
||||
window A view on a buffer. There can be multiple windows for
|
||||
one buffer.
|
||||
|
||||
A screen contains one or more windows, separated by status lines and with the
|
||||
command line at the bottom.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 8.0. Last change: 2017 May 30
|
||||
*map.txt* For Vim version 8.0. Last change: 2017 Sep 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -55,6 +55,7 @@ modes.
|
||||
:im[ap] {lhs} {rhs} |mapmode-i| *:im* *:imap*
|
||||
:lm[ap] {lhs} {rhs} |mapmode-l| *:lm* *:lmap*
|
||||
:cm[ap] {lhs} {rhs} |mapmode-c| *:cm* *:cmap*
|
||||
:tma[p] {lhs} {rhs} |mapmode-t| *:tma* *:tmap*
|
||||
Map the key sequence {lhs} to {rhs} for the modes
|
||||
where the map command applies. The result, including
|
||||
{rhs}, is then further scanned for mappings. This
|
||||
@@ -71,6 +72,7 @@ modes.
|
||||
:ino[remap] {lhs} {rhs} |mapmode-i| *:ino* *:inoremap*
|
||||
:ln[oremap] {lhs} {rhs} |mapmode-l| *:ln* *:lnoremap*
|
||||
:cno[remap] {lhs} {rhs} |mapmode-c| *:cno* *:cnoremap*
|
||||
:tno[remap] {lhs} {rhs} |mapmode-t| *:tno* *:tnoremap*
|
||||
Map the key sequence {lhs} to {rhs} for the modes
|
||||
where the map command applies. Disallow mapping of
|
||||
{rhs}, to avoid nested and recursive mappings. Often
|
||||
@@ -87,6 +89,7 @@ modes.
|
||||
:iu[nmap] {lhs} |mapmode-i| *:iu* *:iunmap*
|
||||
:lu[nmap] {lhs} |mapmode-l| *:lu* *:lunmap*
|
||||
:cu[nmap] {lhs} |mapmode-c| *:cu* *:cunmap*
|
||||
:tunma[p] {lhs} |mapmode-t| *:tunma* *:tunmap*
|
||||
Remove the mapping of {lhs} for the modes where the
|
||||
map command applies. The mapping may remain defined
|
||||
for other modes where it applies.
|
||||
@@ -105,6 +108,7 @@ modes.
|
||||
:imapc[lear] |mapmode-i| *:imapc* *:imapclear*
|
||||
:lmapc[lear] |mapmode-l| *:lmapc* *:lmapclear*
|
||||
:cmapc[lear] |mapmode-c| *:cmapc* *:cmapclear*
|
||||
:tmapc[lear] |mapmode-t| *:tmapc* *:tmapclear*
|
||||
Remove ALL mappings for the modes where the map
|
||||
command applies. {not in Vi}
|
||||
Use the <buffer> argument to remove buffer-local
|
||||
@@ -121,6 +125,7 @@ modes.
|
||||
:im[ap] |mapmode-i|
|
||||
:lm[ap] |mapmode-l|
|
||||
:cm[ap] |mapmode-c|
|
||||
:tma[p] |mapmode-t|
|
||||
List all key mappings for the modes where the map
|
||||
command applies. Note that ":map" and ":map!" are
|
||||
used most often, because they include the other modes.
|
||||
@@ -135,6 +140,7 @@ modes.
|
||||
:im[ap] {lhs} |mapmode-i| *:imap_l*
|
||||
:lm[ap] {lhs} |mapmode-l| *:lmap_l*
|
||||
:cm[ap] {lhs} |mapmode-c| *:cmap_l*
|
||||
:tma[p] {lhs} |mapmode-t| *:tmap_l*
|
||||
List the key mappings for the key sequences starting
|
||||
with {lhs} in the modes where the map command applies.
|
||||
{not in Vi}
|
||||
@@ -318,6 +324,7 @@ Overview of which map command works in which mode. More details below.
|
||||
:imap :inoremap :iunmap Insert
|
||||
:lmap :lnoremap :lunmap Insert, Command-line, Lang-Arg
|
||||
:cmap :cnoremap :cunmap Command-line
|
||||
:tmap :tnoremap :tunmap Terminal-Job
|
||||
|
||||
|
||||
COMMANDS MODES ~
|
||||
@@ -358,6 +365,10 @@ Therefore the ":map" and ":map!" commands enter and display mappings for
|
||||
several modes. In Vim you can use the ":nmap", ":vmap", ":omap", ":cmap" and
|
||||
":imap" commands to enter mappings for each mode separately.
|
||||
|
||||
*mapmode-t*
|
||||
The terminal mappings are used in a terminal window, when typing keys for the
|
||||
job running in the terminal. See |terminal-typing|.
|
||||
|
||||
*omap-info*
|
||||
Operator-pending mappings can be used to define a movement command that can be
|
||||
used with any operator. Simple example: ":omap { w" makes "y{" work like "yw"
|
||||
@@ -418,6 +429,7 @@ When listing mappings the characters in the first two columns are:
|
||||
i Insert
|
||||
l ":lmap" mappings for Insert, Command-line and Lang-Arg
|
||||
c Command-line
|
||||
t Terminal-Job
|
||||
|
||||
Just before the {rhs} a special character can appear:
|
||||
* indicates that it is not remappable
|
||||
@@ -682,7 +694,7 @@ option). After that it assumes that the 'q' is to be interpreted as such. If
|
||||
you type slowly, or your system is slow, reset the 'timeout' option. Then you
|
||||
might want to set the 'ttimeout' option.
|
||||
|
||||
*map-precedence*
|
||||
*map-precedence*
|
||||
Buffer-local mappings (defined using |:map-<buffer>|) take precedence over
|
||||
global mappings. When a buffer-local mapping is the same as a global mapping,
|
||||
Vim will use the buffer-local mapping. In addition, Vim will use a complete
|
||||
@@ -1279,6 +1291,7 @@ completion can be enabled:
|
||||
-complete=highlight highlight groups
|
||||
-complete=history :history suboptions
|
||||
-complete=locale locale names (as output of locale -a)
|
||||
-complete=mapclear buffer argument
|
||||
-complete=mapping mapping name
|
||||
-complete=menu menus
|
||||
-complete=messages |:messages| suboptions
|
||||
@@ -1414,6 +1427,8 @@ The valid escape sequences are
|
||||
<line1> The starting line of the command range.
|
||||
*<line2>*
|
||||
<line2> The final line of the command range.
|
||||
*<range>*
|
||||
<range> The number of items in the command range: 0, 1 or 2
|
||||
*<count>*
|
||||
<count> Any count supplied (as described for the '-range'
|
||||
and '-count' attributes).
|
||||
|
||||
@@ -832,6 +832,9 @@ Use the RPM or port for your system.
|
||||
|
||||
Currently, GUI Vim supports three styles, |OverTheSpot|, |OffTheSpot| and
|
||||
|Root|.
|
||||
When compiled with |+GUI_GTK| feature, GUI Vim supports two styles,
|
||||
|OnTheSpot| and |OverTheSpot|. You can select the style with the 'imstyle'
|
||||
option.
|
||||
|
||||
*. on-the-spot *OnTheSpot*
|
||||
Preedit Area and Status Area are performed by the client application in
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Jul 23
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Sep 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -417,12 +417,23 @@ On Unix systems the form "${HOME}" can be used too. The name between {} can
|
||||
contain non-id characters then. Note that if you want to use this for the
|
||||
"gf" command, you need to add the '{' and '}' characters to 'isfname'.
|
||||
|
||||
On MS-Windows, if $HOME is not defined as an environment variable, then
|
||||
at runtime Vim will set it to the expansion of $HOMEDRIVE$HOMEPATH.
|
||||
|
||||
NOTE: expanding environment variables and "~/" is only done with the ":set"
|
||||
command, not when assigning a value to an option with ":let".
|
||||
|
||||
*$HOME-windows*
|
||||
On MS-Windows, if $HOME is not defined as an environment variable, then
|
||||
at runtime Vim will set it to the expansion of $HOMEDRIVE$HOMEPATH.
|
||||
If $HOMEDRIVE is not set then $USERPROFILE is used.
|
||||
|
||||
This expanded value is not exported to the environment, this matters when
|
||||
running an external command: >
|
||||
:echo system('set | findstr ^HOME=')
|
||||
and >
|
||||
:echo luaeval('os.getenv("HOME")')
|
||||
should echo nothing (an empty string) despite exists('$HOME') being true.
|
||||
When setting $HOME to a non-empty string it will be exported to the
|
||||
subprocesses.
|
||||
|
||||
|
||||
Note the maximum length of an expanded option is limited. How much depends on
|
||||
the system, mostly it is something like 256 or 1024 characters.
|
||||
@@ -721,7 +732,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
Vim may set this option automatically at startup time when Vim is
|
||||
compiled with the |+termresponse| feature and if |t_u7| is set to the
|
||||
escape sequence to request cursor position report.
|
||||
escape sequence to request cursor position report. The response can
|
||||
be found in |v:termu7resp|.
|
||||
|
||||
*'antialias'* *'anti'* *'noantialias'* *'noanti'*
|
||||
'antialias' 'anti' boolean (default: off)
|
||||
@@ -869,11 +881,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
< Vim will guess the value. In the GUI this should work correctly,
|
||||
in other cases Vim might not be able to guess the right value.
|
||||
|
||||
When the t_BG option is set, Vim will use it to request the background
|
||||
When the |t_RB| option is set, Vim will use it to request the background
|
||||
color from the terminal. If the returned RGB value is dark/light and
|
||||
'background' is not dark/light, 'background' will be set and the
|
||||
screen is redrawn. This may have side effects, make t_BG empty in
|
||||
your .vimrc if you suspect this problem.
|
||||
your .vimrc if you suspect this problem. The response to |t_RB| can
|
||||
be found in |v:termrgbresp|.
|
||||
|
||||
When starting the GUI, the default value for 'background' will be
|
||||
"light". When the value is not set in the .gvimrc, and Vim detects
|
||||
@@ -889,6 +902,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
"screen.linux", "cygwin" or "putty", or $COLORFGBG suggests a dark
|
||||
background. Otherwise the default is "light".
|
||||
|
||||
The |:terminal| command and the |term_start()| function use the
|
||||
'background' value to decide whether the terminal window will start
|
||||
with a white or black background.
|
||||
|
||||
Normally this option would be set in the .vimrc file. Possibly
|
||||
depending on the terminal name. Example: >
|
||||
:if &term == "pcterm"
|
||||
@@ -4040,7 +4057,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
L:SpellLocal,-:Conceal,+:Pmenu,=:PmenuSel,
|
||||
x:PmenuSbar,X:PmenuThumb,*:TabLine,
|
||||
#:TabLineSel,_:TabLineFill,!:CursorColumn,
|
||||
.:CursorLine,o:ColorColumn,q:QuickFixLine")
|
||||
.:CursorLine,o:ColorColumn,q:QuickFixLine,
|
||||
z:StatusLineTerm,Z:StatusLineTermNC")
|
||||
global
|
||||
{not in Vi}
|
||||
This option can be used to set highlighting mode for various
|
||||
@@ -4099,6 +4117,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
s standout (termcap entry "so" and "se")
|
||||
u underline (termcap entry "us" and "ue")
|
||||
c undercurl (termcap entry "Cs" and "Ce")
|
||||
t strikethrough (termcap entry "Ts" and "Te")
|
||||
n no highlighting
|
||||
- no highlighting
|
||||
: use a highlight group
|
||||
@@ -4292,7 +4311,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
may change in later releases.
|
||||
|
||||
*'iminsert'* *'imi'*
|
||||
'iminsert' 'imi' number (default 0, 2 when an input method is supported)
|
||||
'iminsert' 'imi' number (default 0)
|
||||
local to buffer
|
||||
{not in Vi}
|
||||
Specifies whether :lmap or an Input Method (IM) is to be used in
|
||||
@@ -4315,7 +4334,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
methods. Use 'imdisable' to disable XIM then.
|
||||
|
||||
*'imsearch'* *'ims'*
|
||||
'imsearch' 'ims' number (default 0, 2 when an input method is supported)
|
||||
'imsearch' 'ims' number (default -1)
|
||||
local to buffer
|
||||
{not in Vi}
|
||||
Specifies whether :lmap or an Input Method (IM) is to be used when
|
||||
@@ -4350,6 +4369,23 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
<
|
||||
NOTE: This function is invoked very often. Keep it fast.
|
||||
|
||||
*'imstyle'* *'imst'*
|
||||
'imstyle' 'imst' number (default 1)
|
||||
global
|
||||
{not in Vi}
|
||||
{only available when compiled with |+xim| and
|
||||
|+GUI_GTK|}
|
||||
This option specifies the input style of Input Method:
|
||||
0 use on-the-spot style
|
||||
1 over-the-spot style
|
||||
See: |xim-input-style|
|
||||
|
||||
For a long time on-the-spot sytle had been used in GTK version of vim,
|
||||
however, it is known that it causes troubles when using mappings,
|
||||
|single-repeat|, etc. Therefore over-the-spot style becomes the
|
||||
default now. This should work fine for most people, however if you
|
||||
have any problem with it, try using on-the-spot style.
|
||||
|
||||
*'include'* *'inc'*
|
||||
'include' 'inc' string (default "^\s*#\s*include")
|
||||
global or local to buffer |global-local|
|
||||
@@ -7753,14 +7789,17 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
NOTE: This option is reset when 'compatible' is set.
|
||||
|
||||
*'termkey'* *'tk'*
|
||||
'termkey' 'tk' string (default "CTRL-W")
|
||||
'termkey' 'tk' string (default "")
|
||||
local to window
|
||||
{not in Vi}
|
||||
The key that precedes a Vim command in a terminal window. Other keys
|
||||
The key that starts a CTRL-W command in a terminal window. Other keys
|
||||
are sent to the job running in the window.
|
||||
The string must be one key stroke but can be multiple bytes.
|
||||
NOT IMPLEMENTED YET
|
||||
|
||||
The <> notation can be used, e.g.: >
|
||||
:set termkey=<C-L>
|
||||
< The string must be one key stroke but can be multiple bytes.
|
||||
When not set CTRL-W is used, so that CTRL-W : gets you to the command
|
||||
line. If 'termkey' is set to CTRL-L then CTRL-L : gets you to the
|
||||
command line.
|
||||
|
||||
*'termsize'* *'tms'*
|
||||
'termsize' 'tms' string (default "")
|
||||
@@ -8827,6 +8866,20 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
large number, it will cause errors when opening more than a few
|
||||
windows. A value of 0 to 12 is reasonable.
|
||||
|
||||
*'winptydll'*
|
||||
'winptydll' string (default "winpty32.dll" or "winpty64.dll")
|
||||
global
|
||||
{not in Vi}
|
||||
{only available when compiled with the |terminal|
|
||||
feature on MS-Windows}
|
||||
Specifies the name of the winpty shared library, used for the
|
||||
|:terminal| command. The default depends on whether was build as a
|
||||
32-bit or 64-bit executable. If not found, "winpty.dll" is tried as
|
||||
a fallback.
|
||||
Environment variables are expanded |:set_env|.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'winwidth'* *'wiw'* *E592*
|
||||
'winwidth' 'wiw' number (default 20)
|
||||
global
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*pi_getscript.txt* For Vim version 7.0. Last change: 2013 Nov 29
|
||||
*pi_getscript.txt* For Vim version 7.0. Last change: 2017 Aug 01
|
||||
>
|
||||
GETSCRIPT REFERENCE MANUAL by Charles E. Campbell
|
||||
<
|
||||
@@ -389,7 +389,7 @@ v36 Apr 22, 2013 : * (glts) suggested use of plugin/**/*.vim instead of
|
||||
plugin/*.vim in globpath() call.
|
||||
* (Andy Wokula) got warning message when setting
|
||||
g:loaded_getscriptPlugin
|
||||
v35 Apr 07, 2012 : * (MengHuan Yu) pointed out that the script url has
|
||||
v35 Apr 07, 2012 : * (MengHuan Yu) pointed out that the script URL has
|
||||
changed (somewhat). However, it doesn't work, and
|
||||
the original one does (under Linux). I'll make it
|
||||
yet-another-option.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickfix.txt* For Vim version 8.0. Last change: 2017 Jun 13
|
||||
*quickfix.txt* For Vim version 8.0. Last change: 2017 Sep 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -44,6 +44,13 @@ From inside Vim an easy way to run a command and handle the output is with the
|
||||
The 'errorformat' option should be set to match the error messages from your
|
||||
compiler (see |errorformat| below).
|
||||
|
||||
*quickfix-ID*
|
||||
Each quickfix list has a unique identifier called the quickfix ID and this
|
||||
number will not change within a Vim session. The getqflist() function can be
|
||||
used to get the identifier assigned to a list. There is also a quickfix list
|
||||
number which may change whenever more than ten lists are added to a quickfix
|
||||
stack.
|
||||
|
||||
*location-list* *E776*
|
||||
A location list is a window-local quickfix list. You get one after commands
|
||||
like `:lvimgrep`, `:lgrep`, `:lhelpgrep`, `:lmake`, etc., which create a
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickref.txt* For Vim version 8.0. Last change: 2017 Jul 15
|
||||
*quickref.txt* For Vim version 8.0. Last change: 2017 Sep 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -749,6 +749,7 @@ Short explanation of each option: *option-list*
|
||||
'iminsert' 'imi' use :lmap or IM in Insert mode
|
||||
'imsearch' 'ims' use :lmap or IM when typing a search pattern
|
||||
'imstatusfunc' 'imsf' function to obtain X input method status
|
||||
'imstyle' 'imst' specifies the input style of the input method
|
||||
'include' 'inc' pattern to be used to find an include file
|
||||
'includeexpr' 'inex' expression used to process an include line
|
||||
'incsearch' 'is' highlight match while typing search pattern
|
||||
@@ -954,6 +955,7 @@ Short explanation of each option: *option-list*
|
||||
'viewdir' 'vdir' directory where to store files with :mkview
|
||||
'viewoptions' 'vop' specifies what to save for :mkview
|
||||
'viminfo' 'vi' use .viminfo file upon startup and exiting
|
||||
'viminfofile' 'vif' file name used for the viminfo file
|
||||
'virtualedit' 've' when to use virtual editing
|
||||
'visualbell' 'vb' use visual bell instead of beeping
|
||||
'warn' warn for shell command when buffer was changed
|
||||
@@ -973,6 +975,7 @@ Short explanation of each option: *option-list*
|
||||
'winfixwidth' 'wfw' keep window width when opening/closing windows
|
||||
'winminheight' 'wmh' minimum number of lines for any window
|
||||
'winminwidth' 'wmw' minimal number of columns for any window
|
||||
'winptydll' name of the winpty dynamic library
|
||||
'winwidth' 'wiw' minimal number of columns for current window
|
||||
'wrap' long lines wrap and continue on the next line
|
||||
'wrapmargin' 'wm' chars from the right where wrapping starts
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*remote.txt* For Vim version 8.0. Last change: 2017 Mar 18
|
||||
*remote.txt* For Vim version 8.0. Last change: 2017 Aug 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -99,7 +99,7 @@ Tell the remote server "BLA" to write all files and exit: >
|
||||
vim --servername BLA --remote-send '<C-\><C-N>:wqa<CR>'
|
||||
|
||||
|
||||
SERVER NAME
|
||||
SERVER NAME *client-server-name*
|
||||
|
||||
By default Vim will try to register the name under which it was invoked (gvim,
|
||||
egvim ...). This can be overridden with the --servername argument. If the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 8.0. Last change: 2017 Jul 14
|
||||
*syntax.txt* For Vim version 8.0. Last change: 2017 Aug 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -2138,6 +2138,16 @@ set "msql_minlines" to the value you desire. Example: >
|
||||
:let msql_minlines = 200
|
||||
|
||||
|
||||
N1QL *n1ql.vim* *ft-n1ql-syntax*
|
||||
|
||||
N1QL is a SQL-like declarative language for manipulating JSON documents in
|
||||
Couchbase Server databases.
|
||||
|
||||
Vim syntax highlights N1QL statements, keywords, operators, types, comments,
|
||||
and special values. Vim ignores syntactical elements specific to SQL or its
|
||||
many dialects, like COLUMN or CHAR, that don't exist in N1QL.
|
||||
|
||||
|
||||
NCF *ncf.vim* *ft-ncf-syntax*
|
||||
|
||||
There is one option for NCF syntax highlighting.
|
||||
@@ -4689,23 +4699,26 @@ the same syntax file on all terminals, and use the optimal highlighting.
|
||||
|
||||
*bold* *underline* *undercurl*
|
||||
*inverse* *italic* *standout*
|
||||
*nocombine* *strikethrough*
|
||||
term={attr-list} *attr-list* *highlight-term* *E418*
|
||||
attr-list is a comma separated list (without spaces) of the
|
||||
following items (in any order):
|
||||
bold
|
||||
underline
|
||||
undercurl not always available
|
||||
strikethrough not always available
|
||||
reverse
|
||||
inverse same as reverse
|
||||
italic
|
||||
standout
|
||||
nocombine override attributes instead of combining them
|
||||
NONE no attributes used (used to reset it)
|
||||
|
||||
Note that "bold" can be used here and by using a bold font. They
|
||||
have the same effect.
|
||||
"undercurl" is a curly underline. When "undercurl" is not possible
|
||||
then "underline" is used. In general "undercurl" is only available in
|
||||
the GUI. The color is set with |highlight-guisp|.
|
||||
then "underline" is used. In general "undercurl" and "strikethrough"
|
||||
is only available in the GUI. The color is set with |highlight-guisp|.
|
||||
|
||||
start={term-list} *highlight-start* *E422*
|
||||
stop={term-list} *term-list* *highlight-stop*
|
||||
@@ -4870,7 +4883,8 @@ guifg={color-name} *highlight-guifg*
|
||||
guibg={color-name} *highlight-guibg*
|
||||
guisp={color-name} *highlight-guisp*
|
||||
These give the foreground (guifg), background (guibg) and special
|
||||
(guisp) color to use in the GUI. "guisp" is used for undercurl.
|
||||
(guisp) color to use in the GUI. "guisp" is used for undercurl and
|
||||
strikethrough.
|
||||
There are a few special names:
|
||||
NONE no color (transparent)
|
||||
bg use normal background color
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
$ motion.txt /*$*
|
||||
$HOME options.txt /*$HOME*
|
||||
$HOME-use version5.txt /*$HOME-use*
|
||||
$HOME-windows options.txt /*$HOME-windows*
|
||||
$MYGVIMRC gui.txt /*$MYGVIMRC*
|
||||
$MYVIMRC starting.txt /*$MYVIMRC*
|
||||
$VIM starting.txt /*$VIM*
|
||||
@@ -366,7 +367,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'ims' options.txt /*'ims'*
|
||||
'imsearch' options.txt /*'imsearch'*
|
||||
'imsf' options.txt /*'imsf'*
|
||||
'imst' options.txt /*'imst'*
|
||||
'imstatusfunc' options.txt /*'imstatusfunc'*
|
||||
'imstyle' options.txt /*'imstyle'*
|
||||
'inc' options.txt /*'inc'*
|
||||
'include' options.txt /*'include'*
|
||||
'includeexpr' options.txt /*'includeexpr'*
|
||||
@@ -935,6 +938,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
't_Co' term.txt /*'t_Co'*
|
||||
't_Cs' term.txt /*'t_Cs'*
|
||||
't_DL' term.txt /*'t_DL'*
|
||||
't_EC' term.txt /*'t_EC'*
|
||||
't_EI' term.txt /*'t_EI'*
|
||||
't_F1' term.txt /*'t_F1'*
|
||||
't_F2' term.txt /*'t_F2'*
|
||||
@@ -971,12 +975,19 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
't_PE' term.txt /*'t_PE'*
|
||||
't_PS' term.txt /*'t_PS'*
|
||||
't_RB' term.txt /*'t_RB'*
|
||||
't_RC' term.txt /*'t_RC'*
|
||||
't_RI' term.txt /*'t_RI'*
|
||||
't_RS' term.txt /*'t_RS'*
|
||||
't_RV' term.txt /*'t_RV'*
|
||||
't_SC' term.txt /*'t_SC'*
|
||||
't_SH' term.txt /*'t_SH'*
|
||||
't_SI' term.txt /*'t_SI'*
|
||||
't_SR' term.txt /*'t_SR'*
|
||||
't_Sb' term.txt /*'t_Sb'*
|
||||
't_Sf' term.txt /*'t_Sf'*
|
||||
't_Te' term.txt /*'t_Te'*
|
||||
't_Ts' term.txt /*'t_Ts'*
|
||||
't_VS' term.txt /*'t_VS'*
|
||||
't_WP' term.txt /*'t_WP'*
|
||||
't_WS' term.txt /*'t_WS'*
|
||||
't_ZH' term.txt /*'t_ZH'*
|
||||
@@ -1167,6 +1178,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'winheight' options.txt /*'winheight'*
|
||||
'winminheight' options.txt /*'winminheight'*
|
||||
'winminwidth' options.txt /*'winminwidth'*
|
||||
'winptydll' options.txt /*'winptydll'*
|
||||
'winwidth' options.txt /*'winwidth'*
|
||||
'wiv' options.txt /*'wiv'*
|
||||
'wiw' options.txt /*'wiw'*
|
||||
@@ -1315,6 +1327,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
+tcl various.txt /*+tcl*
|
||||
+tcl/dyn various.txt /*+tcl\/dyn*
|
||||
+termguicolors various.txt /*+termguicolors*
|
||||
+terminal various.txt /*+terminal*
|
||||
+terminfo various.txt /*+terminfo*
|
||||
+termresponse various.txt /*+termresponse*
|
||||
+textobjects various.txt /*+textobjects*
|
||||
@@ -1322,6 +1335,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
+timers various.txt /*+timers*
|
||||
+title various.txt /*+title*
|
||||
+toolbar various.txt /*+toolbar*
|
||||
+unix eval.txt /*+unix*
|
||||
+user_commands various.txt /*+user_commands*
|
||||
+vertsplit various.txt /*+vertsplit*
|
||||
+viminfo various.txt /*+viminfo*
|
||||
@@ -1886,6 +1900,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:<afile> cmdline.txt /*:<afile>*
|
||||
:<amatch> cmdline.txt /*:<amatch>*
|
||||
:<cWORD> cmdline.txt /*:<cWORD>*
|
||||
:<cexpr> cmdline.txt /*:<cexpr>*
|
||||
:<cfile> cmdline.txt /*:<cfile>*
|
||||
:<cword> cmdline.txt /*:<cword>*
|
||||
:<sfile> cmdline.txt /*:<sfile>*
|
||||
@@ -1945,6 +1960,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:Sexplore pi_netrw.txt /*:Sexplore*
|
||||
:TOhtml syntax.txt /*:TOhtml*
|
||||
:TarDiff pi_tar.txt /*:TarDiff*
|
||||
:Termdebug terminal.txt /*:Termdebug*
|
||||
:Texplore pi_netrw.txt /*:Texplore*
|
||||
:UseVimball pi_vimball.txt /*:UseVimball*
|
||||
:Vexplore pi_netrw.txt /*:Vexplore*
|
||||
@@ -3116,9 +3132,16 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:tl tagsrch.txt /*:tl*
|
||||
:tlast tagsrch.txt /*:tlast*
|
||||
:tm gui.txt /*:tm*
|
||||
:tma map.txt /*:tma*
|
||||
:tmap map.txt /*:tmap*
|
||||
:tmap_l map.txt /*:tmap_l*
|
||||
:tmapc map.txt /*:tmapc*
|
||||
:tmapclear map.txt /*:tmapclear*
|
||||
:tmenu gui.txt /*:tmenu*
|
||||
:tn tagsrch.txt /*:tn*
|
||||
:tnext tagsrch.txt /*:tnext*
|
||||
:tno map.txt /*:tno*
|
||||
:tnoremap map.txt /*:tnoremap*
|
||||
:topleft windows.txt /*:topleft*
|
||||
:tp tagsrch.txt /*:tp*
|
||||
:tprevious tagsrch.txt /*:tprevious*
|
||||
@@ -3128,6 +3151,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:ts tagsrch.txt /*:ts*
|
||||
:tselect tagsrch.txt /*:tselect*
|
||||
:tu gui.txt /*:tu*
|
||||
:tunma map.txt /*:tunma*
|
||||
:tunmap map.txt /*:tunmap*
|
||||
:tunmenu gui.txt /*:tunmenu*
|
||||
:u undo.txt /*:u*
|
||||
:un undo.txt /*:un*
|
||||
@@ -3392,6 +3417,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
<bang> map.txt /*<bang>*
|
||||
<buffer=N> autocmd.txt /*<buffer=N>*
|
||||
<buffer=abuf> autocmd.txt /*<buffer=abuf>*
|
||||
<cexpr> cmdline.txt /*<cexpr>*
|
||||
<cfile> cmdline.txt /*<cfile>*
|
||||
<character> intro.txt /*<character>*
|
||||
<count> map.txt /*<count>*
|
||||
@@ -3422,6 +3448,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
<mods> map.txt /*<mods>*
|
||||
<nomodeline> autocmd.txt /*<nomodeline>*
|
||||
<q-args> map.txt /*<q-args>*
|
||||
<range> map.txt /*<range>*
|
||||
<reg> map.txt /*<reg>*
|
||||
<register> map.txt /*<register>*
|
||||
<sfile> cmdline.txt /*<sfile>*
|
||||
@@ -3535,6 +3562,7 @@ CTRL-V-alternative gui_w32.txt /*CTRL-V-alternative*
|
||||
CTRL-W index.txt /*CTRL-W*
|
||||
CTRL-W_+ windows.txt /*CTRL-W_+*
|
||||
CTRL-W_- windows.txt /*CTRL-W_-*
|
||||
CTRL-W_. terminal.txt /*CTRL-W_.*
|
||||
CTRL-W_: windows.txt /*CTRL-W_:*
|
||||
CTRL-W_< windows.txt /*CTRL-W_<*
|
||||
CTRL-W_<BS> windows.txt /*CTRL-W_<BS>*
|
||||
@@ -3574,6 +3602,7 @@ CTRL-W_H windows.txt /*CTRL-W_H*
|
||||
CTRL-W_J windows.txt /*CTRL-W_J*
|
||||
CTRL-W_K windows.txt /*CTRL-W_K*
|
||||
CTRL-W_L windows.txt /*CTRL-W_L*
|
||||
CTRL-W_N terminal.txt /*CTRL-W_N*
|
||||
CTRL-W_P windows.txt /*CTRL-W_P*
|
||||
CTRL-W_R windows.txt /*CTRL-W_R*
|
||||
CTRL-W_S windows.txt /*CTRL-W_S*
|
||||
@@ -3601,6 +3630,7 @@ CTRL-W_n windows.txt /*CTRL-W_n*
|
||||
CTRL-W_o windows.txt /*CTRL-W_o*
|
||||
CTRL-W_p windows.txt /*CTRL-W_p*
|
||||
CTRL-W_q windows.txt /*CTRL-W_q*
|
||||
CTRL-W_quote terminal.txt /*CTRL-W_quote*
|
||||
CTRL-W_r windows.txt /*CTRL-W_r*
|
||||
CTRL-W_s windows.txt /*CTRL-W_s*
|
||||
CTRL-W_t windows.txt /*CTRL-W_t*
|
||||
@@ -4531,6 +4561,9 @@ E942 eval.txt /*E942*
|
||||
E943 message.txt /*E943*
|
||||
E944 pattern.txt /*E944*
|
||||
E945 pattern.txt /*E945*
|
||||
E946 terminal.txt /*E946*
|
||||
E947 terminal.txt /*E947*
|
||||
E948 terminal.txt /*E948*
|
||||
E95 message.txt /*E95*
|
||||
E96 diff.txt /*E96*
|
||||
E97 diff.txt /*E97*
|
||||
@@ -4772,6 +4805,7 @@ TabNew autocmd.txt /*TabNew*
|
||||
Tcl if_tcl.txt /*Tcl*
|
||||
TermChanged autocmd.txt /*TermChanged*
|
||||
TermResponse autocmd.txt /*TermResponse*
|
||||
Terminal-mode terminal.txt /*Terminal-mode*
|
||||
TextChanged autocmd.txt /*TextChanged*
|
||||
TextChangedI autocmd.txt /*TextChangedI*
|
||||
Transact-SQL ft_sql.txt /*Transact-SQL*
|
||||
@@ -4816,6 +4850,7 @@ W22 eval.txt /*W22*
|
||||
WORD motion.txt /*WORD*
|
||||
WWW intro.txt /*WWW*
|
||||
Win32 os_win32.txt /*Win32*
|
||||
WinBar gui.txt /*WinBar*
|
||||
WinEnter autocmd.txt /*WinEnter*
|
||||
WinLeave autocmd.txt /*WinLeave*
|
||||
WinNew autocmd.txt /*WinNew*
|
||||
@@ -5409,6 +5444,7 @@ cinoptions-values indent.txt /*cinoptions-values*
|
||||
clear-undo undo.txt /*clear-undo*
|
||||
clearmatches() eval.txt /*clearmatches()*
|
||||
client-server remote.txt /*client-server*
|
||||
client-server-name remote.txt /*client-server-name*
|
||||
clientserver remote.txt /*clientserver*
|
||||
clipboard gui.txt /*clipboard*
|
||||
clipboard-autoselect options.txt /*clipboard-autoselect*
|
||||
@@ -6126,6 +6162,7 @@ ft-mathematica-syntax syntax.txt /*ft-mathematica-syntax*
|
||||
ft-mma-syntax syntax.txt /*ft-mma-syntax*
|
||||
ft-moo-syntax syntax.txt /*ft-moo-syntax*
|
||||
ft-msql-syntax syntax.txt /*ft-msql-syntax*
|
||||
ft-n1ql-syntax syntax.txt /*ft-n1ql-syntax*
|
||||
ft-nasm-syntax syntax.txt /*ft-nasm-syntax*
|
||||
ft-ncf-syntax syntax.txt /*ft-ncf-syntax*
|
||||
ft-nroff-syntax syntax.txt /*ft-nroff-syntax*
|
||||
@@ -7255,6 +7292,7 @@ mapmode-n map.txt /*mapmode-n*
|
||||
mapmode-nvo map.txt /*mapmode-nvo*
|
||||
mapmode-o map.txt /*mapmode-o*
|
||||
mapmode-s map.txt /*mapmode-s*
|
||||
mapmode-t map.txt /*mapmode-t*
|
||||
mapmode-v map.txt /*mapmode-v*
|
||||
mapmode-x map.txt /*mapmode-x*
|
||||
mapping map.txt /*mapping*
|
||||
@@ -7369,6 +7407,7 @@ mzscheme-vim if_mzsch.txt /*mzscheme-vim*
|
||||
mzscheme-vimext if_mzsch.txt /*mzscheme-vimext*
|
||||
mzscheme-window if_mzsch.txt /*mzscheme-window*
|
||||
n pattern.txt /*n*
|
||||
n1ql.vim syntax.txt /*n1ql.vim*
|
||||
nasm.vim syntax.txt /*nasm.vim*
|
||||
navigation motion.txt /*navigation*
|
||||
nb-commands netbeans.txt /*nb-commands*
|
||||
@@ -7712,6 +7751,7 @@ no-type-checking eval.txt /*no-type-checking*
|
||||
no_buffers_menu gui.txt /*no_buffers_menu*
|
||||
no_mail_maps filetype.txt /*no_mail_maps*
|
||||
no_plugin_maps filetype.txt /*no_plugin_maps*
|
||||
nocombine syntax.txt /*nocombine*
|
||||
non-greedy pattern.txt /*non-greedy*
|
||||
non-zero-arg eval.txt /*non-zero-arg*
|
||||
none-variable eval.txt /*none-variable*
|
||||
@@ -7988,6 +8028,7 @@ qnx-terminal os_qnx.txt /*qnx-terminal*
|
||||
quake.vim syntax.txt /*quake.vim*
|
||||
quickfix quickfix.txt /*quickfix*
|
||||
quickfix-6 version6.txt /*quickfix-6*
|
||||
quickfix-ID quickfix.txt /*quickfix-ID*
|
||||
quickfix-directory-stack quickfix.txt /*quickfix-directory-stack*
|
||||
quickfix-error-lists quickfix.txt /*quickfix-error-lists*
|
||||
quickfix-functions usr_41.txt /*quickfix-functions*
|
||||
@@ -8217,6 +8258,7 @@ servername-variable eval.txt /*servername-variable*
|
||||
session-file starting.txt /*session-file*
|
||||
set-option options.txt /*set-option*
|
||||
set-spc-auto spell.txt /*set-spc-auto*
|
||||
setbufline() eval.txt /*setbufline()*
|
||||
setbufvar() eval.txt /*setbufvar()*
|
||||
setcharsearch() eval.txt /*setcharsearch()*
|
||||
setcmdpos() eval.txt /*setcmdpos()*
|
||||
@@ -8443,6 +8485,7 @@ strdisplaywidth() eval.txt /*strdisplaywidth()*
|
||||
strftime() eval.txt /*strftime()*
|
||||
strgetchar() eval.txt /*strgetchar()*
|
||||
stridx() eval.txt /*stridx()*
|
||||
strikethrough syntax.txt /*strikethrough*
|
||||
string eval.txt /*string*
|
||||
string() eval.txt /*string()*
|
||||
string-functions usr_41.txt /*string-functions*
|
||||
@@ -8529,11 +8572,14 @@ t_AL term.txt /*t_AL*
|
||||
t_BD term.txt /*t_BD*
|
||||
t_BE term.txt /*t_BE*
|
||||
t_CS term.txt /*t_CS*
|
||||
t_CTRL-W_CTRL-C terminal.txt /*t_CTRL-W_CTRL-C*
|
||||
t_CTRL-\_CTRL-N terminal.txt /*t_CTRL-\\_CTRL-N*
|
||||
t_CV term.txt /*t_CV*
|
||||
t_Ce term.txt /*t_Ce*
|
||||
t_Co term.txt /*t_Co*
|
||||
t_Cs term.txt /*t_Cs*
|
||||
t_DL term.txt /*t_DL*
|
||||
t_EC term.txt /*t_EC*
|
||||
t_EI term.txt /*t_EI*
|
||||
t_F1 term.txt /*t_F1*
|
||||
t_F2 term.txt /*t_F2*
|
||||
@@ -8570,12 +8616,19 @@ t_KL term.txt /*t_KL*
|
||||
t_PE term.txt /*t_PE*
|
||||
t_PS term.txt /*t_PS*
|
||||
t_RB term.txt /*t_RB*
|
||||
t_RC term.txt /*t_RC*
|
||||
t_RI term.txt /*t_RI*
|
||||
t_RS term.txt /*t_RS*
|
||||
t_RV term.txt /*t_RV*
|
||||
t_SC term.txt /*t_SC*
|
||||
t_SH term.txt /*t_SH*
|
||||
t_SI term.txt /*t_SI*
|
||||
t_SR term.txt /*t_SR*
|
||||
t_Sb term.txt /*t_Sb*
|
||||
t_Sf term.txt /*t_Sf*
|
||||
t_Te term.txt /*t_Te*
|
||||
t_Ts term.txt /*t_Ts*
|
||||
t_VS term.txt /*t_VS*
|
||||
t_WP term.txt /*t_WP*
|
||||
t_WS term.txt /*t_WS*
|
||||
t_ZH term.txt /*t_ZH*
|
||||
@@ -8788,14 +8841,26 @@ temp-file-name eval.txt /*temp-file-name*
|
||||
tempfile change.txt /*tempfile*
|
||||
template autocmd.txt /*template*
|
||||
tempname() eval.txt /*tempname()*
|
||||
term++close terminal.txt /*term++close*
|
||||
term++open terminal.txt /*term++open*
|
||||
term-dependent-settings term.txt /*term-dependent-settings*
|
||||
term-list syntax.txt /*term-list*
|
||||
term.txt term.txt /*term.txt*
|
||||
term_getaltscreen() eval.txt /*term_getaltscreen()*
|
||||
term_getattr() eval.txt /*term_getattr()*
|
||||
term_getcursor() eval.txt /*term_getcursor()*
|
||||
term_getjob() eval.txt /*term_getjob()*
|
||||
term_getline() eval.txt /*term_getline()*
|
||||
term_getscrolled() eval.txt /*term_getscrolled()*
|
||||
term_getsize() eval.txt /*term_getsize()*
|
||||
term_open() eval.txt /*term_open()*
|
||||
term_getstatus() eval.txt /*term_getstatus()*
|
||||
term_gettitle() eval.txt /*term_gettitle()*
|
||||
term_gettty() eval.txt /*term_gettty()*
|
||||
term_list() eval.txt /*term_list()*
|
||||
term_scrape() eval.txt /*term_scrape()*
|
||||
term_sendkeys() eval.txt /*term_sendkeys()*
|
||||
term_setsize() eval.txt /*term_setsize()*
|
||||
term_start() eval.txt /*term_start()*
|
||||
term_wait() eval.txt /*term_wait()*
|
||||
termcap term.txt /*termcap*
|
||||
termcap-changed version4.txt /*termcap-changed*
|
||||
@@ -8807,11 +8872,13 @@ termcap-title term.txt /*termcap-title*
|
||||
terminal terminal.txt /*terminal*
|
||||
terminal-colors os_unix.txt /*terminal-colors*
|
||||
terminal-debug terminal.txt /*terminal-debug*
|
||||
terminal-functions usr_41.txt /*terminal-functions*
|
||||
terminal-info term.txt /*terminal-info*
|
||||
terminal-key-codes term.txt /*terminal-key-codes*
|
||||
terminal-options term.txt /*terminal-options*
|
||||
terminal-output-codes term.txt /*terminal-output-codes*
|
||||
terminal-testing terminal.txt /*terminal-testing*
|
||||
terminal-typing terminal.txt /*terminal-typing*
|
||||
terminal-use terminal.txt /*terminal-use*
|
||||
terminal.txt terminal.txt /*terminal.txt*
|
||||
terminfo term.txt /*terminfo*
|
||||
@@ -8819,6 +8886,7 @@ termresponse-variable eval.txt /*termresponse-variable*
|
||||
test-functions usr_41.txt /*test-functions*
|
||||
test_alloc_fail() eval.txt /*test_alloc_fail()*
|
||||
test_autochdir() eval.txt /*test_autochdir()*
|
||||
test_feedinput() eval.txt /*test_feedinput()*
|
||||
test_garbagecollect_now() eval.txt /*test_garbagecollect_now()*
|
||||
test_ignore_error() eval.txt /*test_ignore_error()*
|
||||
test_null_channel() eval.txt /*test_null_channel()*
|
||||
@@ -9045,7 +9113,11 @@ v:t_list eval.txt /*v:t_list*
|
||||
v:t_none eval.txt /*v:t_none*
|
||||
v:t_number eval.txt /*v:t_number*
|
||||
v:t_string eval.txt /*v:t_string*
|
||||
v:termblinkresp eval.txt /*v:termblinkresp*
|
||||
v:termresponse eval.txt /*v:termresponse*
|
||||
v:termrgbresp eval.txt /*v:termrgbresp*
|
||||
v:termstyleresp eval.txt /*v:termstyleresp*
|
||||
v:termu7resp eval.txt /*v:termu7resp*
|
||||
v:testing eval.txt /*v:testing*
|
||||
v:this_session eval.txt /*v:this_session*
|
||||
v:throwpoint eval.txt /*v:throwpoint*
|
||||
@@ -9365,6 +9437,7 @@ window-resize windows.txt /*window-resize*
|
||||
window-size term.txt /*window-size*
|
||||
window-size-functions usr_41.txt /*window-size-functions*
|
||||
window-tag windows.txt /*window-tag*
|
||||
window-toolbar gui.txt /*window-toolbar*
|
||||
window-variable eval.txt /*window-variable*
|
||||
windowid windows.txt /*windowid*
|
||||
windowid-variable eval.txt /*windowid-variable*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*term.txt* For Vim version 8.0. Last change: 2017 Jul 21
|
||||
*term.txt* For Vim version 8.0. Last change: 2017 Aug 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -295,13 +295,11 @@ OUTPUT CODES *terminal-output-codes*
|
||||
t_ts set window title start (to status line) *t_ts* *'t_ts'*
|
||||
t_ue underline end *t_ue* *'t_ue'*
|
||||
t_us underline mode *t_us* *'t_us'*
|
||||
t_Ce undercurl end *t_Ce* *'t_Ce'*
|
||||
t_Cs undercurl mode *t_Cs* *'t_Cs'*
|
||||
t_ut clearing uses the current background color *t_ut* *'t_ut'*
|
||||
t_vb visual bell *t_vb* *'t_vb'*
|
||||
t_ve cursor visible *t_ve* *'t_ve'*
|
||||
t_vi cursor invisible *t_vi* *'t_vi'*
|
||||
t_vs cursor very visible *t_vs* *'t_vs'*
|
||||
t_vs cursor very visible (blink) *t_vs* *'t_vs'*
|
||||
*t_xs* *'t_xs'*
|
||||
t_xs if non-empty, standout not erased by overwriting (hpterm)
|
||||
*t_xn* *'t_xn'*
|
||||
@@ -311,11 +309,16 @@ OUTPUT CODES *terminal-output-codes*
|
||||
t_ZR italics end *t_ZR* *'t_ZR'*
|
||||
|
||||
Added by Vim (there are no standard codes for these):
|
||||
t_Ce undercurl end *t_Ce* *'t_Ce'*
|
||||
t_Cs undercurl mode *t_Cs* *'t_Cs'*
|
||||
t_Te strikethrough end *t_Te* *'t_Te'*
|
||||
t_Ts strikethrough mode *t_Ts* *'t_Ts'*
|
||||
t_IS set icon text start *t_IS* *'t_IS'*
|
||||
t_IE set icon text end *t_IE* *'t_IE'*
|
||||
t_WP set window position (Y, X) in pixels *t_WP* *'t_WP'*
|
||||
t_GP get window position (Y, X) in pixels *t_GP* *'t_GP'*
|
||||
t_WS set window size (height, width in cells) *t_WS* *'t_WS'*
|
||||
t_VS cursor normally visible (no blink) *t_VS* *'t_VS'*
|
||||
t_SI start insert mode (bar cursor shape) *t_SI* *'t_SI'*
|
||||
t_SR start replace mode (underline cursor shape) *t_SR* *'t_SR'*
|
||||
t_EI end insert or replace mode (block cursor shape) *t_EI* *'t_EI'*
|
||||
@@ -333,6 +336,29 @@ Added by Vim (there are no standard codes for these):
|
||||
|xterm-bracketed-paste|
|
||||
t_BD disable bracketed paste mode *t_BD* *'t_BD'*
|
||||
|xterm-bracketed-paste|
|
||||
t_SC set cursor color start *t_SC* *'t_SC'*
|
||||
t_EC set cursor color end *t_EC* *'t_EC'*
|
||||
t_SH set cursor shape *t_SH* *'t_SH'*
|
||||
t_RC request terminal cursor blinking *t_RC* *'t_RC'*
|
||||
t_RS request terminal cursor style *t_RS* *'t_RS'*
|
||||
|
||||
Some codes have a start, middle and end part. The start and end are defined
|
||||
by the termcap option, the middle part is text.
|
||||
set title text: t_ts {title text} t_fs
|
||||
set icon text: t_IS {icon text} t_IE
|
||||
set cursor color: t_SC {color name} t_EC
|
||||
|
||||
t_SH must take one argument:
|
||||
0, 1 or none blinking block cursor
|
||||
2 block cursor
|
||||
3 blinking underline cursor
|
||||
4 underline cursor
|
||||
5 blinking vertical bar cursor
|
||||
6 vertical bar cursor
|
||||
|
||||
t_RS is sent only if the response to t_RV has been received. It is not used
|
||||
on Mac OS when Terminal.app could be recognized from the termresponse.
|
||||
|
||||
|
||||
KEY CODES *terminal-key-codes*
|
||||
Note: Use the <> form if possible
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*terminal.txt* For Vim version 8.0. Last change: 2017 Jul 30
|
||||
*terminal.txt* For Vim version 8.0. Last change: 2017 Sep 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -19,6 +19,9 @@ If the result is "1" you have it.
|
||||
3. Debugging |terminal-debug|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
The terminal feature requires the |+multi_byte|, |+job| and |+channel| features.
|
||||
|
||||
==============================================================================
|
||||
1. Basic use *terminal-use*
|
||||
@@ -27,16 +30,16 @@ This feature is for running a terminal emulator in a Vim window. A job can be
|
||||
started connected to the terminal emulator. For example, to run a shell: >
|
||||
:term bash
|
||||
|
||||
Or to run a debugger: >
|
||||
:term gdb vim
|
||||
Or to run build command: >
|
||||
:term make myprogram
|
||||
|
||||
The job runs asynchronously from Vim, the window will be updated to show
|
||||
output from the job, also while editing in any other window.
|
||||
output from the job, also while editing in another window.
|
||||
|
||||
|
||||
Typing ~
|
||||
|
||||
When the keyboard focus is in the terminal window, typed keys will be send to
|
||||
*terminal-typing*
|
||||
When the keyboard focus is in the terminal window, typed keys will be sent to
|
||||
the job. This uses a pty when possible. You can click outside of the
|
||||
terminal window to move keyboard focus elsewhere.
|
||||
|
||||
@@ -47,7 +50,12 @@ See |CTRL-W| for more commands.
|
||||
|
||||
Special in the terminal window: *CTRL-W_.* *CTRL-W_N*
|
||||
CTRL-W . send a CTRL-W to the job in the terminal
|
||||
CTRL-W N go to Terminal Normal mode, see |Terminal-mode|
|
||||
CTRL-W N go to Terminal-Normal mode, see |Terminal-mode|
|
||||
CTRL-\ CTRL-N go to Terminal-Normal mode, see |Terminal-mode|
|
||||
CTRL-W " {reg} paste register {reg} *CTRL-W_quote*
|
||||
Also works with the = register to insert the result of
|
||||
evaluating an expression.
|
||||
CTRL-W CTRL-C ends the job, see below |t_CTRL-W_CTRL-C|
|
||||
|
||||
See option 'termkey' for specifying another key instead of CTRL-W that
|
||||
will work like CTRL-W. However, typing 'termkey' twice sends 'termkey' to
|
||||
@@ -58,38 +66,131 @@ the job. For example:
|
||||
'termkey' . send a CTRL-W to the job in the terminal
|
||||
'termkey' N go to terminal Normal mode, see below
|
||||
'termkey' CTRL-N same as CTRL-W N
|
||||
'termkey' CTRL-C same as |t_CTRL-W_CTRL-C|
|
||||
*t_CTRL-\_CTRL-N*
|
||||
The special key combination CTRL-\ CTRL-N can be used to switch to Normal
|
||||
mode, just like this works in any other mode.
|
||||
*t_CTRL-W_CTRL-C*
|
||||
CTRL-W CTRL-C can be typed to forcefully end the job. On MS-Windows a
|
||||
CTRL-BREAK will also kill the job.
|
||||
|
||||
If you type CTRL-C the effect depends on what the pty has been configured to
|
||||
do. For simple commands this causes a SIGINT to be sent to the job, which
|
||||
would end it. Other commands may ignore the SIGINT or handle the CTRL-C
|
||||
themselves (like Vim does).
|
||||
|
||||
To change the keys you type use terminal mode mappings, see |:tmap|.
|
||||
These are defined like any mapping, but apply only when typing keys that are
|
||||
sent to the job running in the terminal.
|
||||
|
||||
|
||||
Size ~
|
||||
Size and color ~
|
||||
|
||||
See option 'termsize' for controlling the size of the terminal window.
|
||||
(TODO: scrolling when the terminal is larger than the window)
|
||||
|
||||
The job running in the terminal can change the colors. The default foreground
|
||||
and background colors are taken from Vim, the Normal highlight group.
|
||||
|
||||
For a color terminal the 'background' option is used to decide whether the
|
||||
terminal window will start with a white or black background.
|
||||
|
||||
To use a different color the Terminal highlight group can be used: >
|
||||
hi Terminal ctermbg=lightgrey ctermfg=blue guibg=lightgrey guifg=blue
|
||||
|
||||
|
||||
Syntax ~
|
||||
|
||||
:ter[minal] [command] *:ter* *:terminal*
|
||||
:[range]ter[minal] [options] [command] *:ter* *:terminal*
|
||||
Open a new terminal window.
|
||||
|
||||
If [command] is provided run it as a job and connect
|
||||
the input and output to the terminal.
|
||||
If [command] is not given the 'shell' option is used.
|
||||
if [command] is NONE no job is started, the pty of the
|
||||
terminal can be used by a command like gdb.
|
||||
|
||||
A new buffer will be created, using [command] or
|
||||
'shell' as the name. If a buffer by this name already
|
||||
exists a number is added in parenthesis.
|
||||
E.g. if "gdb" exists the second terminal buffer will
|
||||
use "gdb (1)".
|
||||
'shell' as the name, prefixed with a "!". If a buffer
|
||||
by this name already exists a number is added in
|
||||
parentheses. E.g. if "gdb" exists the second terminal
|
||||
buffer will use "!gdb (1)".
|
||||
|
||||
The window can be closed, in which case the buffer
|
||||
becomes hidden. The command will not be stopped. The
|
||||
`:buffer` command can be used to turn the current
|
||||
window into a terminal window, using the existing
|
||||
buffer. If there are unsaved changes this fails, use
|
||||
! to force, as usual.
|
||||
If [range] is given the specified lines are used as
|
||||
input for the job. It will not be possible to type
|
||||
keys in the terminal window. For MS-Windows see the
|
||||
++eof argument below.
|
||||
|
||||
When the buffer associated with the terminal is wiped out the job is killed,
|
||||
similar to calling `job_stop(job, "kill")`
|
||||
Two comma separated numbers are used as "rows,cols".
|
||||
E.g. `:24,80gdb` opens a terminal with 24 rows and 80
|
||||
columns. However, if the terminal window spans the
|
||||
Vim window with, there is no vertical split, the Vim
|
||||
window width is used.
|
||||
*term++close* *term++open*
|
||||
Supported [options] are:
|
||||
++close The terminal window will close
|
||||
automatically when the job terminates.
|
||||
++open When the job terminates and no window
|
||||
shows it, a window will be opened.
|
||||
Note that this can be interruptive.
|
||||
++curwin Open the terminal in the current
|
||||
window, do not split the current
|
||||
window. Fails if the current buffer
|
||||
cannot be |abandon|ed.
|
||||
++hidden Open the terminal in a hidden buffer,
|
||||
no window will be used.
|
||||
++rows={height} Use {height} for the terminal window
|
||||
height.
|
||||
++cols={width} Use {width} for the terminal window
|
||||
width.
|
||||
++eof={text} when using [range]: text to send after
|
||||
the last line was written. Cannot
|
||||
contain white space. A CR is
|
||||
appended. For MS-Windows the default
|
||||
is to send CTRL-D.
|
||||
E.g. for a shell use "++eof=exit" and
|
||||
for Python "++eof=exit()". Special
|
||||
codes can be used like with `:map`,
|
||||
e.g. "<C-Z>" for CTRL-Z.
|
||||
|
||||
If you want to use more options use the |term_start()|
|
||||
function.
|
||||
|
||||
When the buffer associated with the terminal is unloaded or wiped out the job
|
||||
is killed, similar to calling `job_stop(job, "kill")`
|
||||
|
||||
So long as the job is running the window behaves like it contains a modified
|
||||
buffer. Trying to close the window with `CTRL-W :quit` fails. When using
|
||||
`CTRL-W :quit!` the job is ended. The text in the window is lost. The buffer
|
||||
still exists, but getting it in a window with `:buffer` will show an empty
|
||||
buffer.
|
||||
|
||||
Trying to close the window with `CTRL-W :close` also fails. Using
|
||||
`CTRL-W :close!` will close the window and make the buffer hidden.
|
||||
|
||||
You can use `CTRL-W :hide` to close the terminal window and make the buffer
|
||||
hidden, the job keeps running. The `:buffer` command can be used to turn the
|
||||
current window into a terminal window. If there are unsaved changes this
|
||||
fails, use ! to force, as usual.
|
||||
|
||||
To have a background job run without a window, and open the window when it's
|
||||
done, use options like this: >
|
||||
:term ++hidden ++open make
|
||||
Note that the window will open at an unexpected moment, this will interrupt
|
||||
what you are doing.
|
||||
|
||||
*E947* *E948*
|
||||
So long as the job is running, the buffer is considered modified and Vim
|
||||
cannot be quit easily, see |abandon|.
|
||||
|
||||
When the job has finished and no changes were made to the buffer: closing the
|
||||
window will wipe out the buffer.
|
||||
|
||||
Before changes can be made to a terminal buffer, the 'modifiable' option must
|
||||
be set. This is only possible when the job has finished. At the first change
|
||||
the buffer will become a normal buffer and the highlighting is removed.
|
||||
You may want to change the buffer name with |:file| to be able to write, since
|
||||
the buffer name will still be set to the command.
|
||||
|
||||
|
||||
Resizing ~
|
||||
@@ -114,23 +215,45 @@ terminal. |term_setsize()| can be used only when in the first or second mode,
|
||||
not when 'termsize' is "rowsXcols".
|
||||
|
||||
|
||||
Terminal Normal mode ~
|
||||
Terminal-Job and Terminal-Normal mode ~
|
||||
*Terminal-mode*
|
||||
When the job is running the contents of the terminal is under control of the
|
||||
job. That includes the cursor position. The terminal contents can change at
|
||||
any time.
|
||||
job. That includes the cursor position. Typed keys are sent to the job.
|
||||
The terminal contents can change at any time. This is called Terminal-Job
|
||||
mode.
|
||||
|
||||
Use CTRL-W N (or 'termkey' N) to switch to Terminal-Normal mode. Now the
|
||||
contents of the terminal window is under control of Vim, the job output is
|
||||
suspended. CTRL-\ CTRL-N does the same.
|
||||
|
||||
Terminal-Job mode is where |:tmap| mappings are applied. Keys sent by
|
||||
|term_sendkeys()| are not subject to tmap, but keys from |feedkeys()| are.
|
||||
|
||||
Use CTRL-W N (or 'termkey' N) to go to Terminal Normal mode. Now the contents
|
||||
of the terminal window is under control of Vim, the job output is suspended.
|
||||
*E946*
|
||||
In this mode you can move the cursor around with the usual Vim commands,
|
||||
Visually mark text, yank text, etc. But you cannot change the contents of the
|
||||
buffer. The commands that would start insert mode, such as 'i' and 'a',
|
||||
return control of the window to the job. Any pending output will now be
|
||||
displayed.
|
||||
In Terminal-Normal mode you can move the cursor around with the usual Vim
|
||||
commands, Visually mark text, yank text, etc. But you cannot change the
|
||||
contents of the buffer. The commands that would start insert mode, such as
|
||||
'i' and 'a', return to Terminal-Job mode. The window will be updated to show
|
||||
the contents of the terminal. |:startinsert| is ineffective.
|
||||
|
||||
In Terminal mode the statusline and window title show "(Terminal)". If the
|
||||
job ends while in Terminal mode this changes to "(Terminal-finished)".
|
||||
In Terminal-Normal mode the statusline and window title show "(Terminal)". If
|
||||
the job ends while in Terminal-Normal mode this changes to
|
||||
"(Terminal-finished)".
|
||||
|
||||
It is not possible to enter Insert mode from Terminal-Job mode.
|
||||
|
||||
|
||||
Cursor style ~
|
||||
|
||||
By default the cursor in the terminal window uses a not blinking block. The
|
||||
normal xterm escape sequences can be used to change the blinking state and the
|
||||
shape. Once focus leaves the terminal window Vim will restore the original
|
||||
cursor.
|
||||
|
||||
An exception is when xterm is started with the "-bc" argument, or another way
|
||||
that causes the cursor to blink. This actually means that the blinking flag
|
||||
is inverted. Since Vim cannot detect this, the terminal window cursor
|
||||
blinking will also be inverted.
|
||||
|
||||
|
||||
Unix ~
|
||||
@@ -138,6 +261,23 @@ Unix ~
|
||||
On Unix a pty is used to make it possible to run all kinds of commands. You
|
||||
can even run Vim in the terminal! That's used for debugging, see below.
|
||||
|
||||
Environment variables are used to pass information to the running job:
|
||||
TERM name of the terminal, 'term'
|
||||
ROWS number of rows in the terminal initially
|
||||
LINES same as ROWS
|
||||
COLUMNS number of columns in the terminal initially
|
||||
COLORS number of colors, 't_Co' (256*256*256 in the GUI)
|
||||
VIM_SERVERNAME v:servername
|
||||
|
||||
The |client-server| feature can be used to communicate with the Vim instance
|
||||
where the job was started. This only works when v:servername is not empty.
|
||||
If needed you can set it with: >
|
||||
call remote_startserver('vim-server')
|
||||
|
||||
In the job you can then do something like: >
|
||||
vim --servername $VIM_SERVERNAME --remote +123 some_file.c
|
||||
This will open the file "some_file.c" and put the cursor on line 123.
|
||||
|
||||
|
||||
MS-Windows ~
|
||||
|
||||
@@ -154,7 +294,10 @@ You can download them from the following page:
|
||||
|
||||
https://github.com/rprichard/winpty
|
||||
|
||||
Just put the files somewhere in your PATH.
|
||||
Just put the files somewhere in your PATH. You can set the 'winptydll' option
|
||||
to point to the right file, if needed. If you have both the 32-bit and 64-bit
|
||||
version, rename to winpty32.dll and winpty64.dll to match the way Vim was
|
||||
build.
|
||||
|
||||
==============================================================================
|
||||
2. Remote testing *terminal-testing*
|
||||
@@ -166,7 +309,7 @@ inspects the resulting screen state.
|
||||
|
||||
Functions ~
|
||||
|
||||
term_sendkeys() send keystrokes to a terminal
|
||||
term_sendkeys() send keystrokes to a terminal (not subject to tmap)
|
||||
term_wait() wait for screen to be updated
|
||||
term_scrape() inspect terminal screen
|
||||
|
||||
@@ -175,25 +318,118 @@ term_scrape() inspect terminal screen
|
||||
3. Debugging *terminal-debug*
|
||||
|
||||
The Terminal debugging plugin can be used to debug a program with gdb and view
|
||||
the source code in a Vim window. For example: >
|
||||
the source code in a Vim window. Since this is completely contained inside
|
||||
Vim this also works remotely over an ssh connection.
|
||||
|
||||
|
||||
Starting ~
|
||||
|
||||
Load the plugin with this command: >
|
||||
packadd termdebug
|
||||
< *:Termdebug*
|
||||
To start debugging use `:TermDebug` folowed by the command name, for example: >
|
||||
:TermDebug vim
|
||||
|
||||
This opens three windows:
|
||||
- A terminal window in which "gdb vim" is executed. Here you can directly
|
||||
interact with gdb.
|
||||
- A terminal window for the executed program. When "run" is used in gdb the
|
||||
program I/O will happen in this window, so that it does not interfere with
|
||||
controlling gdb.
|
||||
- A normal Vim window used to show the source code. When gdb jumps to a
|
||||
source file location this window will display the code, if possible. Values
|
||||
of variables can be inspected, breakpoints set and cleared, etc.
|
||||
This opens two windows:
|
||||
gdb window A terminal window in which "gdb vim" is executed. Here you
|
||||
can directly interact with gdb. The buffer name is "!gdb".
|
||||
program window A terminal window for the executed program. When "run" is
|
||||
used in gdb the program I/O will happen in this window, so
|
||||
that it does not interfere with controlling gdb. The buffer
|
||||
name is "gdb program".
|
||||
|
||||
This uses two terminal windows. To open the gdb window: >
|
||||
:term gdb [arguments]
|
||||
To open the terminal to run the tested program |term_open()| is used.
|
||||
The current window is used to show the source code. When gdb pauses the
|
||||
source file location will be displayed, if possible. A sign is used to
|
||||
highlight the current position (using highlight group debugPC).
|
||||
|
||||
If the buffer in the current window is modified, another window will be opened
|
||||
to display the current gdb position.
|
||||
|
||||
Focus the terminal of the executed program to interact with it. This works
|
||||
the same as any command running in a terminal window.
|
||||
|
||||
When the debugger ends, typically by typing "quit" in the gdb window, the two
|
||||
opened windows are closed.
|
||||
|
||||
|
||||
Stepping through code ~
|
||||
|
||||
Put focus on the gdb window to type commands there. Some common ones are:
|
||||
- CTRL-C interrupt the program
|
||||
- next execute the current line and stop at the next line
|
||||
- step execute the current line and stop at the next statement, entering
|
||||
functions
|
||||
- finish execute until leaving the current function
|
||||
- where show the stack
|
||||
- frame N go to the Nth stack frame
|
||||
- continue continue execution
|
||||
|
||||
In the window showing the source code some commands can used to control gdb:
|
||||
:Break set a breakpoint at the current line; a sign will be displayed
|
||||
:Delete delete a breakpoint at the current line
|
||||
:Step execute the gdb "step" command
|
||||
:Over execute the gdb "next" command (:Next is a Vim command)
|
||||
:Finish execute the gdb "finish" command
|
||||
:Continue execute the gdb "continue" command
|
||||
|
||||
The plugin adds a window toolbar with these entries:
|
||||
Step :Step
|
||||
Next :Over
|
||||
Finish :Finish
|
||||
Cont :Continue
|
||||
Eval :Evaluate
|
||||
This way you can use the mouse to perform the most common commands.
|
||||
|
||||
|
||||
Inspecting variables ~
|
||||
|
||||
:Evaluate evaluate the expression under the cursor
|
||||
K same
|
||||
:Evaluate {expr} evaluate {expr}
|
||||
:'<,'>Evaluate evaluate the Visually selected text
|
||||
|
||||
This is similar to using "print" in the gdb window.
|
||||
|
||||
|
||||
Other commands ~
|
||||
|
||||
:Gdb jump to the gdb window
|
||||
:Program jump to the window with the running program
|
||||
|
||||
|
||||
Communication ~
|
||||
|
||||
There is another, hidden, buffer, which is used for Vim to communicate with
|
||||
gdb. The buffer name is "gdb communication". Do not delete this buffer, it
|
||||
will break the debugger.
|
||||
|
||||
|
||||
Customizing ~
|
||||
|
||||
To change the name of the gdb command, set the "termdebugger" variable before
|
||||
invoking `:Termdebug`: >
|
||||
let termdebugger = "mygdb"
|
||||
Only debuggers fully compatible with gdb will work. Vim uses the GDB/MI
|
||||
interface.
|
||||
|
||||
The color of the signs can be adjusted with these highlight groups:
|
||||
- debugPC the current position
|
||||
- debugBreakpoint a breakpoint
|
||||
|
||||
The defaults are, when 'background' is "light":
|
||||
hi debugPC term=reverse ctermbg=lightblue guibg=lightblue
|
||||
hi debugBreakpoint term=reverse ctermbg=red guibg=red
|
||||
|
||||
When 'background' is "dark":
|
||||
hi debugPC term=reverse ctermbg=darkblue guibg=darkblue
|
||||
hi debugBreakpoint term=reverse ctermbg=red guibg=red
|
||||
|
||||
To change the width of the Vim window when debugging starts, and use a
|
||||
vertical split: >
|
||||
let g:termdebug_wide = 163
|
||||
This will set &columns to 163 when :Termdebug is used. The value is restored
|
||||
when quitting the debugger.
|
||||
|
||||
TODO
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Jul 22
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Sep 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -35,34 +35,46 @@ entered there will not be repeated below, unless there is extra information.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
:term hangs in Athena and Motif. (Kazunobu Kuriyama, 2017 Sep 17)
|
||||
|
||||
Always use FEAT_WINDOWS:
|
||||
May get rid of:
|
||||
#define W_WINCOL(wp) (wp->w_wincol)
|
||||
#define W_WIDTH(wp) (wp->w_width)
|
||||
#define W_ENDCOL(wp) (wp->w_wincol + wp->w_width)
|
||||
#define W_VSEP_WIDTH(wp) (wp->w_vsep_width)
|
||||
#define W_STATUS_HEIGHT(wp) (wp->w_status_height)
|
||||
#define W_WINROW(wp) (wp->w_winrow)
|
||||
# define ALIST(win) (win)->w_alist
|
||||
|
||||
No maintainer for Vietnamese translations.
|
||||
No maintainer for Simplified Chinese translations.
|
||||
|
||||
|
||||
Terminal emulator window:
|
||||
- Lots of stuff to implement, see src/terminal.c
|
||||
- Running a shell command from the GUI still has limitations. Look into how
|
||||
the terminal emulator of the Vim shell project can help:
|
||||
http://vimshell.wana.at
|
||||
- Add debugger interface. Implementation for gdb by Xavier de Gaye. Should
|
||||
work like an IDE. Try to keep it generic. Now found here:
|
||||
http://clewn.sf.net.
|
||||
- Look into the idevim plugin/script.
|
||||
- Related wishes for NetBeans commands:
|
||||
- make it possible to have 'defineAnnoType' also handle terminal colors.
|
||||
- Improve debugger interface:
|
||||
Include all debug features of Agide.
|
||||
- Implement the right-click popup menu for the terminal. Can use the
|
||||
completion popup menu code and mouse dragging.
|
||||
Use it for "set breakpoint", "remove breakpoint", etc.
|
||||
- make showballoon() work in a terminal. Requires getting mouse-move
|
||||
events.
|
||||
- send 'balloonText' events for the cursor position (using CursorHold ?)
|
||||
in terminal mode.
|
||||
- Feature: switch between "running job" and a normal buffer (possibly
|
||||
read-only) to allow for searching, copy/paste, etc. (Domnique). Having a
|
||||
(large) scrollback would be useful.
|
||||
- get ideas from http://clewn.sf.net
|
||||
- Look into the idevim plugin/script.
|
||||
- Improve testing:
|
||||
Make a screenshot of a terminal, store in a file.
|
||||
Display a stored screenshot, display diff with another one.
|
||||
Make a test that puts Vim in a specific state, make a screenshot and compare
|
||||
with the expected screenshot. Set t_Co to 256.
|
||||
|
||||
+channel:
|
||||
- Try out background make plugin:
|
||||
https://github.com/AndrewVos/vim-make-background
|
||||
- Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026)
|
||||
- Add 'cwd' argument to start_job(): directory to change to in the child.
|
||||
check for valid directory before forking.
|
||||
Part of patch for environment, Yasuhiro Matsumoto, #1160
|
||||
- Writing raw mode to a buffer should still handle NL characters as line
|
||||
breaks. (Dmitry Zotikov, 2017 Aug 16)
|
||||
- When out_cb executes :sleep, the close_cb may be invoked. (Daniel Hahler,
|
||||
2016 Dec 11, #1320)
|
||||
- Implement |job-term| ?
|
||||
@@ -77,7 +89,7 @@ Terminal emulator window:
|
||||
Feb 9) How to do this on MS-Windows?
|
||||
- For connection to server, a "keep open" flag would be useful. Retry
|
||||
connecting in the main loop with zero timeout.
|
||||
- job_start(): run job in a newly opened terminal.
|
||||
- job_start(): run job in a newly opened terminal (not a terminal window).
|
||||
With xterm could use -S{pty}.
|
||||
Although user could use "xterm -e 'cmd arg'".
|
||||
|
||||
@@ -125,12 +137,61 @@ Regexp problems:
|
||||
Another one: echom matchstr(" sdfsfsf\n sfdsdfsdf",'[^\n]*')
|
||||
(2017 May 15, #1252)
|
||||
|
||||
Patch for quickfix: parse lines for any quickfix list. (Yegappan Lakshmanan,
|
||||
2017 Jul 20)
|
||||
Include a few color schemes, based on popularity:
|
||||
http://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=rating&direction=descending&search=search
|
||||
http://vimawesome.com/?q=tag:color-scheme
|
||||
Use names that indicate their appearnce (Christian Brabandt, 2017 Aug 3)
|
||||
- monokai - Xia Crusoe (2017 Aug 4)
|
||||
- seoul256 - Christian Brabandt (2017 Aug 3)
|
||||
- gruvbox - Christian Brabandt (2017 Aug 3)
|
||||
- janah - Marco Hinz (2017 Aug 4)
|
||||
- apprentice - Romain Lafourcade (2017 Aug 6) remarks about help file #1964
|
||||
Suggested by Hiroki Kokubun:
|
||||
- [Iceberg](https://github.com/cocopon/iceberg.vim) (my one)
|
||||
- [hybrid](https://github.com/w0ng/vim-hybrid)
|
||||
|
||||
Patch to update Brazilian translations. (Eduardo Dobay, 2017 Sep 10, #2077)
|
||||
|
||||
When starting with --clean packages under "start" are not loaded. Make this
|
||||
work: :packadd START {name} similar to :runtime START name
|
||||
|
||||
Patch to refactor qf_jump(). (Yegappan, 2017 Sep 17)
|
||||
|
||||
When using :packadd files under "later" are not used, which is inconsistent
|
||||
with packages under "start". (xtal8, #1994)
|
||||
|
||||
After 8.0.0962 pasting leaves the cursor in another position. (Ken Takata,
|
||||
2017 Aug 23, #2015) Also (zdm, 2017 Aug 23)
|
||||
|
||||
Patch to fix popup menu drawing when changing the window size. (Ozaki Kiichi,
|
||||
2017 Sep 17, #2110)
|
||||
|
||||
Patch to fix cursor highlighting with match. (Ozaki Kiichi, 2017 Sep 17,
|
||||
#2111)
|
||||
|
||||
Patch for not profiling the first line of a script. (Lemonboy, 2017 Sep 17,
|
||||
#2103)
|
||||
|
||||
Mac Terminal.app: ctermbg=15 gives light grey instead of white.
|
||||
ctermbg=256 breaks clearing till end of the line. Both work fine in xterm.
|
||||
|
||||
Using ":hi" causes a redraw, but a redraw may update the status line, which
|
||||
may trigger a ":hi" command.
|
||||
|
||||
Last line not in profile if it is a continuation line. (LemonBoy, 2017 Sep 17,
|
||||
#2112)
|
||||
|
||||
"vim -c startinsert!" doesn't append. (#2117)
|
||||
|
||||
With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
|
||||
(Marcin Szewczyk, 2017 Apr 26)
|
||||
|
||||
Patch to make Mac features more clear and add "macdarwin". (Kazunobu Kuriyama,
|
||||
2017 Sep 5)
|
||||
|
||||
Using 'wildignore' also applies to literally entered file name. Also with
|
||||
:drop (remote commands).
|
||||
|
||||
ml_get error when using a Python. (Yggdroot, 2017 Jun 1, #1737)
|
||||
Lemonboy can reproduce (2017 Jun 5)
|
||||
|
||||
@@ -138,27 +199,52 @@ ml_get errors with buggy script. (Dominique, 2017 Apr 30)
|
||||
|
||||
Error in emsg with buggy script. (Dominique, 2017 Apr 30)
|
||||
|
||||
Better detection of strace file. (Steven Fernandez, 2017 Jul 12, #1837)
|
||||
Patch to make ":set scroll&" work properly. (Ozaki Kiichi, 2017 Sep 17, #2104)
|
||||
|
||||
Bug with conceal mode: 3rd element returned by synconcealed() differs for
|
||||
every call. (Dominique Pelle, 2017 Jun 18)
|
||||
mswin.vim should not map CTRL-F in the console (#2093)
|
||||
Patch from Christian, 2017 Sep 15.
|
||||
|
||||
Default install on MS-Windows should source defaults.vim.
|
||||
Ask whether to use Windows or Vim key behavior?
|
||||
|
||||
matchit hasn't been maintained for a long time. #955.
|
||||
|
||||
Test runtime files.
|
||||
Start with filetype detection: testdir/test_filetype.vim
|
||||
|
||||
Window not closed when deleting buffer. (Harm te Hennepe, 2017 Aug 27, #2029)
|
||||
|
||||
Add options_default() / options_restore() to set several options to Vim
|
||||
defaults for a plugin. Comments from Zyx, 2017 May 10.
|
||||
Perhaps use a vimcontext / endvimcontext command block.
|
||||
|
||||
After using :noautocmd CursorMoved may still trigger. (Andy Stewart, 2017 Sep
|
||||
13, #2084). Set old position after the command.
|
||||
|
||||
Illegal memory access, requires ASAN to see. (Dominique Pelle, 2015 Jul 28)
|
||||
Still happens (2017 Jul 9)
|
||||
|
||||
Memory leak in test_arabic.
|
||||
When bracketed paste is used, pasting at the ":append" prompt does not get the
|
||||
line breaks. (Ken Takata, 2017 Aug 22)
|
||||
|
||||
Include Haiku port? (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
|
||||
This example in the help does not work (Andy Wokula, 2017 Aug 20):
|
||||
augroup mine | au! BufRead | augroup END
|
||||
|
||||
Memory leaks in test_channel? (or is it because of fork())
|
||||
Memory leak in test_arabic.
|
||||
Using uninitialized value in test_crypt.
|
||||
|
||||
Patch to make gM move to middle of line. (Yasuhiro Matsumoto, Sep 8, #2070)
|
||||
|
||||
Include Haiku port. (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
|
||||
It can replace the BeOS code, which is likely not used anymore.
|
||||
Now on github: #1856. Is not up-to-date.
|
||||
Now on github: #1856.
|
||||
Got permission to include this under the Vim license.
|
||||
|
||||
Refactored HTML indent file. (Michael Lee, #1821)
|
||||
|
||||
Using uninitialzed value in test_crypt.
|
||||
Test_writefile_fails_conversion failure on Solaris because if different iconv
|
||||
behavior. Skip when "uname" returns "SunOS"? (Pavel Heimlich, #1872)
|
||||
|
||||
All functions are global, which makes functions like get() and len() awkward.
|
||||
For the future use the ~get() and ~len() syntax, e.g.:
|
||||
@@ -172,16 +258,37 @@ Alternatives for ~:
|
||||
@ list@get() harder to read
|
||||
-> list->get() two characters, used for lambda
|
||||
|
||||
The ++ options for the :edit command are also useful on the Vim command line.
|
||||
|
||||
Overlong utf-8 sequence is displayed wrong. (Harm te Hennepe, 2017 Sep 14,
|
||||
#2089) Patch with possible solution by Björn Linse.
|
||||
|
||||
X11: Putting more than about 262040 characters of text on the clipboard and
|
||||
pasting it in another Vim doesn't work. (Dominique Pelle, 2008 Aug 21-23)
|
||||
clip_x11_request_selection_cb() is called with zero value and length.
|
||||
Also: Get an error message from free() in the process that owns the selection.
|
||||
Seems to happen when the selection is requested the second time, but before
|
||||
clip_x11_convert_selection_cb() is invoked, thus in X library code.
|
||||
Patch to fix this by Kiichi, 2017 Jul 11, #1822)
|
||||
Kazunobu Kuriyama is working on a proper fix. (2017 Jul 25)
|
||||
|
||||
Problem with three-piece comment. (Michael Lee, 2017 May 11, #1696)
|
||||
|
||||
Creating a partial with an autoload function is confused about the "self"
|
||||
attribute of the function. For an unknown function assume "self" and make
|
||||
that optiona? (Bjorn Linse, 2017 Aug 5)
|
||||
|
||||
Cindent: returning a structure has more indent for the second item.
|
||||
(Sam Pagenkopf, 2017 Sep 14, #2090)
|
||||
|
||||
Completion mixes results from the current buffer with tags and other files.
|
||||
Happens when typing CTRL-N while still search for results. E.g., type "b_" in
|
||||
terminal.c and then CTRL-N twice.
|
||||
Should do current file first and not split it up when more results are found.
|
||||
(Also #1890)
|
||||
|
||||
Python: After "import vim" error messages only show the first line of the
|
||||
stack trace. (Yggdroot, 2017 Jul 28, #1887)
|
||||
|
||||
When checking if a bufref is valid, also check the buffer number, to catch the
|
||||
case of :bwipe followed by :new.
|
||||
|
||||
@@ -189,7 +296,7 @@ Patch to skip writing a temp file for diffing if the buffer is equal to the
|
||||
existing file. (Akria Sheng, 2017 Jul 22)
|
||||
Could also skip writing lines that are the same.
|
||||
|
||||
Files for Latvian language. (Vitolins, 2017 May 3, #1675)
|
||||
Patch with Files for Latvian language. (Vitolins, 2017 May 3, #1675)
|
||||
|
||||
MS-Windows: Opening same file in a second gvim hangs. (Sven Bruggemann, 2017
|
||||
Jul 4)
|
||||
@@ -237,6 +344,9 @@ Is it possible to keep the complete menu open when calling complete()?
|
||||
|
||||
Memory leak in test97? The string is actually freed. Weird.
|
||||
|
||||
Patch to add configure flags to skip rtl, farsi and arabic support.
|
||||
(Diego Carrión, #1867)
|
||||
|
||||
assert_fails() can only check for the first error. Make it possible to have
|
||||
it catch multiple errors and check all of them.
|
||||
|
||||
@@ -253,12 +363,7 @@ Still need maplist() to find the mappings. What can we use to identify a
|
||||
mapping? Something unique would be better than the LHS.
|
||||
Perhaps simpler: actually delete the mappings. Use maplist() to list matching
|
||||
mappings (with a lhs prefix, like maparg()), mapdelete() to delete,
|
||||
maprestore() to restore (using the output of maplist().
|
||||
|
||||
Patch to add setbufline(). (email from Yasuhiro Matsumoto, patch by Ozaki
|
||||
Kiichi, 2016 Feb 28)
|
||||
Update Mar 8: https://gist.github.com/mattn/23c1f50999084992ca98
|
||||
Update Mar 13: https://gist.github.com/mattn/23c1f50999084992ca98
|
||||
maprestore() to restore (using the output of maplist()).
|
||||
|
||||
Add an argument to :mkvimrc (or add aother command) to skip mappings from
|
||||
plugins (source is a Vim script). No need to put these in a .vimrc, they will
|
||||
@@ -335,9 +440,6 @@ Implement optional arguments for functions.
|
||||
call Foo(12, all = 0)
|
||||
call Foo(12, 15, 0)
|
||||
|
||||
Patch to support on-the-spot and over-the-spot input method. (Ken Takata, 2017
|
||||
Feb 14).
|
||||
|
||||
Change the Farsi code to work with UTF-8. Possibly combined with the Arabic
|
||||
support, or similar.
|
||||
Invalid read error in Farsi mode. (Dominique Pelle, 2009 Aug 2)
|
||||
@@ -352,11 +454,9 @@ Patch to add random number generator. (Hong Xu, 2010 Nov 8, update Nov 10)
|
||||
Alternative from Christian Brabandt. (2010 Sep 19)
|
||||
New one from Yasuhiro Matsumoto, #1277.
|
||||
|
||||
Patch for restoring wide characters in the console buffer.
|
||||
(Ken Takata, 2016 Jun 7)
|
||||
|
||||
Patch to fix escaping of job arguments. (Yasuhiro Matsumoto, 2016 Oct 5)
|
||||
Update Oct 14: https://gist.github.com/mattn/d47e7d3bfe5ade4be86062b565a4bfca
|
||||
Update Aug 2017: #1954
|
||||
|
||||
Characters deleted on completion. (Adrià Farrés, 2017 Apr 20, #1645)
|
||||
Remarks from Christian Brabandt (Apr 21)
|
||||
@@ -379,7 +479,7 @@ MS-Windows. Perhaps in \# the \ is seen as a path separator. (Axel Bender,
|
||||
2017 Feb 9) Can we expand wildcards first and send the path literally to the
|
||||
receiving Vim? Or make an exception for #, it's not useful remotely.
|
||||
|
||||
":sbr" docs state it respect 'switchbuf', but "vsplit" does not cause a
|
||||
":sbr" docs state it respects 'switchbuf', but "vsplit" does not cause a
|
||||
vertical split. (Haldean Brown, 2017 Mar 1)
|
||||
|
||||
Use ADDR_OTHER instead of ADDR_LINES for many more commands.
|
||||
@@ -579,11 +679,6 @@ Reject the value? #710.
|
||||
Patch to fix increment/decrement not working properly when 'virtualedit' is
|
||||
set. (Hirohito Higashi, 2016 Aug 1, #923)
|
||||
|
||||
Patch to support strikethrough next to bold and italic. (Christian Brabandt,
|
||||
2013 Jul 30) Update from Ken Takata, 2013 Oct 12.
|
||||
Update mentioned by Christian, 2016 Apr 25.
|
||||
Update from Ken Takata, 2016 Jul 17.
|
||||
|
||||
When doing "vi buf.md" a BufNew autocommand for *.md is not triggered.
|
||||
Because of using the initial buffer? (Dun Peal, 2016 May 12)
|
||||
|
||||
@@ -1351,9 +1446,6 @@ Windows keys not set properly on Windows 7? (cncyber, 2010 Aug 26)
|
||||
When using a Vim server, a # in the path causes an error message.
|
||||
(Jeff Lanzarotta, 2011 Feb 17)
|
||||
|
||||
Setting $HOME on MS-Windows is not very well documented. Suggestion by Ben
|
||||
Fritz (2011 Oct 27).
|
||||
|
||||
When there is a ">" in a line that "gq" wraps to the start of the next line,
|
||||
then the following line will pick it up as a leader. Should get the leader
|
||||
from the first line, not a wrapped line. (Matt Ackeret, 2012 Feb 27)
|
||||
@@ -1458,6 +1550,9 @@ GTK: tear-off menu does not work. (Kurt Sonnenmoser, 2010 Oct 25)
|
||||
Win32: tear-off menu does not work when menu language is German. (Markus
|
||||
Bossler, 2011 Mar 2) Fixed by 7.3.095?
|
||||
|
||||
Wish for NetBeans commands:
|
||||
- make it possible to have 'defineAnnoType' also handle terminal colors.
|
||||
|
||||
Version of netbeans.c for use with MacVim. (Kazuki Sakamoto, 2010 Nov 18)
|
||||
|
||||
7.3.014 changed how backslash at end of line works, but still get a NUL when
|
||||
@@ -3648,7 +3743,7 @@ Multi-byte characters:
|
||||
at a multi-byte character >= 0x100.
|
||||
- Add the possibility to enter mappings which are used whenever normal text
|
||||
could be entered. E.g., for "f" command. But not in Normal mode. Sort
|
||||
of opposite of 'langmap'. Use ":tmap" command?
|
||||
of opposite of 'langmap'. Use ":amap" command?
|
||||
- When breaking a line, take properties of multi-byte characters into
|
||||
account. The "linebreak" program from Bruno Haible can do it:
|
||||
ftp://ftp.ilog.fr/pub/Users/haible/gnu/linebreak-0.1.tar.gz
|
||||
@@ -5620,11 +5715,11 @@ Various improvements:
|
||||
- Support %name% expansion for "gf" on Windows.
|
||||
- Make "gf" work on "file://c:/path/name". "file:/c:/" and "file:///c:/"
|
||||
should also work?
|
||||
- Add 'urlpath', used like 'path' for when "gf" used on an URL?
|
||||
- Add 'urlpath', used like 'path' for when "gf" used on a URL?
|
||||
8 When using "gf" on an absolute file name, while editing a remote file
|
||||
(starts with scp:// or http://) should prepend the method and machine
|
||||
name.
|
||||
- When finding an URL or file name, and it doesn't exist, try removing a
|
||||
- When finding a URL or file name, and it doesn't exist, try removing a
|
||||
trailing '.'.
|
||||
- Add ":path" command modifier. Should work for every command that takes a
|
||||
file name argument, to search for the file name in 'path'. Use
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_07.txt* For Vim version 8.0. Last change: 2006 Apr 24
|
||||
*usr_07.txt* For Vim version 8.0. Last change: 2017 Sep 18
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -215,14 +215,14 @@ change: >
|
||||
|
||||
`.
|
||||
|
||||
Suppose you are editing the file "one.txt". Somewhere halfway the file you
|
||||
use "x" to delete a character. Then you go to the last line with "G" and
|
||||
write the file with ":w". You edit several other files, and then use ":edit
|
||||
one.txt" to come back to "one.txt". If you now use `" Vim jumps to the last
|
||||
line of the file. Using `. takes you to the position where you deleted the
|
||||
character. Even when you move around in the file `" and `. will take you to
|
||||
the remembered position. At least until you make another change or leave the
|
||||
file.
|
||||
Suppose you are editing the file "one.txt". Somewhere halfway through the
|
||||
file you use "x" to delete a character. Then you go to the last line with "G"
|
||||
and write the file with ":w". You edit several other files, and then use
|
||||
":edit one.txt" to come back to "one.txt". If you now use `" Vim jumps to the
|
||||
last line of the file. Using `. takes you to the position where you deleted
|
||||
the character. Even when you move around in the file `" and `. will take you
|
||||
to the remembered position. At least until you make another change or leave
|
||||
the file.
|
||||
|
||||
|
||||
FILE MARKS
|
||||
@@ -233,8 +233,8 @@ another file and place marks there, these are specific for that file. Thus
|
||||
each file has its own set of marks, they are local to the file.
|
||||
So far we were using marks with a lowercase letter. There are also marks
|
||||
with an uppercase letter. These are global, they can be used from any file.
|
||||
For example suppose that we are editing the file "foo.txt". Go to halfway the
|
||||
file ("50%") and place the F mark there (F for foo): >
|
||||
For example suppose that we are editing the file "foo.txt". Go to halfway
|
||||
down the file ("50%") and place the F mark there (F for foo): >
|
||||
|
||||
50%mF
|
||||
|
||||
@@ -355,7 +355,7 @@ a sentence to the f register (f for First): >
|
||||
"fyas
|
||||
|
||||
The "yas" command yanks a sentence like before. It's the "f that tells Vim
|
||||
the text should be place in the f register. This must come just before the
|
||||
the text should be placed in the f register. This must come just before the
|
||||
yank command.
|
||||
Now yank three whole lines to the l register (l for line): >
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_08.txt* For Vim version 8.0. Last change: 2014 Jul 06
|
||||
*usr_08.txt* For Vim version 8.0. Last change: 2017 Aug 11
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -45,7 +45,7 @@ top one:
|
||||
+----------------------------------+
|
||||
|
||||
What you see here is two windows on the same file. The line with "====" is
|
||||
that status line. It displays information about the window above it. (In
|
||||
the status line. It displays information about the window above it. (In
|
||||
practice the status line will be in reverse video.)
|
||||
The two windows allow you to view two parts of the same file. For example,
|
||||
you could make the top window show the variable declarations of a program, and
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_09.txt* For Vim version 8.0. Last change: 2006 Apr 24
|
||||
*usr_09.txt* For Vim version 8.0. Last change: 2017 Aug 11
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -60,7 +60,7 @@ THE WINDOW TITLE
|
||||
At the very top is the window title. This is drawn by your window system.
|
||||
Vim will set the title to show the name of the current file. First comes the
|
||||
name of the file. Then some special characters and the directory of the file
|
||||
in parens. These special character can be present:
|
||||
in parens. These special characters can be present:
|
||||
|
||||
- The file cannot be modified (e.g., a help file)
|
||||
+ The file contains changes
|
||||
@@ -206,7 +206,7 @@ the "real clipboard" are called clipboard, you'll have to get used to that.
|
||||
To put text on the real clipboard, select a few different words in one of
|
||||
the gVims you have running. Then use the Edit/Copy menu entry. Now the text
|
||||
has been copied to the real clipboard. You can't see this, unless you have
|
||||
some application that shows the clipboard contents (e.g., KDE's klipper).
|
||||
some application that shows the clipboard contents (e.g., KDE's Klipper).
|
||||
Now select the other gVim, position the cursor somewhere and use the
|
||||
Edit/Paste menu. You will see the text from the real clipboard is inserted.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_12.txt* For Vim version 8.0. Last change: 2007 May 11
|
||||
*usr_12.txt* For Vim version 8.0. Last change: 2017 Aug 11
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -290,7 +290,7 @@ command: >
|
||||
The line range "%" is used, thus this works on the whole file. The pattern
|
||||
that the ":substitute" command matches with is "\s\+$". This finds white
|
||||
space characters (\s), 1 or more of them (\+), before the end-of-line ($).
|
||||
Later will be explained how you write patterns like this |usr_27.txt|.
|
||||
Later will be explained how you write patterns like this, see |usr_27.txt|.
|
||||
The "to" part of the substitute command is empty: "//". Thus it replaces
|
||||
with nothing, effectively deleting the matched white space.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 8.0. Last change: 2017 Jul 19
|
||||
*usr_41.txt* For Vim version 8.0. Last change: 2017 Aug 22
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -966,6 +966,23 @@ Jobs: *job-functions*
|
||||
job_info() get information about a job
|
||||
job_setoptions() set options for a job
|
||||
|
||||
Terminal window: *terminal-functions*
|
||||
term_start() open a terminal window and run a job
|
||||
term_list() get the list of terminal buffers
|
||||
term_sendkeys() send keystrokes to a terminal
|
||||
term_wait() wait for screen to be updated
|
||||
term_getjob() get the job associated with a terminal
|
||||
term_scrape() get row of a terminal screen
|
||||
term_getline() get a line of text from a terminal
|
||||
term_getattr() get the value of attribute {what}
|
||||
term_getcursor() get the cursor position of a terminal
|
||||
term_getscrolled() get the scroll count of a terminal
|
||||
term_getaltscreen() get the alternate screen flag
|
||||
term_getsize() get the size of a terminal
|
||||
term_getstatus() get the status of a terminal
|
||||
term_gettitle() get the title of a terminal
|
||||
term_gettty() get the tty name of a terminal
|
||||
|
||||
Timers: *timer-functions*
|
||||
timer_start() create a timer
|
||||
timer_pause() pause or unpause a timer
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 8.0. Last change: 2017 Feb 24
|
||||
*various.txt* For Vim version 8.0. Last change: 2017 Sep 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -322,7 +322,7 @@ N *+cindent* |'cindent'|, C indenting
|
||||
N *+clientserver* Unix and Win32: Remote invocation |clientserver|
|
||||
*+clipboard* |clipboard| support
|
||||
N *+cmdline_compl* command line completion |cmdline-completion|
|
||||
N *+cmdline_hist* command line history |cmdline-history|
|
||||
S *+cmdline_hist* command line history |cmdline-history|
|
||||
N *+cmdline_info* |'showcmd'| and |'ruler'|
|
||||
N *+comments* |'comments'| support
|
||||
B *+conceal* "conceal" support, see |conceal| |:syn-conceal| etc.
|
||||
@@ -361,7 +361,7 @@ m *+hangul_input* Hangul input support |hangul|
|
||||
*+iconv/dyn* Likewise |iconv-dynamic| |/dyn|
|
||||
N *+insert_expand* |insert_expand| Insert mode completion
|
||||
m *+job* starting and stopping jobs |job|
|
||||
N *+jumplist* |jumplist|
|
||||
S *+jumplist* |jumplist|
|
||||
B *+keymap* |'keymap'|
|
||||
N *+lambda* |lambda| and |closure|
|
||||
B *+langmap* |'langmap'|
|
||||
@@ -427,6 +427,7 @@ N *+tag_old_static* old method for static tags |tag-old-static|
|
||||
m *+tag_any_white* any white space allowed in tags file |tag-any-white|
|
||||
m *+tcl* Tcl interface |tcl|
|
||||
m *+tcl/dyn* Tcl interface |tcl-dynamic| |/dyn|
|
||||
m *+terminal* Support for terminal window |terminal|
|
||||
*+terminfo* uses |terminfo| instead of termcap
|
||||
N *+termresponse* support for |t_RV| and |v:termresponse|
|
||||
B *+termguicolors* 24-bit color in xterm-compatible terminals support
|
||||
@@ -437,14 +438,16 @@ N *+title* Setting the window 'title' and 'icon'
|
||||
N *+toolbar* |gui-toolbar|
|
||||
N *+user_commands* User-defined commands. |user-commands|
|
||||
N *+viminfo* |'viminfo'|
|
||||
N *+vertsplit* Vertically split windows |:vsplit|
|
||||
*+vertsplit* Vertically split windows |:vsplit|; Always enabled
|
||||
since 8.0.1118.
|
||||
in sync with the |+windows| feature
|
||||
N *+virtualedit* |'virtualedit'|
|
||||
S *+visual* Visual mode |Visual-mode| Always enabled since 7.4.200.
|
||||
N *+visualextra* extra Visual mode commands |blockwise-operators|
|
||||
N *+vreplace* |gR| and |gr|
|
||||
N *+wildignore* |'wildignore'|
|
||||
N *+wildmenu* |'wildmenu'|
|
||||
S *+windows* more than one window
|
||||
*+windows* more than one window; Always enabled sinde 8.0.1118.
|
||||
m *+writebackup* |'writebackup'| is default on
|
||||
m *+xim* X input method |xim|
|
||||
*+xfontset* X fontset support |xfontset|
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.TH VIM 1 "2006 Apr 11"
|
||||
.SH NAME
|
||||
vim \- Vi IMproved, a programmers text editor
|
||||
vim \- Vi IMproved, a programmer's text editor
|
||||
.SH SYNOPSIS
|
||||
.br
|
||||
.B vim
|
||||
|
||||
@@ -3,7 +3,7 @@ VIM(1) General Commands Manual VIM(1)
|
||||
|
||||
|
||||
NAME
|
||||
vim - Vi IMproved, a programmers text editor
|
||||
vim - Vi IMproved, a programmer's text editor
|
||||
|
||||
SYNOPSIS
|
||||
vim [options] [file ..]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*visual.txt* For Vim version 8.0. Last change: 2014 Mar 23
|
||||
*visual.txt* For Vim version 8.0. Last change: 2017 Sep 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -314,8 +314,8 @@ Visual-block Insert *v_b_I*
|
||||
With a blockwise selection, I{string}<ESC> will insert {string} at the start
|
||||
of block on every line of the block, provided that the line extends into the
|
||||
block. Thus lines that are short will remain unmodified. TABs are split to
|
||||
retain visual columns.
|
||||
See |v_b_I_example|.
|
||||
retain visual columns. Works only for adding text to a line, not for
|
||||
deletions. See |v_b_I_example|.
|
||||
|
||||
Visual-block Append *v_b_A*
|
||||
With a blockwise selection, A{string}<ESC> will append {string} to the end of
|
||||
@@ -331,6 +331,7 @@ See |v_b_A_example|.
|
||||
Note: "I" and "A" behave differently for lines that don't extend into the
|
||||
selected block. This was done intentionally, so that you can do it the way
|
||||
you want.
|
||||
Works only for adding text to a line, not for deletions.
|
||||
|
||||
Visual-block change *v_b_c*
|
||||
All selected text in the block will be replaced by the same text string. When
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*windows.txt* For Vim version 8.0. Last change: 2017 Jul 23
|
||||
*windows.txt* For Vim version 8.0. Last change: 2017 Sep 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -344,8 +344,9 @@ CTRL-W CTRL-C *CTRL-W_CTRL-C*
|
||||
*:hide*
|
||||
:hid[e]
|
||||
:{count}hid[e]
|
||||
Quit the current window, unless it is the last window on the
|
||||
screen. For {count} see |:quit| command.
|
||||
Without {count}: Quit the current window, unless it is the
|
||||
last window on the screen.
|
||||
If {count} is given quit the {count} window.
|
||||
|
||||
The buffer becomes hidden (unless there is another window
|
||||
editing it or 'bufhidden' is "unload", "delete" or "wipe").
|
||||
@@ -1031,6 +1032,9 @@ list of buffers. |unlisted-buffer|
|
||||
displayed in a window |hidden-buffer|
|
||||
- a buffer with 'modifiable' off
|
||||
= a readonly buffer
|
||||
R a terminal buffer with a running job
|
||||
F a terminal buffer with a finished job
|
||||
? a terminal buffer without a job: `:terminal NONE`
|
||||
+ a modified buffer
|
||||
x a buffer with read errors
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2017 Jul 11
|
||||
" Last Change: 2017 Aug 11
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -1027,7 +1027,7 @@ au BufNewFile,BufRead *.java,*.jav setf java
|
||||
au BufNewFile,BufRead *.jj,*.jjt setf javacc
|
||||
|
||||
" JavaScript, ECMAScript
|
||||
au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx setf javascript
|
||||
au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx,*.mjs setf javascript
|
||||
|
||||
" Java Server Pages
|
||||
au BufNewFile,BufRead *.jsp setf jsp
|
||||
@@ -1342,6 +1342,9 @@ au BufNewFile,BufRead *.mush setf mush
|
||||
" Mutt setup file (also for Muttng)
|
||||
au BufNewFile,BufRead Mutt{ng,}rc setf muttrc
|
||||
|
||||
" N1QL
|
||||
au BufRead,BufNewfile *.n1ql,*.nql setf n1ql
|
||||
|
||||
" Nano
|
||||
au BufNewFile,BufRead */etc/nanorc,*.nanorc setf nanorc
|
||||
|
||||
@@ -2267,6 +2270,8 @@ func! s:FTtex()
|
||||
elseif format == 'plaintex'
|
||||
let format = 'plain'
|
||||
endif
|
||||
elseif expand('%') =~ 'tex/context/.*/.*.tex'
|
||||
let format = 'context'
|
||||
else
|
||||
" Default value, may be changed later:
|
||||
let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain'
|
||||
@@ -2308,7 +2313,7 @@ func! s:FTtex()
|
||||
endfunc
|
||||
|
||||
" ConTeXt
|
||||
au BufNewFile,BufRead tex/context/*/*.tex,*.mkii,*.mkiv,*.mkvi setf context
|
||||
au BufNewFile,BufRead *.mkii,*.mkiv,*.mkvi setf context
|
||||
|
||||
" Texinfo
|
||||
au BufNewFile,BufRead *.texinfo,*.texi,*.txi setf texinfo
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: vim-perl <vim-perl@googlegroups.com>
|
||||
" Homepage: http://github.com/vim-perl/vim-perl
|
||||
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
|
||||
" Last Change: 2013-07-21
|
||||
" Last Change: 2015-02-09
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
@@ -33,14 +33,14 @@ endif
|
||||
setlocal include=\\<\\(use\\\|require\\)\\>
|
||||
setlocal includeexpr=substitute(substitute(substitute(v:fname,'::','/','g'),'->\*','',''),'$','.pm','')
|
||||
setlocal define=[^A-Za-z_]
|
||||
setlocal iskeyword+=:
|
||||
|
||||
" The following line changes a global variable but is necessary to make
|
||||
" gf and similar commands work. The change to iskeyword was incorrect.
|
||||
" Thanks to Andrew Pimlott for pointing out the problem. If this causes a
|
||||
" problem for you, add an after/ftplugin/perl.vim file that contains
|
||||
" gf and similar commands work. Thanks to Andrew Pimlott for pointing
|
||||
" out the problem. If this causes a problem for you, add an
|
||||
" after/ftplugin/perl.vim file that contains
|
||||
" set isfname-=:
|
||||
set isfname+=:
|
||||
set iskeyword+=:
|
||||
|
||||
" Set this once, globally.
|
||||
if !exists("perlpath")
|
||||
@@ -77,11 +77,12 @@ endif
|
||||
"---------------------------------------------
|
||||
|
||||
" Undo the stuff we changed.
|
||||
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< kp< path<" .
|
||||
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isk< isf< kp< path<" .
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
" proper matching for matchit plugin
|
||||
let b:match_skip = 's:comment\|string\|perlQQ\|perlShellCommand\|perlHereDoc\|perlSubstitution\|perlTranslation\|perlMatch\|perlFormatField'
|
||||
let b:match_words = '\<if\>:\<elsif\>:\<else\>'
|
||||
|
||||
" Restore the saved compatibility options.
|
||||
let &cpo = s:save_cpo
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Verilog HDL
|
||||
" Maintainer: Chih-Tsun Huang <cthuang@larc.ee.nthu.edu.tw>
|
||||
" Last Change: Wed Sep 3 15:24:49 CST 2008
|
||||
" URL: http://larc.ee.nthu.edu.tw/~cthuang/vim/ftplugin/verilog.vim
|
||||
" Maintainer: Chih-Tsun Huang <cthuang@cs.nthu.edu.tw>
|
||||
" Last Change: 2017 Aug 25 by Chih-Tsun Huang
|
||||
" URL: http://www.cs.nthu.edu.tw/~cthuang/vim/ftplugin/verilog.vim
|
||||
"
|
||||
" Credits:
|
||||
" Suggestions for improvement, bug reports by
|
||||
" Shao <shaominghai2005@163.com>
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -45,11 +49,16 @@ if exists("loaded_matchit")
|
||||
\ '\<begin\>:\<end\>,' .
|
||||
\ '\<case\>\|\<casex\>\|\<casez\>:\<endcase\>,' .
|
||||
\ '\<module\>:\<endmodule\>,' .
|
||||
\ '\<if\>:\<else\>,' .
|
||||
\ '\<if\>:`\@<!\<else\>,' .
|
||||
\ '\<function\>:\<endfunction\>,' .
|
||||
\ '`ifdef\>:`else\>:`endif\>,' .
|
||||
\ '`ifn\?def\>:`elsif\>:`else\>:`endif\>,' .
|
||||
\ '\<task\>:\<endtask\>,' .
|
||||
\ '\<specify\>:\<endspecify\>'
|
||||
\ '\<specify\>:\<endspecify\>,' .
|
||||
\ '\<config\>:\<endconfig\>,' .
|
||||
\ '\<generate\>:\<endgenerate\>,' .
|
||||
\ '\<fork\>:\<join\>,' .
|
||||
\ '\<primitive\>:\<endprimitive\>,' .
|
||||
\ '\<table\>:\<endtable\>'
|
||||
endif
|
||||
|
||||
" Reset 'cpoptions' back to the user's setting
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Zsh shell script
|
||||
" Maintainer: Christian Brabandt <cb@256bit.org>
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2015-05-29
|
||||
" License: Vim (see :h license)
|
||||
" Repository: https://github.com/chrisbra/vim-zsh
|
||||
" Language: Zsh shell script
|
||||
" Maintainer: Christian Brabandt <cb@256bit.org>
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2015-05-29
|
||||
" License: Vim (see :h license)
|
||||
" Repository: https://github.com/chrisbra/vim-zsh
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
" Vim indent file
|
||||
" Program: CMake - Cross-Platform Makefile Generator
|
||||
" Module: $RCSfile: cmake-indent.vim,v $
|
||||
" Language: CMake (ft=cmake)
|
||||
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>
|
||||
" Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
|
||||
" Last Change: $Date: 2008-01-16 16:53:53 $
|
||||
" Version: $Revision: 1.9 $
|
||||
" Maintainer: Dimitri Merejkowsky <d.merej@gmail.com>
|
||||
" Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
|
||||
" Last Change: 2017 Aug 30
|
||||
"
|
||||
" Licence: The CMake license applies to this file. See
|
||||
" http://www.cmake.org/HTML/Copyright.html
|
||||
" https://cmake.org/licensing
|
||||
" This implies that distribution with Vim is allowed
|
||||
|
||||
if exists("b:did_indent")
|
||||
@@ -16,6 +14,7 @@ if exists("b:did_indent")
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal et
|
||||
setlocal indentexpr=CMakeGetIndent(v:lnum)
|
||||
setlocal indentkeys+==ENDIF(,ENDFOREACH(,ENDMACRO(,ELSE(,ELSEIF(,ENDWHILE(
|
||||
|
||||
@@ -68,19 +67,19 @@ fun! CMakeGetIndent(lnum)
|
||||
let ind = ind
|
||||
else
|
||||
if previous_line =~? cmake_indent_begin_regex
|
||||
let ind = ind + shiftwidth()
|
||||
let ind = ind + &sw
|
||||
endif
|
||||
if previous_line =~? cmake_indent_open_regex
|
||||
let ind = ind + shiftwidth()
|
||||
let ind = ind + &sw
|
||||
endif
|
||||
endif
|
||||
|
||||
" Subtract
|
||||
if this_line =~? cmake_indent_end_regex
|
||||
let ind = ind - shiftwidth()
|
||||
let ind = ind - &sw
|
||||
endif
|
||||
if previous_line =~? cmake_indent_close_regex
|
||||
let ind = ind - shiftwidth()
|
||||
let ind = ind - &sw
|
||||
endif
|
||||
|
||||
return ind
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: Javascript
|
||||
" Maintainer: Chris Paul ( https://github.com/bounceme )
|
||||
" URL: https://github.com/pangloss/vim-javascript
|
||||
" Last Change: March 21, 2017
|
||||
" Last Change: September 18, 2017
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
@@ -10,6 +10,10 @@ if exists('b:did_indent')
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
" indent correctly if inside <script>
|
||||
" vim/vim@690afe1 for the switch from cindent
|
||||
let b:html_indent_script1 = 'inc'
|
||||
|
||||
" Now, set up our indentation expression and keys that trigger it.
|
||||
setlocal indentexpr=GetJavascriptIndent()
|
||||
setlocal autoindent nolisp nosmartindent
|
||||
@@ -21,6 +25,13 @@ setlocal indentkeys+=0],0)
|
||||
|
||||
let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<'
|
||||
|
||||
" Regex of syntax group names that are or delimit string or are comments.
|
||||
let b:syng_strcom = get(b:,'syng_strcom','string\|comment\|regex\|special\|doc\|template\%(braces\)\@!')
|
||||
let b:syng_str = get(b:,'syng_str','string\|template\|special')
|
||||
" template strings may want to be excluded when editing graphql:
|
||||
" au! Filetype javascript let b:syng_str = '^\%(.*template\)\@!.*string\|special'
|
||||
" au! Filetype javascript let b:syng_strcom = '^\%(.*template\)\@!.*string\|comment\|regex\|special\|doc'
|
||||
|
||||
" Only define the function once.
|
||||
if exists('*GetJavascriptIndent')
|
||||
finish
|
||||
@@ -36,7 +47,7 @@ if exists('*shiftwidth')
|
||||
endfunction
|
||||
else
|
||||
function s:sw()
|
||||
return &l:shiftwidth == 0 ? &l:tabstop : &l:shiftwidth
|
||||
return &l:shiftwidth ? &l:shiftwidth : &l:tabstop
|
||||
endfunction
|
||||
endif
|
||||
|
||||
@@ -44,272 +55,301 @@ endif
|
||||
" matches before pos.
|
||||
let s:z = has('patch-7.4.984') ? 'z' : ''
|
||||
|
||||
" Expression used to check whether we should skip a match with searchpair().
|
||||
let s:skip_expr = "s:SynAt(line('.'),col('.')) =~? b:syng_strcom"
|
||||
let s:in_comm = s:skip_expr[:-14] . "'comment\\|doc'"
|
||||
|
||||
let s:rel = has('reltime')
|
||||
" searchpair() wrapper
|
||||
if has('reltime')
|
||||
function s:GetPair(start,end,flags,skip,time,...)
|
||||
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 2000,0] + a:000),a:time)
|
||||
if s:rel
|
||||
function s:GetPair(start,end,flags,skip)
|
||||
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,s:l1,a:skip ==# 's:SkipFunc()' ? 2000 : 200)
|
||||
endfunction
|
||||
else
|
||||
function s:GetPair(start,end,flags,skip,...)
|
||||
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 1000,get(a:000,1)]))
|
||||
function s:GetPair(start,end,flags,skip)
|
||||
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,s:l1)
|
||||
endfunction
|
||||
endif
|
||||
|
||||
" Regex of syntax group names that are or delimit string or are comments.
|
||||
let s:syng_strcom = 'string\|comment\|regex\|special\|doc\|template\%(braces\)\@!'
|
||||
let s:syng_str = 'string\|template\|special'
|
||||
let s:syng_com = 'comment\|doc'
|
||||
" Expression used to check whether we should skip a match with searchpair().
|
||||
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),0),'name') =~? '".s:syng_strcom."'"
|
||||
|
||||
function s:parse_cino(f) abort
|
||||
return float2nr(eval(substitute(substitute(join(split(
|
||||
\ matchstr(&cino,'.*'.a:f.'\zs[^,]*'), 's',1), '*'.s:W)
|
||||
\ , '^-\=\zs\*','',''), '^-\=\zs\.','0.','')))
|
||||
endfunction
|
||||
|
||||
function s:skip_func()
|
||||
if getline('.') =~ '\%<'.col('.').'c\/.\{-}\/\|\%>'.col('.').'c[''"]\|\\$'
|
||||
return eval(s:skip_expr)
|
||||
elseif s:checkIn || search('\m`\|\${\|\*\/','nW'.s:z,s:looksyn)
|
||||
let s:checkIn = eval(s:skip_expr)
|
||||
function s:SynAt(l,c)
|
||||
let byte = line2byte(a:l) + a:c - 1
|
||||
let pos = index(s:synid_cache[0], byte)
|
||||
if pos == -1
|
||||
let s:synid_cache[:] += [[byte], [synIDattr(synID(a:l, a:c, 0), 'name')]]
|
||||
endif
|
||||
let s:looksyn = line('.')
|
||||
return s:checkIn
|
||||
return s:synid_cache[1][pos]
|
||||
endfunction
|
||||
|
||||
function s:alternatePair(stop)
|
||||
let pos = getpos('.')[1:2]
|
||||
let pat = '[][(){};]'
|
||||
while search('\m'.pat,'bW',a:stop)
|
||||
if s:skip_func() | continue | endif
|
||||
let idx = stridx('])};',s:looking_at())
|
||||
if idx is 3 | let pat = '[{}()]' | continue | endif
|
||||
if idx + 1
|
||||
if s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,a:stop) <= 0
|
||||
function s:ParseCino(f)
|
||||
let [divider, n, cstr] = [0] + matchlist(&cino,
|
||||
\ '\%(.*,\)\=\%(\%d'.char2nr(a:f).'\(-\)\=\([.s0-9]*\)\)\=')[1:2]
|
||||
for c in split(cstr,'\zs')
|
||||
if c == '.' && !divider
|
||||
let divider = 1
|
||||
elseif c ==# 's'
|
||||
if n !~ '\d'
|
||||
return n . s:sw() + 0
|
||||
endif
|
||||
let n = str2nr(n) * s:sw()
|
||||
break
|
||||
else
|
||||
let [n, divider] .= [c, 0]
|
||||
endif
|
||||
endfor
|
||||
return str2nr(n) / max([str2nr(divider),1])
|
||||
endfunction
|
||||
|
||||
" Optimized {skip} expr, only callable from the search loop which
|
||||
" GetJavascriptIndent does to find the containing [[{(] (side-effects)
|
||||
function s:SkipFunc()
|
||||
if s:top_col == 1
|
||||
throw 'out of bounds'
|
||||
endif
|
||||
let s:top_col = 0
|
||||
if s:check_in
|
||||
if eval(s:skip_expr)
|
||||
return 1
|
||||
endif
|
||||
let s:check_in = 0
|
||||
elseif getline('.') =~ '\%<'.col('.').'c\/.\{-}\/\|\%>'.col('.').'c[''"]\|\\$'
|
||||
if eval(s:skip_expr)
|
||||
let s:looksyn = a:firstline
|
||||
return 1
|
||||
endif
|
||||
elseif search('\m`\|\${\|\*\/','nW'.s:z,s:looksyn) && eval(s:skip_expr)
|
||||
let s:check_in = 1
|
||||
return 1
|
||||
endif
|
||||
let [s:looksyn, s:top_col] = getpos('.')[1:2]
|
||||
endfunction
|
||||
|
||||
function s:AlternatePair()
|
||||
let [pat, l:for] = ['[][(){};]', 2]
|
||||
while s:SearchLoop(pat,'bW','s:SkipFunc()')
|
||||
if s:LookingAt() == ';'
|
||||
if !l:for
|
||||
if s:GetPair('{','}','bW','s:SkipFunc()')
|
||||
return
|
||||
endif
|
||||
break
|
||||
else
|
||||
let [pat, l:for] = ['[{}();]', l:for - 1]
|
||||
endif
|
||||
else
|
||||
return
|
||||
let idx = stridx('])}',s:LookingAt())
|
||||
if idx == -1
|
||||
return
|
||||
elseif !s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:SkipFunc()')
|
||||
break
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
call call('cursor',pos)
|
||||
throw 'out of bounds'
|
||||
endfunction
|
||||
|
||||
function s:save_pos(f,...)
|
||||
let l:pos = getpos('.')[1:2]
|
||||
let ret = call(a:f,a:000)
|
||||
call call('cursor',l:pos)
|
||||
return ret
|
||||
function s:Nat(int)
|
||||
return a:int * (a:int > 0)
|
||||
endfunction
|
||||
|
||||
function s:syn_at(l,c)
|
||||
return synIDattr(synID(a:l,a:c,0),'name')
|
||||
endfunction
|
||||
|
||||
function s:looking_at()
|
||||
function s:LookingAt()
|
||||
return getline('.')[col('.')-1]
|
||||
endfunction
|
||||
|
||||
function s:token()
|
||||
return s:looking_at() =~ '\k' ? expand('<cword>') : s:looking_at()
|
||||
function s:Token()
|
||||
return s:LookingAt() =~ '\k' ? expand('<cword>') : s:LookingAt()
|
||||
endfunction
|
||||
|
||||
function s:previous_token()
|
||||
let l:pos = getpos('.')[1:2]
|
||||
if search('\m\k\{1,}\zs\k\|\S','bW')
|
||||
if (getline('.')[col('.')-2:col('.')-1] == '*/' || line('.') != l:pos[0] &&
|
||||
\ getline('.') =~ '\%<'.col('.').'c\/\/') && s:syn_at(line('.'),col('.')) =~? s:syng_com
|
||||
while search('\m\S\ze\_s*\/[/*]','bW')
|
||||
if s:syn_at(line('.'),col('.')) !~? s:syng_com
|
||||
return s:token()
|
||||
endif
|
||||
endwhile
|
||||
function s:PreviousToken()
|
||||
let l:col = col('.')
|
||||
if search('\m\k\{1,}\|\S','ebW')
|
||||
if search('\m\*\%#\/\|\/\/\%<'.a:firstline.'l','nbW',line('.')) && eval(s:in_comm)
|
||||
if s:SearchLoop('\S\ze\_s*\/[/*]','bW',s:in_comm)
|
||||
return s:Token()
|
||||
endif
|
||||
call cursor(a:firstline, l:col)
|
||||
else
|
||||
return s:token()
|
||||
return s:Token()
|
||||
endif
|
||||
endif
|
||||
call call('cursor',l:pos)
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function s:expr_col()
|
||||
if getline('.')[col('.')-2] == ':'
|
||||
return 1
|
||||
endif
|
||||
function s:Pure(f,...)
|
||||
return eval("[call(a:f,a:000),cursor(a:firstline,".col('.').")][0]")
|
||||
endfunction
|
||||
|
||||
function s:SearchLoop(pat,flags,expr)
|
||||
return s:GetPair(a:pat,'\_$.',a:flags,a:expr)
|
||||
endfunction
|
||||
|
||||
function s:ExprCol()
|
||||
let bal = 0
|
||||
while search('\m[{}?:;]','bW')
|
||||
if eval(s:skip_expr) | continue | endif
|
||||
" switch (looking_at())
|
||||
exe { '}': "if s:GetPair('{','}','bW',s:skip_expr,200) <= 0 | return | endif",
|
||||
\ ';': "return",
|
||||
\ '{': "return getpos('.')[1:2] != b:js_cache[1:] && !s:IsBlock()",
|
||||
\ ':': "let bal -= getline('.')[max([col('.')-2,0]):col('.')] !~ '::'",
|
||||
\ '?': "let bal += 1 | if bal > 0 | return 1 | endif" }[s:looking_at()]
|
||||
while s:SearchLoop('[{}?]\|\_[^:]\zs::\@!','bW',s:skip_expr)
|
||||
if s:LookingAt() == ':'
|
||||
let bal -= 1
|
||||
elseif s:LookingAt() == '?'
|
||||
let bal += 1
|
||||
if bal == 1
|
||||
break
|
||||
endif
|
||||
elseif s:LookingAt() == '{'
|
||||
let bal = !s:IsBlock()
|
||||
break
|
||||
elseif !s:GetPair('{','}','bW',s:skip_expr)
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
return s:Nat(bal)
|
||||
endfunction
|
||||
|
||||
" configurable regexes that define continuation lines, not including (, {, or [.
|
||||
let s:opfirst = '^' . get(g:,'javascript_opfirst',
|
||||
\ '\C\%([<>=,?^%|*/&]\|\([-.:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)')
|
||||
\ '\C\%([<>=,.?^%|/&]\|\([-:+]\)\1\@!\|\*\+\|!=\|in\%(stanceof\)\=\>\)')
|
||||
let s:continuation = get(g:,'javascript_continuation',
|
||||
\ '\C\%([-+<>=,.~!?/*^%|&:]\|\<\%(typeof\|new\|delete\|void\|in\|instanceof\|await\)\)') . '$'
|
||||
\ '\C\%([<=,.~!?/*^%|&:]\|+\@<!+\|-\@<!-\|=\@<!>\|\<\%(typeof\|new\|delete\|void\|in\|instanceof\|await\)\)') . '$'
|
||||
|
||||
function s:continues(ln,con)
|
||||
if !cursor(a:ln, match(' '.a:con,s:continuation))
|
||||
let teol = s:looking_at()
|
||||
if teol == '/'
|
||||
return s:syn_at(line('.'),col('.')) !~? 'regex'
|
||||
elseif teol =~ '[-+>]'
|
||||
return getline('.')[col('.')-2] != tr(teol,'>','=')
|
||||
elseif teol =~ '\l'
|
||||
return s:previous_token() != '.'
|
||||
elseif teol == ':'
|
||||
return s:expr_col()
|
||||
endif
|
||||
return 1
|
||||
function s:Continues(ln,con)
|
||||
let tok = matchstr(a:con[-15:],s:continuation)
|
||||
if tok =~ '[a-z:]'
|
||||
call cursor(a:ln, len(a:con))
|
||||
return tok == ':' ? s:ExprCol() : s:PreviousToken() != '.'
|
||||
elseif tok !~ '[/>]'
|
||||
return tok isnot ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" get the line of code stripped of comments and move cursor to the last
|
||||
" non-comment char.
|
||||
function s:Trim(ln)
|
||||
let pline = substitute(getline(a:ln),'\s*$','','')
|
||||
let l:max = max([strridx(pline,'//'), strridx(pline,'/*')])
|
||||
while l:max != -1 && s:syn_at(a:ln, strlen(pline)) =~? s:syng_com
|
||||
let pline = pline[: l:max]
|
||||
let l:max = max([strridx(pline,'//'), strridx(pline,'/*')])
|
||||
let pline = substitute(pline[:-2],'\s*$','','')
|
||||
endwhile
|
||||
return pline is '' || cursor(a:ln,strlen(pline)) ? pline : pline
|
||||
endfunction
|
||||
|
||||
" Find line above 'lnum' that isn't empty or in a comment
|
||||
function s:PrevCodeLine(lnum)
|
||||
let [l:pos, l:n] = [getpos('.')[1:2], prevnonblank(a:lnum)]
|
||||
while l:n
|
||||
if getline(l:n) =~ '^\s*\/[/*]'
|
||||
let l:n = prevnonblank(l:n-1)
|
||||
elseif stridx(getline(l:n), '*/') + 1 && s:syn_at(l:n,1) =~? s:syng_com
|
||||
call cursor(l:n,1)
|
||||
keepjumps norm! [*
|
||||
let l:n = search('\m\S','nbW')
|
||||
else
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
call call('cursor',l:pos)
|
||||
return l:n
|
||||
return s:SynAt(a:ln, len(a:con)) !~? (tok == '>' ? 'jsflow\|^html' : 'regex')
|
||||
endfunction
|
||||
|
||||
" Check if line 'lnum' has a balanced amount of parentheses.
|
||||
function s:Balanced(lnum)
|
||||
let l:open = 0
|
||||
let l:line = getline(a:lnum)
|
||||
let pos = match(l:line, '[][(){}]', 0)
|
||||
let [l:open, l:line] = [0, getline(a:lnum)]
|
||||
let pos = match(l:line, '[][(){}]')
|
||||
while pos != -1
|
||||
if s:syn_at(a:lnum,pos + 1) !~? s:syng_strcom
|
||||
if s:SynAt(a:lnum,pos + 1) !~? b:syng_strcom
|
||||
let l:open += match(' ' . l:line[pos],'[[({]')
|
||||
if l:open < 0
|
||||
return
|
||||
endif
|
||||
endif
|
||||
let pos = match(l:line, (l:open ?
|
||||
\ '['.escape(tr(l:line[pos],'({[]})',')}][{(').l:line[pos],']').']' :
|
||||
\ '[][(){}]'), pos + 1)
|
||||
let pos = match(l:line, !l:open ? '[][(){}]' : '()' =~ l:line[pos] ?
|
||||
\ '[()]' : '{}' =~ l:line[pos] ? '[{}]' : '[][]', pos + 1)
|
||||
endwhile
|
||||
return !l:open
|
||||
endfunction
|
||||
|
||||
function s:OneScope(lnum)
|
||||
let pline = s:Trim(a:lnum)
|
||||
let kw = 'else do'
|
||||
if pline[-1:] == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
|
||||
if s:previous_token() =~# '^\%(await\|each\)$'
|
||||
call s:previous_token()
|
||||
let kw = 'for'
|
||||
else
|
||||
let kw = 'for if let while with'
|
||||
endif
|
||||
function s:OneScope()
|
||||
if s:LookingAt() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr)
|
||||
let tok = s:PreviousToken()
|
||||
return (count(split('for if let while with'),tok) ||
|
||||
\ tok =~# '^await$\|^each$' && s:PreviousToken() ==# 'for') &&
|
||||
\ s:Pure('s:PreviousToken') != '.' && !(tok == 'while' && s:DoWhile())
|
||||
elseif s:Token() =~# '^else$\|^do$'
|
||||
return s:Pure('s:PreviousToken') != '.'
|
||||
endif
|
||||
return pline[-2:] == '=>' || index(split(kw),s:token()) + 1 &&
|
||||
\ s:save_pos('s:previous_token') != '.'
|
||||
return strpart(getline('.'),col('.')-2,2) == '=>'
|
||||
endfunction
|
||||
|
||||
" returns braceless levels started by 'i' and above lines * shiftwidth().
|
||||
" 'num' is the lineNr which encloses the entire context, 'cont' if whether
|
||||
" line 'i' + 1 is a continued expression, which could have started in a
|
||||
" braceless context
|
||||
function s:iscontOne(i,num,cont)
|
||||
let [l:i, l:num, bL] = [a:i, a:num + !a:num, 0]
|
||||
let pind = a:num ? indent(l:num) + s:W : 0
|
||||
let ind = indent(l:i) + (a:cont ? 0 : s:W)
|
||||
while l:i >= l:num && (ind > pind || l:i == l:num)
|
||||
if indent(l:i) < ind && s:OneScope(l:i)
|
||||
let bL += s:W
|
||||
let l:i = line('.')
|
||||
elseif !a:cont || bL || ind < indent(a:i)
|
||||
function s:DoWhile()
|
||||
let cpos = searchpos('\m\<','cbW')
|
||||
if s:SearchLoop('\C[{}]\|\<\%(do\|while\)\>','bW',s:skip_expr)
|
||||
if s:{s:LookingAt() == '}' && s:GetPair('{','}','bW',s:skip_expr) ?
|
||||
\ 'Previous' : ''}Token() ==# 'do' && s:IsBlock()
|
||||
return 1
|
||||
endif
|
||||
call call('cursor',cpos)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" returns total offset from braceless contexts. 'num' is the lineNr which
|
||||
" encloses the entire context, 'cont' if whether a:firstline is a continued
|
||||
" expression, which could have started in a braceless context
|
||||
function s:IsContOne(num,cont)
|
||||
let [l:num, b_l] = [a:num + !a:num, 0]
|
||||
let pind = a:num ? indent(a:num) + s:sw() : 0
|
||||
let ind = indent('.') + !a:cont
|
||||
while line('.') > l:num && ind > pind || line('.') == l:num
|
||||
if indent('.') < ind && s:OneScope()
|
||||
let b_l += 1
|
||||
elseif !a:cont || b_l || ind < indent(a:firstline)
|
||||
break
|
||||
else
|
||||
call cursor(0,1)
|
||||
endif
|
||||
let ind = min([ind, indent('.')])
|
||||
if s:PreviousToken() is ''
|
||||
break
|
||||
endif
|
||||
let ind = min([ind, indent(l:i)])
|
||||
let l:i = s:PrevCodeLine(l:i - 1)
|
||||
endwhile
|
||||
return bL
|
||||
return b_l
|
||||
endfunction
|
||||
|
||||
function s:Class()
|
||||
return (s:Token() ==# 'class' || s:PreviousToken() =~# '^class$\|^extends$') &&
|
||||
\ s:PreviousToken() != '.'
|
||||
endfunction
|
||||
|
||||
function s:IsSwitch()
|
||||
return s:PreviousToken() !~ '[.*]' &&
|
||||
\ (!s:GetPair('{','}','cbW',s:skip_expr) || s:IsBlock() && !s:Class())
|
||||
endfunction
|
||||
|
||||
" https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader
|
||||
function s:IsBlock()
|
||||
if s:looking_at() == '{'
|
||||
let l:n = line('.')
|
||||
let char = s:previous_token()
|
||||
if match(s:stack,'\cxml\|jsx') + 1 && s:syn_at(line('.'),col('.')-1) =~? 'xml\|jsx'
|
||||
return char != '{'
|
||||
elseif char =~ '\k'
|
||||
if char ==# 'type'
|
||||
return s:previous_token() !~# '^\%(im\|ex\)port$'
|
||||
endif
|
||||
return index(split('return const let import export extends yield default delete var await void typeof throw case new of in instanceof')
|
||||
\ ,char) < (line('.') != l:n) || s:save_pos('s:previous_token') == '.'
|
||||
elseif char == '>'
|
||||
return getline('.')[col('.')-2] == '=' || s:syn_at(line('.'),col('.')) =~? '^jsflow'
|
||||
elseif char == ':'
|
||||
return !s:save_pos('s:expr_col')
|
||||
elseif char == '/'
|
||||
return s:syn_at(line('.'),col('.')) =~? 'regex'
|
||||
let tok = s:PreviousToken()
|
||||
if join(s:stack) =~? 'xml\|jsx' && s:SynAt(line('.'),col('.')-1) =~? 'xml\|jsx'
|
||||
return tok != '{'
|
||||
elseif tok =~ '\k'
|
||||
if tok ==# 'type'
|
||||
return s:Pure('eval',"s:PreviousToken() !~# '^\\%(im\\|ex\\)port$' || s:PreviousToken() == '.'")
|
||||
elseif tok ==# 'of'
|
||||
return s:Pure('eval',"!s:GetPair('[[({]','[])}]','bW',s:skip_expr) || s:LookingAt() != '(' ||"
|
||||
\ ."s:{s:PreviousToken() ==# 'await' ? 'Previous' : ''}Token() !=# 'for' || s:PreviousToken() == '.'")
|
||||
endif
|
||||
return char !~ '[=~!<*,?^%|&([]' &&
|
||||
\ (char !~ '[-+]' || l:n != line('.') && getline('.')[col('.')-2] == char)
|
||||
return index(split('return const let import export extends yield default delete var await void typeof throw case new in instanceof')
|
||||
\ ,tok) < (line('.') != a:firstline) || s:Pure('s:PreviousToken') == '.'
|
||||
elseif tok == '>'
|
||||
return getline('.')[col('.')-2] == '=' || s:SynAt(line('.'),col('.')) =~? 'jsflow\|^html'
|
||||
elseif tok == '*'
|
||||
return s:Pure('s:PreviousToken') == ':'
|
||||
elseif tok == ':'
|
||||
return s:Pure('eval',"s:PreviousToken() =~ '^\\K\\k*$' && !s:ExprCol()")
|
||||
elseif tok == '/'
|
||||
return s:SynAt(line('.'),col('.')) =~? 'regex'
|
||||
elseif tok !~ '[=~!<,.?^%|&([]'
|
||||
return tok !~ '[-+]' || line('.') != a:firstline && getline('.')[col('.')-2] == tok
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function GetJavascriptIndent()
|
||||
let b:js_cache = get(b:,'js_cache',[0,0,0])
|
||||
" Get the current line.
|
||||
call cursor(v:lnum,1)
|
||||
let l:line = getline('.')
|
||||
let s:synid_cache = [[],[]]
|
||||
let l:line = getline(v:lnum)
|
||||
" use synstack as it validates syn state and works in an empty line
|
||||
let s:stack = map(synstack(v:lnum,1),"synIDattr(v:val,'name')")
|
||||
let syns = get(s:stack,-1,'')
|
||||
let s:stack = [''] + map(synstack(v:lnum,1),"synIDattr(v:val,'name')")
|
||||
|
||||
" start with strings,comments,etc.
|
||||
if syns =~? s:syng_com
|
||||
if s:stack[-1] =~? 'comment\|doc'
|
||||
if l:line =~ '^\s*\*'
|
||||
return cindent(v:lnum)
|
||||
elseif l:line !~ '^\s*\/[/*]'
|
||||
return -1
|
||||
endif
|
||||
elseif syns =~? s:syng_str
|
||||
elseif s:stack[-1] =~? b:syng_str
|
||||
if b:js_cache[0] == v:lnum - 1 && s:Balanced(v:lnum-1)
|
||||
let b:js_cache[0] = v:lnum
|
||||
endif
|
||||
return -1
|
||||
endif
|
||||
let l:lnum = s:PrevCodeLine(v:lnum - 1)
|
||||
if !l:lnum
|
||||
|
||||
let s:l1 = max([0,prevnonblank(v:lnum) - (s:rel ? 2000 : 1000),
|
||||
\ get(get(b:,'hi_indent',{}),'blocklnr')])
|
||||
call cursor(v:lnum,1)
|
||||
if s:PreviousToken() is ''
|
||||
return
|
||||
endif
|
||||
let [l:lnum, pline] = [line('.'), getline('.')[:col('.')-1]]
|
||||
|
||||
let l:line = substitute(l:line,'^\s*','','')
|
||||
let l:line_raw = l:line
|
||||
if l:line[:1] == '/*'
|
||||
let l:line = substitute(l:line,'^\%(\/\*.\{-}\*\/\s*\)*','','')
|
||||
endif
|
||||
@@ -318,60 +358,91 @@ function GetJavascriptIndent()
|
||||
endif
|
||||
|
||||
" the containing paren, bracket, or curly. Many hacks for performance
|
||||
call cursor(v:lnum,1)
|
||||
let idx = index([']',')','}'],l:line[0])
|
||||
if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum &&
|
||||
\ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum))
|
||||
if b:js_cache[0] > l:lnum && b:js_cache[0] < v:lnum ||
|
||||
\ b:js_cache[0] == l:lnum && s:Balanced(l:lnum)
|
||||
call call('cursor',b:js_cache[1:])
|
||||
else
|
||||
let [s:looksyn, s:checkIn, top] = [v:lnum - 1, 0, (!indent(l:lnum) &&
|
||||
\ s:syn_at(l:lnum,1) !~? s:syng_str) * l:lnum]
|
||||
if idx + 1
|
||||
call s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:skip_func()',2000,top)
|
||||
elseif getline(v:lnum) !~ '^\S' && syns =~? 'block'
|
||||
call s:GetPair('{','}','bW','s:skip_func()',2000,top)
|
||||
else
|
||||
call s:alternatePair(top)
|
||||
endif
|
||||
let [s:looksyn, s:top_col, s:check_in, s:l1] = [v:lnum - 1,0,0,
|
||||
\ max([s:l1, &smc ? search('\m^.\{'.&smc.',}','nbW',s:l1 + 1) + 1 : 0])]
|
||||
try
|
||||
if idx != -1
|
||||
call s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:SkipFunc()')
|
||||
elseif getline(v:lnum) !~ '^\S' && s:stack[-1] =~? 'block\|^jsobject$'
|
||||
call s:GetPair('{','}','bW','s:SkipFunc()')
|
||||
else
|
||||
call s:AlternatePair()
|
||||
endif
|
||||
catch /^\Cout of bounds$/
|
||||
call cursor(v:lnum,1)
|
||||
endtry
|
||||
let b:js_cache[1:] = line('.') == v:lnum ? [0,0] : getpos('.')[1:2]
|
||||
endif
|
||||
|
||||
let b:js_cache = [v:lnum] + (line('.') == v:lnum ? [0,0] : getpos('.')[1:2])
|
||||
let num = b:js_cache[1]
|
||||
let [b:js_cache[0], num] = [v:lnum, b:js_cache[1]]
|
||||
|
||||
let [s:W, isOp, bL, switch_offset] = [s:sw(),0,0,0]
|
||||
if !num || s:IsBlock()
|
||||
let [num_ind, is_op, b_l, l:switch_offset] = [s:Nat(indent(num)),0,0,0]
|
||||
if !num || s:LookingAt() == '{' && s:IsBlock()
|
||||
let ilnum = line('.')
|
||||
let pline = s:save_pos('s:Trim',l:lnum)
|
||||
if num && s:looking_at() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
|
||||
let num = ilnum == num ? line('.') : num
|
||||
if idx < 0 && s:previous_token() ==# 'switch' && s:previous_token() != '.'
|
||||
if &cino !~ ':'
|
||||
let switch_offset = s:W
|
||||
else
|
||||
let switch_offset = max([-indent(num),s:parse_cino(':')])
|
||||
endif
|
||||
if num && s:LookingAt() == ')' && s:GetPair('(',')','bW',s:skip_expr)
|
||||
if ilnum == num
|
||||
let [num, num_ind] = [line('.'), indent('.')]
|
||||
endif
|
||||
if idx == -1 && s:PreviousToken() ==# 'switch' && s:IsSwitch()
|
||||
let l:switch_offset = &cino !~ ':' ? s:sw() : s:ParseCino(':')
|
||||
if pline[-1:] != '.' && l:line =~# '^\%(default\|case\)\>'
|
||||
return indent(num) + switch_offset
|
||||
return s:Nat(num_ind + l:switch_offset)
|
||||
elseif &cino =~ '='
|
||||
let l:case_offset = s:ParseCino('=')
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
if idx < 0 && pline[-1:] !~ '[{;]'
|
||||
let isOp = (l:line =~# s:opfirst || s:continues(l:lnum,pline)) * s:W
|
||||
let bL = s:iscontOne(l:lnum,b:js_cache[1],isOp)
|
||||
let bL -= (bL && l:line[0] == '{') * s:W
|
||||
if idx == -1 && pline[-1:] !~ '[{;]'
|
||||
let sol = matchstr(l:line,s:opfirst)
|
||||
if sol is '' || sol == '/' && s:SynAt(v:lnum,
|
||||
\ 1 + len(getline(v:lnum)) - len(l:line)) =~? 'regex'
|
||||
if s:Continues(l:lnum,pline)
|
||||
let is_op = s:sw()
|
||||
endif
|
||||
elseif num && sol =~# '^\%(in\%(stanceof\)\=\|\*\)$'
|
||||
call call('cursor',b:js_cache[1:])
|
||||
if s:PreviousToken() =~ '\k' && s:Class()
|
||||
return num_ind + s:sw()
|
||||
endif
|
||||
let is_op = s:sw()
|
||||
else
|
||||
let is_op = s:sw()
|
||||
endif
|
||||
call cursor(l:lnum, len(pline))
|
||||
let b_l = s:Nat(s:IsContOne(b:js_cache[1],is_op) - (!is_op && l:line =~ '^{')) * s:sw()
|
||||
endif
|
||||
elseif idx < 0 && getline(b:js_cache[1])[b:js_cache[2]-1] == '(' && &cino =~ '('
|
||||
let pval = s:parse_cino('(')
|
||||
return !pval ? (s:parse_cino('w') ? 0 : -(!!search('\m\S','W'.s:z,num))) + virtcol('.') :
|
||||
\ max([indent('.') + pval + (s:GetPair('(',')','nbrmW',s:skip_expr,100,num) * s:W),0])
|
||||
elseif idx.s:LookingAt().&cino =~ '^-1(.*(' && (search('\m\S','nbW',num) || s:ParseCino('U'))
|
||||
let pval = s:ParseCino('(')
|
||||
if !pval
|
||||
let [Wval, vcol] = [s:ParseCino('W'), virtcol('.')]
|
||||
if search('\m\S','W',num)
|
||||
return s:ParseCino('w') ? vcol : virtcol('.')-1
|
||||
endif
|
||||
return Wval ? s:Nat(num_ind + Wval) : vcol
|
||||
endif
|
||||
return s:Nat(num_ind + pval + searchpair('\m(','','\m)','nbrmW',s:skip_expr,num) * s:sw())
|
||||
endif
|
||||
|
||||
" main return
|
||||
if l:line =~ '^\%([])}]\||}\)'
|
||||
return max([indent(num),0])
|
||||
if l:line =~ '^[])}]\|^|}'
|
||||
if l:line_raw[0] == ')' && getline(num)[b:js_cache[2]-1] == '('
|
||||
if s:ParseCino('M')
|
||||
return indent(l:lnum)
|
||||
elseif &cino =~# 'm' && !s:ParseCino('m')
|
||||
return virtcol('.') - 1
|
||||
endif
|
||||
endif
|
||||
return num_ind
|
||||
elseif num
|
||||
return indent(num) + s:W + switch_offset + bL + isOp
|
||||
return s:Nat(num_ind + get(l:,'case_offset',s:sw()) + l:switch_offset + b_l + is_op)
|
||||
endif
|
||||
return bL + isOp
|
||||
return b_l + is_op
|
||||
endfunction
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: vim-perl <vim-perl@googlegroups.com>
|
||||
" Homepage: http://github.com/vim-perl/vim-perl
|
||||
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
|
||||
" Last Change: 2017 Jun 13
|
||||
" Last Change: 2017-01-04
|
||||
|
||||
" Suggestions and improvements by :
|
||||
" Aaron J. Sherman (use syntax for hints)
|
||||
@@ -48,11 +48,6 @@ function! GetPerlIndent()
|
||||
return 0
|
||||
endif
|
||||
|
||||
" Don't reindent comments on first column
|
||||
if cline =~ '^#.'
|
||||
return 0
|
||||
endif
|
||||
|
||||
" Get current syntax item at the line's first char
|
||||
let csynid = ''
|
||||
if b:indent_use_syntax
|
||||
@@ -134,6 +129,7 @@ function! GetPerlIndent()
|
||||
\ || synid == "perlMatchStartEnd"
|
||||
\ || synid == "perlHereDoc"
|
||||
\ || synid == "perlBraces"
|
||||
\ || synid == "perlStatementIndirObj"
|
||||
\ || synid =~ "^perlFiledescStatement"
|
||||
\ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
|
||||
let brace = strpart(line, bracepos, 1)
|
||||
@@ -151,6 +147,7 @@ function! GetPerlIndent()
|
||||
if synid == ""
|
||||
\ || synid == "perlMatchStartEnd"
|
||||
\ || synid == "perlBraces"
|
||||
\ || synid == "perlStatementIndirObj"
|
||||
\ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
|
||||
let ind = ind - shiftwidth()
|
||||
endif
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
" Maintainer: Christian Brabandt <cb@256bit.org>
|
||||
" Previous Maintainer: Peter Aronoff <telemachus@arpinum.org>
|
||||
" Original Author: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2017-05-02
|
||||
" Latest Revision: 2017-08-08
|
||||
" License: Vim (see :h license)
|
||||
" Repository: https://github.com/chrisbra/vim-sh-indent
|
||||
" Changelog:
|
||||
" 20170808: - better indent of line continuation
|
||||
" 20170502: - get rid of buffer-shiftwidth function
|
||||
" 20160912: - preserve indentation of here-doc blocks
|
||||
" 20160627: - detect heredocs correctly
|
||||
@@ -117,7 +118,8 @@ function! GetShIndent()
|
||||
endfunction
|
||||
|
||||
function! s:is_continuation_line(line)
|
||||
return a:line =~ '\%(\%(^\|[^\\]\)\\\|&&\|||\)$'
|
||||
return a:line =~ '\%(\%(^\|[^\\]\)\\\|&&\|||\||\)' .
|
||||
\ '\s*\({\s*\)\=\(#.*\)\=$'
|
||||
endfunction
|
||||
|
||||
function! s:find_continued_lnum(lnum)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Language: Verilog HDL
|
||||
" Maintainer: Chih-Tsun Huang <cthuang@cs.nthu.edu.tw>
|
||||
" Last Change: 2017 Feb 24 by Chih-Tsun Huang
|
||||
" Last Change: 2017 Aug 25 by Chih-Tsun Huang
|
||||
" URL: http://www.cs.nthu.edu.tw/~cthuang/vim/indent/verilog.vim
|
||||
"
|
||||
" Credits:
|
||||
@@ -25,7 +25,8 @@ let b:did_indent = 1
|
||||
setlocal indentexpr=GetVerilogIndent()
|
||||
setlocal indentkeys=!^F,o,O,0),=begin,=end,=join,=endcase
|
||||
setlocal indentkeys+==endmodule,=endfunction,=endtask,=endspecify
|
||||
setlocal indentkeys+==`else,=`endif
|
||||
setlocal indentkeys+==endconfig,=endgenerate,=endprimitive,=endtable
|
||||
setlocal indentkeys+==`else,=`elsif,=`endif
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetVerilogIndent")
|
||||
@@ -84,7 +85,9 @@ function GetVerilogIndent()
|
||||
endif
|
||||
|
||||
" Indent after if/else/for/case/always/initial/specify/fork blocks
|
||||
elseif last_line =~ '`\@<!\<\(if\|else\)\>' ||
|
||||
" Note: We exclude '`if' or '`else' and consider 'end else'
|
||||
" 'end if' is redundant here
|
||||
elseif last_line =~ '^\s*\(end\)\=\s*`\@<!\<\(if\|else\)\>' ||
|
||||
\ last_line =~ '^\s*\<\(for\|case\%[[zx]]\)\>' ||
|
||||
\ last_line =~ '^\s*\<\(always\|initial\)\>' ||
|
||||
\ last_line =~ '^\s*\<\(specify\|fork\)\>'
|
||||
@@ -93,8 +96,8 @@ function GetVerilogIndent()
|
||||
let ind = ind + offset
|
||||
if vverb | echo vverb_str "Indent after a block statement." | endif
|
||||
endif
|
||||
" Indent after function/task blocks
|
||||
elseif last_line =~ '^\s*\<\(function\|task\)\>'
|
||||
" Indent after function/task/config/generate/primitive/table blocks
|
||||
elseif last_line =~ '^\s*\<\(function\|task\|config\|generate\|primitive\|table\)\>'
|
||||
if last_line !~ '\<end\>\s*' . vlog_comment . '*$' ||
|
||||
\ last_line =~ '\(//\|/\*\).*\(;\|\<end\>\)\s*' . vlog_comment . '*$'
|
||||
let ind = ind + offset
|
||||
@@ -161,11 +164,11 @@ function GetVerilogIndent()
|
||||
let ind = ind - offset
|
||||
if vverb | echo vverb_str "De-indent after a close statement." | endif
|
||||
|
||||
" `ifdef and `else
|
||||
elseif last_line =~ '^\s*`\<\(ifdef\|else\)\>'
|
||||
" `ifdef or `ifndef or `elsif or `else
|
||||
elseif last_line =~ '^\s*`\<\(ifn\?def\|elsif\|else\)\>'
|
||||
let ind = ind + offset
|
||||
if vverb
|
||||
echo vverb_str "Indent after a `ifdef or `else statement."
|
||||
echo vverb_str "Indent after a `ifdef or `ifndef or `elsif or `else statement."
|
||||
endif
|
||||
|
||||
endif
|
||||
@@ -175,7 +178,8 @@ function GetVerilogIndent()
|
||||
" De-indent on the end of the block
|
||||
" join/end/endcase/endfunction/endtask/endspecify
|
||||
if curr_line =~ '^\s*\<\(join\|end\|endcase\)\>' ||
|
||||
\ curr_line =~ '^\s*\<\(endfunction\|endtask\|endspecify\)\>'
|
||||
\ curr_line =~ '^\s*\<\(endfunction\|endtask\|endspecify\)\>' ||
|
||||
\ curr_line =~ '^\s*\<\(endconfig\|endgenerate\|endprimitive\|endtable\)\>'
|
||||
let ind = ind - offset
|
||||
if vverb | echo vverb_str "De-indent the end of a block." | endif
|
||||
elseif curr_line =~ '^\s*\<endmodule\>'
|
||||
@@ -186,7 +190,7 @@ function GetVerilogIndent()
|
||||
|
||||
" De-indent on a stand-alone 'begin'
|
||||
elseif curr_line =~ '^\s*\<begin\>'
|
||||
if last_line !~ '^\s*\<\(function\|task\|specify\|module\)\>' &&
|
||||
if last_line !~ '^\s*\<\(function\|task\|specify\|module\|config\|generate\|primitive\|table\)\>' &&
|
||||
\ last_line !~ '^\s*\()*\s*;\|)\+\)\s*' . vlog_comment . '*$' &&
|
||||
\ ( last_line =~
|
||||
\ '\<\(`\@<!if\|`\@<!else\|for\|case\%[[zx]]\|always\|initial\)\>' ||
|
||||
@@ -208,10 +212,10 @@ function GetVerilogIndent()
|
||||
echo vverb_str "De-indent the end of a multiple statement."
|
||||
endif
|
||||
|
||||
" De-indent `else and `endif
|
||||
elseif curr_line =~ '^\s*`\<\(else\|endif\)\>'
|
||||
" De-indent `elsif or `else or `endif
|
||||
elseif curr_line =~ '^\s*`\<\(elsif\|else\|endif\)\>'
|
||||
let ind = ind - offset
|
||||
if vverb | echo vverb_str "De-indent `else and `endif statement." | endif
|
||||
if vverb | echo vverb_str "De-indent `elsif or `else or `endif statement." | endif
|
||||
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Menu translations for Catalan
|
||||
"
|
||||
" Maintainer: Ernest Adrogu<67> <eadrogue@gmx.net>
|
||||
" Last Change: 6 Jun 2008
|
||||
" Last Change: 26 Jul 2017
|
||||
"
|
||||
|
||||
" Quit when menu translations have already been done.
|
||||
@@ -70,9 +70,9 @@ menutrans Settings\ &Window Fin&estra\ d'opcions
|
||||
menutrans Startup\ &Settings Opcions\ i&nicials
|
||||
menutrans &Global\ Settings Opcions\ &globals
|
||||
" submen<65> Edita/Opcions Globals
|
||||
menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Ressalt\ de\ &patrons<Tab>:set\ hls!
|
||||
menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Ressaltat\ de\ &patrons<Tab>:set\ hls!
|
||||
menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Sensibilitat\ a\ les\ ma&j<EFBFBD>scules<Tab>:set\ ic!
|
||||
menutrans Toggle\ &Showmatch<Tab>:set\ sm! &Ressalt\ de\ coincid<EFBFBD>ncies<Tab>:set\ sm!
|
||||
menutrans Toggle\ &Showmatch<Tab>:set\ sm! &Ressaltat\ de\ coincid<EFBFBD>ncies<Tab>:set\ sm!
|
||||
menutrans &Context\ lines L<EFBFBD>nies\ de\ co&ntext
|
||||
menutrans &Virtual\ Edit Edici<EFBFBD>\ &virtual
|
||||
" submen<65> Edita/Opcions Globals/Edici<63> virtual
|
||||
@@ -191,7 +191,7 @@ menutrans &Diff &Difer
|
||||
menutrans &Update &Actualitza
|
||||
menutrans &Get\ Block &Obtingues\ un\ bloc
|
||||
menutrans &Put\ Block &Posa\ un\ bloc
|
||||
menutrans &Make<Tab>:make Crida\ a\ &make<Tab>:make
|
||||
menutrans &Make<Tab>:make Crida\ &make<Tab>:make
|
||||
menutrans &List\ Errors<Tab>:cl Llista\ d'&errors<Tab>:cl
|
||||
menutrans L&ist\ Messages<Tab>:cl! &Llista\ de\ missatges<Tab>:cl!
|
||||
menutrans &Next\ Error<Tab>:cn Error\ se&g<EFBFBD>ent<Tab>:cn
|
||||
@@ -203,8 +203,7 @@ menutrans Error\ &Window F&inestra\ d'errors
|
||||
menutrans &Update<Tab>:cwin &Actualitza<Tab>:cwin
|
||||
menutrans &Open<Tab>:copen &Obre<Tab>:copen
|
||||
menutrans &Close<Tab>:cclose &Tanca<Tab>:cclose
|
||||
menutrans &Set\ Compiler &Compilador
|
||||
menutrans &SeT\ Compiler &Compilador
|
||||
menutrans Se&t\ Compiler &Compilador
|
||||
menutrans &Convert\ to\ HEX<Tab>:%!xxd Converteix\ a\ &HEX<Tab>:%!xxd
|
||||
menutrans Conve&rt\ back<Tab>:%!xxd\ -r Torna\ al\ format\ &original<Tab>:%!xxd\ -r
|
||||
|
||||
@@ -303,14 +302,14 @@ menutrans &Syntax &Sintaxi
|
||||
menutrans &Manual &Manual
|
||||
menutrans A&utomatic A&utom<EFBFBD>tica
|
||||
menutrans on/off\ for\ &This\ file Activa/Desactiva\ en\ &aquest\ fitxer
|
||||
menutrans &Show\ filetypes\ in\ menu Mostra\ tots\ els\ &tipus\ al\ men<EFBFBD>
|
||||
menutrans &Show\ File\ Types\ in\ Menu Mostra\ tots\ els\ &tipus\ al\ men<EFBFBD>
|
||||
menutrans &Off &Desactiva
|
||||
menutrans Co&lor\ test Prova\ dels\ &colors
|
||||
menutrans &Highlight\ test Prova\ del\ &ressalt
|
||||
menutrans &Highlight\ test Prova\ del\ &ressaltat
|
||||
menutrans &Convert\ to\ HTML Converteix\ a\ &HTML
|
||||
menutrans Assembly Ensamblador
|
||||
menutrans Config Configuraci<EFBFBD>
|
||||
menutrans Set\ '&syntax'\ only Nom<EFBFBD>s\ el\ ressalt\ de\ sintaxi
|
||||
menutrans Set\ '&syntax'\ only Nom<EFBFBD>s\ el\ ressaltat\ de\ sintaxi
|
||||
menutrans Set\ '&filetype'\ too Carrega\ tamb<EFBFBD>\ els\ plugins
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
" These commands create the option window.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2017 Jul 15
|
||||
" Last Change: 2017 Sep 10
|
||||
|
||||
" If there already is an option window, jump to that one.
|
||||
if bufwinnr("option-window") > 0
|
||||
let s:thiswin = winnr()
|
||||
while 1
|
||||
if @% == "option-window"
|
||||
let buf = bufnr('option-window')
|
||||
if buf >= 0
|
||||
let winids = win_findbuf(buf)
|
||||
if len(winids) > 0
|
||||
if win_gotoid(winids[0]) == 1
|
||||
finish
|
||||
endif
|
||||
wincmd w
|
||||
if s:thiswin == winnr()
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
endif
|
||||
endif
|
||||
|
||||
" Make sure the '<' flag is not included in 'cpoptions', otherwise <CR> would
|
||||
@@ -141,8 +138,8 @@ while exists("b:current_syntax") && b:current_syntax == "help"
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" Open the window
|
||||
new option-window
|
||||
" Open the window. $OPTWIN_CMD is set to "tab" for ":tab options".
|
||||
exe $OPTWIN_CMD . ' new option-window'
|
||||
setlocal ts=15 tw=0 noro buftype=nofile
|
||||
|
||||
" Insert help and a "set" command for each option.
|
||||
@@ -513,6 +510,10 @@ if has("terminal")
|
||||
call append("$", "termkey\tkey that precedes Vim commands in a terminal window")
|
||||
call append("$", "\t(local to window)")
|
||||
call <SID>OptionL("tk")
|
||||
if exists("&winptydll")
|
||||
call append("$", "winptydll\tname of the winpty dynamic library")
|
||||
call <SID>OptionG("winptydll", &winptydll)
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -1224,6 +1225,8 @@ endif
|
||||
call append("$", "iminsert\tin Insert mode: 1: use :lmap; 2: use IM; 0: neither")
|
||||
call append("$", "\t(local to window)")
|
||||
call <SID>OptionL("imi")
|
||||
call append("$", "imstyle\tinput method style, 0: on-the-spot, 1: over-the-spot")
|
||||
call <SID>OptionG("imst", &imst)
|
||||
call append("$", "imsearch\tentering a search pattern: 1: use :lmap; 2: use IM; 0: neither")
|
||||
call append("$", "\t(local to window)")
|
||||
call <SID>OptionL("ims")
|
||||
@@ -1304,6 +1307,8 @@ endif
|
||||
if has("viminfo")
|
||||
call append("$", "viminfo\tlist that specifies what to write in the viminfo file")
|
||||
call <SID>OptionG("vi", &vi)
|
||||
call append("$", "viminfofile\tfile name used for the viminfo file")
|
||||
call <SID>OptionG("vif", &vif)
|
||||
endif
|
||||
if has("quickfix")
|
||||
call append("$", "bufhidden\twhat happens with a buffer when it's no longer in a window")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
" matchit.vim: (global plugin) Extended "%" matching
|
||||
" Last Change: 2017 March 26
|
||||
" Last Change: 2017 Sep 15
|
||||
" Maintainer: Benji Fisher PhD <benji@member.AMS.org>
|
||||
" Version: 1.13.3, for Vim 6.3+
|
||||
" Fix from Fernando Torres included.
|
||||
@@ -704,9 +704,8 @@ fun! s:MultiMatch(spflag, mode)
|
||||
let skip = 's:comment\|string'
|
||||
endif
|
||||
let skip = s:ParseSkip(skip)
|
||||
" let restore_cursor = line(".") . "G" . virtcol(".") . "|"
|
||||
" normal! H
|
||||
" let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor
|
||||
" save v:count1 variable, might be reset from the restore_cursor command
|
||||
let level = v:count1
|
||||
let restore_cursor = virtcol(".") . "|"
|
||||
normal! g0
|
||||
let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor
|
||||
@@ -726,7 +725,6 @@ fun! s:MultiMatch(spflag, mode)
|
||||
execute "if " . skip . "| let skip = '0' | endif"
|
||||
endif
|
||||
mark '
|
||||
let level = v:count1
|
||||
while level
|
||||
if searchpair(openpat, '', closepat, a:spflag, skip) < 1
|
||||
call s:CleanUp(restore_options, a:mode, startline, startcol)
|
||||
|
||||
377
runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
vendored
Normal file
377
runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
vendored
Normal file
@@ -0,0 +1,377 @@
|
||||
" Debugger plugin using gdb.
|
||||
"
|
||||
" WORK IN PROGRESS - much doesn't work yet
|
||||
"
|
||||
" Open two visible terminal windows:
|
||||
" 1. run a pty, as with ":term NONE"
|
||||
" 2. run gdb, passing the pty
|
||||
" The current window is used to view source code and follows gdb.
|
||||
"
|
||||
" A third terminal window is hidden, it is used for communication with gdb.
|
||||
"
|
||||
" The communication with gdb uses GDB/MI. See:
|
||||
" https://sourceware.org/gdb/current/onlinedocs/gdb/GDB_002fMI.html
|
||||
"
|
||||
" Author: Bram Moolenaar
|
||||
" Copyright: Vim license applies, see ":help license"
|
||||
|
||||
" In case this gets loaded twice.
|
||||
if exists(':Termdebug')
|
||||
finish
|
||||
endif
|
||||
|
||||
" The command that starts debugging, e.g. ":Termdebug vim".
|
||||
" To end type "quit" in the gdb window.
|
||||
command -nargs=* -complete=file Termdebug call s:StartDebug(<q-args>)
|
||||
|
||||
" Name of the gdb command, defaults to "gdb".
|
||||
if !exists('termdebugger')
|
||||
let termdebugger = 'gdb'
|
||||
endif
|
||||
|
||||
let s:pc_id = 12
|
||||
let s:break_id = 13
|
||||
|
||||
if &background == 'light'
|
||||
hi default debugPC term=reverse ctermbg=lightblue guibg=lightblue
|
||||
else
|
||||
hi default debugPC term=reverse ctermbg=darkblue guibg=darkblue
|
||||
endif
|
||||
hi default debugBreakpoint term=reverse ctermbg=red guibg=red
|
||||
|
||||
func s:StartDebug(cmd)
|
||||
let s:startwin = win_getid(winnr())
|
||||
let s:startsigncolumn = &signcolumn
|
||||
|
||||
if exists('g:termdebug_wide') && &columns < g:termdebug_wide
|
||||
let s:save_columns = &columns
|
||||
let &columns = g:termdebug_wide
|
||||
let vertical = 1
|
||||
else
|
||||
let s:save_columns = 0
|
||||
let vertical = 0
|
||||
endif
|
||||
|
||||
" Open a terminal window without a job, to run the debugged program
|
||||
let s:ptybuf = term_start('NONE', {
|
||||
\ 'term_name': 'gdb program',
|
||||
\ 'vertical': vertical,
|
||||
\ })
|
||||
if s:ptybuf == 0
|
||||
echoerr 'Failed to open the program terminal window'
|
||||
return
|
||||
endif
|
||||
let pty = job_info(term_getjob(s:ptybuf))['tty_out']
|
||||
let s:ptywin = win_getid(winnr())
|
||||
|
||||
" Create a hidden terminal window to communicate with gdb
|
||||
let s:commbuf = term_start('NONE', {
|
||||
\ 'term_name': 'gdb communication',
|
||||
\ 'out_cb': function('s:CommOutput'),
|
||||
\ 'hidden': 1,
|
||||
\ })
|
||||
if s:commbuf == 0
|
||||
echoerr 'Failed to open the communication terminal window'
|
||||
exe 'bwipe! ' . s:ptybuf
|
||||
return
|
||||
endif
|
||||
let commpty = job_info(term_getjob(s:commbuf))['tty_out']
|
||||
|
||||
" Open a terminal window to run the debugger.
|
||||
let cmd = [g:termdebugger, '-tty', pty, a:cmd]
|
||||
echomsg 'executing "' . join(cmd) . '"'
|
||||
let gdbbuf = term_start(cmd, {
|
||||
\ 'exit_cb': function('s:EndDebug'),
|
||||
\ 'term_finish': 'close',
|
||||
\ })
|
||||
if gdbbuf == 0
|
||||
echoerr 'Failed to open the gdb terminal window'
|
||||
exe 'bwipe! ' . s:ptybuf
|
||||
exe 'bwipe! ' . s:commbuf
|
||||
return
|
||||
endif
|
||||
let s:gdbwin = win_getid(winnr())
|
||||
|
||||
" Connect gdb to the communication pty, using the GDB/MI interface
|
||||
call term_sendkeys(gdbbuf, 'new-ui mi ' . commpty . "\r")
|
||||
|
||||
" Sign used to highlight the line where the program has stopped.
|
||||
" There can be only one.
|
||||
sign define debugPC linehl=debugPC
|
||||
|
||||
" Sign used to indicate a breakpoint.
|
||||
" Can be used multiple times.
|
||||
sign define debugBreakpoint text=>> texthl=debugBreakpoint
|
||||
|
||||
" Install debugger commands in the text window.
|
||||
call win_gotoid(s:startwin)
|
||||
call s:InstallCommands()
|
||||
call win_gotoid(s:gdbwin)
|
||||
|
||||
let s:breakpoints = {}
|
||||
|
||||
augroup TermDebug
|
||||
au BufRead * call s:BufRead()
|
||||
au BufUnload * call s:BufUnloaded()
|
||||
augroup END
|
||||
endfunc
|
||||
|
||||
func s:EndDebug(job, status)
|
||||
exe 'bwipe! ' . s:ptybuf
|
||||
exe 'bwipe! ' . s:commbuf
|
||||
|
||||
let curwinid = win_getid(winnr())
|
||||
|
||||
call win_gotoid(s:startwin)
|
||||
let &signcolumn = s:startsigncolumn
|
||||
call s:DeleteCommands()
|
||||
|
||||
call win_gotoid(curwinid)
|
||||
if s:save_columns > 0
|
||||
let &columns = s:save_columns
|
||||
endif
|
||||
|
||||
au! TermDebug
|
||||
endfunc
|
||||
|
||||
" Handle a message received from gdb on the GDB/MI interface.
|
||||
func s:CommOutput(chan, msg)
|
||||
let msgs = split(a:msg, "\r")
|
||||
|
||||
for msg in msgs
|
||||
" remove prefixed NL
|
||||
if msg[0] == "\n"
|
||||
let msg = msg[1:]
|
||||
endif
|
||||
if msg != ''
|
||||
if msg =~ '^\(\*stopped\|\*running\|=thread-selected\)'
|
||||
call s:HandleCursor(msg)
|
||||
elseif msg =~ '^\^done,bkpt=' || msg =~ '^=breakpoint-created,'
|
||||
call s:HandleNewBreakpoint(msg)
|
||||
elseif msg =~ '^=breakpoint-deleted,'
|
||||
call s:HandleBreakpointDelete(msg)
|
||||
elseif msg =~ '^\^done,value='
|
||||
call s:HandleEvaluate(msg)
|
||||
elseif msg =~ '^\^error,msg='
|
||||
call s:HandleError(msg)
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
" Install commands in the current window to control the debugger.
|
||||
func s:InstallCommands()
|
||||
command Break call s:SetBreakpoint()
|
||||
command Delete call s:DeleteBreakpoint()
|
||||
command Step call s:SendCommand('-exec-step')
|
||||
command Over call s:SendCommand('-exec-next')
|
||||
command Finish call s:SendCommand('-exec-finish')
|
||||
command Continue call s:SendCommand('-exec-continue')
|
||||
command -range -nargs=* Evaluate call s:Evaluate(<range>, <q-args>)
|
||||
command Gdb call win_gotoid(s:gdbwin)
|
||||
command Program call win_gotoid(s:ptywin)
|
||||
|
||||
" TODO: can the K mapping be restored?
|
||||
nnoremap K :Evaluate<CR>
|
||||
|
||||
if has('menu')
|
||||
amenu WinBar.Step :Step<CR>
|
||||
amenu WinBar.Next :Over<CR>
|
||||
amenu WinBar.Finish :Finish<CR>
|
||||
amenu WinBar.Cont :Continue<CR>
|
||||
amenu WinBar.Eval :Evaluate<CR>
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Delete installed debugger commands in the current window.
|
||||
func s:DeleteCommands()
|
||||
delcommand Break
|
||||
delcommand Delete
|
||||
delcommand Step
|
||||
delcommand Over
|
||||
delcommand Finish
|
||||
delcommand Continue
|
||||
delcommand Evaluate
|
||||
delcommand Gdb
|
||||
delcommand Program
|
||||
|
||||
nunmap K
|
||||
|
||||
if has('menu')
|
||||
aunmenu WinBar.Step
|
||||
aunmenu WinBar.Next
|
||||
aunmenu WinBar.Finish
|
||||
aunmenu WinBar.Cont
|
||||
aunmenu WinBar.Eval
|
||||
endif
|
||||
|
||||
exe 'sign unplace ' . s:pc_id
|
||||
for key in keys(s:breakpoints)
|
||||
exe 'sign unplace ' . (s:break_id + key)
|
||||
endfor
|
||||
sign undefine debugPC
|
||||
sign undefine debugBreakpoint
|
||||
unlet s:breakpoints
|
||||
endfunc
|
||||
|
||||
" :Break - Set a breakpoint at the cursor position.
|
||||
func s:SetBreakpoint()
|
||||
call term_sendkeys(s:commbuf, '-break-insert --source '
|
||||
\ . fnameescape(expand('%:p')) . ' --line ' . line('.') . "\r")
|
||||
endfunc
|
||||
|
||||
" :Delete - Delete a breakpoint at the cursor position.
|
||||
func s:DeleteBreakpoint()
|
||||
let fname = fnameescape(expand('%:p'))
|
||||
let lnum = line('.')
|
||||
for [key, val] in items(s:breakpoints)
|
||||
if val['fname'] == fname && val['lnum'] == lnum
|
||||
call term_sendkeys(s:commbuf, '-break-delete ' . key . "\r")
|
||||
" Assume this always wors, the reply is simply "^done".
|
||||
exe 'sign unplace ' . (s:break_id + key)
|
||||
unlet s:breakpoints[key]
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
" :Next, :Continue, etc - send a command to gdb
|
||||
func s:SendCommand(cmd)
|
||||
call term_sendkeys(s:commbuf, a:cmd . "\r")
|
||||
endfunc
|
||||
|
||||
" :Evaluate - evaluate what is under the cursor
|
||||
func s:Evaluate(range, arg)
|
||||
if a:arg != ''
|
||||
let expr = a:arg
|
||||
elseif a:range == 2
|
||||
let pos = getcurpos()
|
||||
let reg = getreg('v', 1, 1)
|
||||
let regt = getregtype('v')
|
||||
normal! gv"vy
|
||||
let expr = @v
|
||||
call setpos('.', pos)
|
||||
call setreg('v', reg, regt)
|
||||
else
|
||||
let expr = expand('<cexpr>')
|
||||
endif
|
||||
call term_sendkeys(s:commbuf, '-data-evaluate-expression "' . expr . "\"\r")
|
||||
let s:evalexpr = expr
|
||||
endfunc
|
||||
|
||||
" Handle the result of data-evaluate-expression
|
||||
func s:HandleEvaluate(msg)
|
||||
let value = substitute(a:msg, '.*value="\(.*\)"', '\1', '')
|
||||
let value = substitute(value, '\\"', '"', 'g')
|
||||
echomsg '"' . s:evalexpr . '": ' . value
|
||||
|
||||
if s:evalexpr[0] != '*' && value =~ '^0x' && value !~ '"$'
|
||||
" Looks like a pointer, also display what it points to.
|
||||
let s:evalexpr = '*' . s:evalexpr
|
||||
call term_sendkeys(s:commbuf, '-data-evaluate-expression "' . s:evalexpr . "\"\r")
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Handle an error.
|
||||
func s:HandleError(msg)
|
||||
echoerr substitute(a:msg, '.*msg="\(.*\)"', '\1', '')
|
||||
endfunc
|
||||
|
||||
" Handle stopping and running message from gdb.
|
||||
" Will update the sign that shows the current position.
|
||||
func s:HandleCursor(msg)
|
||||
let wid = win_getid(winnr())
|
||||
|
||||
if win_gotoid(s:startwin)
|
||||
let fname = substitute(a:msg, '.*fullname="\([^"]*\)".*', '\1', '')
|
||||
if a:msg =~ '^\(\*stopped\|=thread-selected\)' && filereadable(fname)
|
||||
let lnum = substitute(a:msg, '.*line="\([^"]*\)".*', '\1', '')
|
||||
if lnum =~ '^[0-9]*$'
|
||||
if expand('%:p') != fnamemodify(fname, ':p')
|
||||
if &modified
|
||||
" TODO: find existing window
|
||||
exe 'split ' . fnameescape(fname)
|
||||
let s:startwin = win_getid(winnr())
|
||||
else
|
||||
exe 'edit ' . fnameescape(fname)
|
||||
endif
|
||||
endif
|
||||
exe lnum
|
||||
exe 'sign place ' . s:pc_id . ' line=' . lnum . ' name=debugPC file=' . fname
|
||||
setlocal signcolumn=yes
|
||||
endif
|
||||
else
|
||||
exe 'sign unplace ' . s:pc_id
|
||||
endif
|
||||
|
||||
call win_gotoid(wid)
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Handle setting a breakpoint
|
||||
" Will update the sign that shows the breakpoint
|
||||
func s:HandleNewBreakpoint(msg)
|
||||
let nr = substitute(a:msg, '.*number="\([0-9]\)*\".*', '\1', '') + 0
|
||||
if nr == 0
|
||||
return
|
||||
endif
|
||||
|
||||
if has_key(s:breakpoints, nr)
|
||||
let entry = s:breakpoints[nr]
|
||||
else
|
||||
let entry = {}
|
||||
let s:breakpoints[nr] = entry
|
||||
endif
|
||||
|
||||
let fname = substitute(a:msg, '.*fullname="\([^"]*\)".*', '\1', '')
|
||||
let lnum = substitute(a:msg, '.*line="\([^"]*\)".*', '\1', '')
|
||||
let entry['fname'] = fname
|
||||
let entry['lnum'] = lnum
|
||||
|
||||
if bufloaded(fname)
|
||||
call s:PlaceSign(nr, entry)
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func s:PlaceSign(nr, entry)
|
||||
exe 'sign place ' . (s:break_id + a:nr) . ' line=' . a:entry['lnum'] . ' name=debugBreakpoint file=' . a:entry['fname']
|
||||
let a:entry['placed'] = 1
|
||||
endfunc
|
||||
|
||||
" Handle deleting a breakpoint
|
||||
" Will remove the sign that shows the breakpoint
|
||||
func s:HandleBreakpointDelete(msg)
|
||||
let nr = substitute(a:msg, '.*id="\([0-9]*\)\".*', '\1', '') + 0
|
||||
if nr == 0
|
||||
return
|
||||
endif
|
||||
if has_key(s:breakpoints, nr)
|
||||
let entry = s:breakpoints[nr]
|
||||
if has_key(entry, 'placed')
|
||||
exe 'sign unplace ' . (s:break_id + nr)
|
||||
unlet entry['placed']
|
||||
endif
|
||||
unlet s:breakpoints[nr]
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Handle a BufRead autocommand event: place any signs.
|
||||
func s:BufRead()
|
||||
let fname = expand('<afile>:p')
|
||||
for [nr, entry] in items(s:breakpoints)
|
||||
if entry['fname'] == fname
|
||||
call s:PlaceSign(nr, entry)
|
||||
endif
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
" Handle a BufUnloaded autocommand event: unplace any signs.
|
||||
func s:BufUnloaded()
|
||||
let fname = expand('<afile>:p')
|
||||
for [nr, entry] in items(s:breakpoints)
|
||||
if entry['fname'] == fname
|
||||
let entry['placed'] = 0
|
||||
endif
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types in scripts
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last change: 2017 Jun 11
|
||||
" Last change: 2017 Aug 27
|
||||
|
||||
" This file is called by an autocommand for every file that has just been
|
||||
" loaded into a buffer. It checks if the type of file can be recognized by
|
||||
@@ -306,7 +306,7 @@ else
|
||||
set ft=virata
|
||||
|
||||
" Strace
|
||||
elseif s:line1 =~# '^\(\[pid \d\+\] \)\=[0-9:.]* *execve(' || s:line1 =~# '^__libc_start_main'
|
||||
elseif s:line1 =~# '[0-9:.]* *execve(' || s:line1 =~# '^__libc_start_main'
|
||||
set ft=strace
|
||||
|
||||
" VSE JCL
|
||||
|
||||
@@ -136,7 +136,7 @@ syntax match clojureRegexpBoundary "[$^]" contained display
|
||||
syntax match clojureRegexpQuantifier "[?*+][?+]\=" contained display
|
||||
syntax match clojureRegexpQuantifier "\v\{\d+%(,|,\d+)?}\??" contained display
|
||||
syntax match clojureRegexpOr "|" contained display
|
||||
syntax match clojureRegexpBackRef "\v\\%([1-9]\d*|k\<[a-zA-z]+\>)" contained display
|
||||
syntax match clojureRegexpBackRef "\v\\%([1-9]\d*|k\<[a-zA-Z]+\>)" contained display
|
||||
|
||||
" Mode modifiers, mode-modified spans, lookaround, regular and atomic
|
||||
" grouping, and named-capturing.
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
|
||||
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
|
||||
" Wichert Akkerman <wakkerma@debian.org>
|
||||
" Last Change: 2016 Aug 30
|
||||
" Last Change: 2017 Aug 18
|
||||
" URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debcontrol.vim
|
||||
|
||||
" Standard syntax initialization
|
||||
@@ -21,8 +21,8 @@ syn case match
|
||||
syn match debcontrolElse "^.*$"
|
||||
|
||||
" Common seperators
|
||||
syn match debControlComma ", *"
|
||||
syn match debControlSpace " "
|
||||
syn match debControlComma ",[ \t]*"
|
||||
syn match debControlSpace "[ \t]"
|
||||
|
||||
let s:kernels = '\%(linux\|hurd\|kfreebsd\|knetbsd\|kopensolaris\|netbsd\)'
|
||||
let s:archs = '\%(alpha\|amd64\|armeb\|armel\|armhf\|arm64\|avr32\|hppa\|i386'
|
||||
@@ -38,7 +38,7 @@ unlet s:kernels s:archs s:pairs
|
||||
syn match debcontrolMultiArch contained "\%(no\|foreign\|allowed\|same\)"
|
||||
syn match debcontrolName contained "[a-z0-9][a-z0-9+.-]\+"
|
||||
syn match debcontrolPriority contained "\(extra\|important\|optional\|required\|standard\)"
|
||||
syn match debcontrolSection contained "\v((contrib|non-free|non-US/main|non-US/contrib|non-US/non-free|restricted|universe|multiverse)/)?(admin|cli-mono|comm|database|debian-installer|debug|devel|doc|editors|education|electronics|embedded|fonts|games|gnome|gnustep|gnu-r|graphics|hamradio|haskell|httpd|interpreters|introspection|java|javascript|kde|kernel|libs|libdevel|lisp|localization|mail|math|metapackages|misc|net|news|ocaml|oldlibs|otherosfs|perl|php|python|ruby|rust|science|shells|sound|text|tex|utils|vcs|video|web|x11|xfce|zope)"
|
||||
syn match debcontrolSection contained "\v((contrib|non-free|non-US/main|non-US/contrib|non-US/non-free|restricted|universe|multiverse)/)?(admin|cli-mono|comm|database|debian-installer|debug|devel|doc|editors|education|electronics|embedded|fonts|games|gnome|gnustep|gnu-r|graphics|hamradio|haskell|httpd|interpreters|introspection|java%(script)=|kde|kernel|libs|libdevel|lisp|localization|mail|math|metapackages|misc|net|news|ocaml|oldlibs|otherosfs|perl|php|python|ruby|rust|science|shells|sound|text|tex|utils|vcs|video|web|x11|xfce|zope)"
|
||||
syn match debcontrolPackageType contained "u\?deb"
|
||||
syn match debcontrolVariable contained "\${.\{-}}"
|
||||
syn match debcontrolDmUpload contained "\cyes"
|
||||
@@ -60,7 +60,7 @@ syn match debcontrolComment "^#.*$" contains=@Spell
|
||||
syn case ignore
|
||||
|
||||
" List of all legal keys
|
||||
syn match debcontrolKey contained "^\%(Source\|Package\|Section\|Priority\|\%(XSBC-Original-\)\=Maintainer\|Uploaders\|Build-\%(Conflicts\|Depends\)\%(-Indep\)\=\|Standards-Version\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Enhances\|Breaks\|Essential\|Architecture\|Multi-Arch\|Description\|Bugs\|Origin\|X[SB]-Python-Version\|Homepage\|\(XS-\)\=Vcs-\(Browser\|Arch\|Bzr\|Cvs\|Darcs\|Git\|Hg\|Mtn\|Svn\)\|\%(XC-\)\=Package-Type\): *"
|
||||
syn match debcontrolKey contained "^\%(Source\|Package\|Section\|Priority\|\%(XSBC-Original-\)\=Maintainer\|Uploaders\|Build-\%(Conflicts\|Depends\)\%(-Arch\|-Indep\)\=\|Standards-Version\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Enhances\|Breaks\|Essential\|Architecture\|Multi-Arch\|Description\|Bugs\|Origin\|X[SB]-Python-Version\|Homepage\|\(XS-\)\=Vcs-\(Browser\|Arch\|Bzr\|Cvs\|Darcs\|Git\|Hg\|Mtn\|Svn\)\|\%(XC-\)\=Package-Type\|\%(XS-\)\=Testsuite\): *"
|
||||
|
||||
syn match debcontrolDeprecatedKey contained "^\%(\%(XS-\)\=DM-Upload-Allowed\): *"
|
||||
|
||||
@@ -79,9 +79,9 @@ syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Git" end="$" contains=deb
|
||||
syn region debcontrolStrictField start="^\%(XS-\)\=DM-Upload-Allowed" end="$" contains=debcontrolDeprecatedKey,debcontrolDmUpload oneline
|
||||
|
||||
" Catch-all for the other legal fields
|
||||
syn region debcontrolField start="^\%(\%(XSBC-Original-\)\=Maintainer\|Standards-Version\|Essential\|Bugs\|Origin\|X[SB]-Python-Version\|\%(XS-\)\=Vcs-Mtn\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline
|
||||
syn region debcontrolMultiField start="^\%(Build-\%(Conflicts\|Depends\)\%(-Indep\)\=\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Enhances\|Breaks\|Uploaders\|Description\):" skip="^ " end="^$"me=s-1 end="^[^ #]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment
|
||||
syn region debcontrolMultiFieldSpell start="^\%(Description\):" skip="^ " end="^$"me=s-1 end="^[^ #]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment,@Spell
|
||||
syn region debcontrolField start="^\%(\%(XSBC-Original-\)\=Maintainer\|Standards-Version\|Essential\|Bugs\|Origin\|X[SB]-Python-Version\|\%(XS-\)\=Vcs-Mtn\|\%(XS-\)\=Testsuite\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline
|
||||
syn region debcontrolMultiField start="^\%(Build-\%(Conflicts\|Depends\)\%(-Arch\|-Indep\)\=\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Enhances\|Breaks\|Uploaders\|Description\):" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment
|
||||
syn region debcontrolMultiFieldSpell start="^\%(Description\):" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment,@Spell
|
||||
|
||||
" Associate our matches and regions with pretty colours
|
||||
hi def link debcontrolKey Keyword
|
||||
|
||||
@@ -85,7 +85,7 @@ syn match formComment "\;\ *\*.*$" contains=formTodo
|
||||
syn region formString start=+"+ end=+"+ contains=formSpecial
|
||||
syn region formString start=+'+ end=+'+
|
||||
syn region formNestedString start=+`+ end=+'+ contains=formNestedString
|
||||
syn match formPreProc "^\=\#[a-zA-z][a-zA-Z0-9]*\>"
|
||||
syn match formPreProc "^\=\#[a-zA-Z][a-zA-Z0-9]*\>"
|
||||
syn match formNumber "\<\d\+\>"
|
||||
syn match formNumber "\<\d\+\.\d*\>"
|
||||
syn match formNumber "\.\d\+\>"
|
||||
@@ -94,13 +94,13 @@ syn match formNumber "-\.\d" contains=Number
|
||||
syn match formNumber "i_\+\>"
|
||||
syn match formNumber "fac_\+\>"
|
||||
" pattern matching wildcards
|
||||
syn match formNumber "?[A-z0-9]*"
|
||||
syn match formNumber "?[a-zA-Z0-9]*"
|
||||
" dollar-variables (new in 3.x)
|
||||
syn match formNumber "\\$[A-z0-9]*"
|
||||
syn match formNumber "\\$[a-zA-Z0-9]*"
|
||||
" scalar products
|
||||
syn match formNumber "^\=[a-zA-z][a-zA-Z0-9]*\.[a-zA-z][a-zA-Z0-9]*\>"
|
||||
syn match formNumber "^\=[a-zA-Z][a-zA-Z0-9]*\.[a-zA-Z][a-zA-Z0-9]*\>"
|
||||
|
||||
syn match formDirective "^\=\.[a-zA-z][a-zA-Z0-9]*\>"
|
||||
syn match formDirective "^\=\.[a-zA-Z][a-zA-Z0-9]*\>"
|
||||
|
||||
" hi User Labels
|
||||
syn sync ccomment formComment minlines=10
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: none; used to see highlighting
|
||||
" Maintainer: Ronald Schild <rs@scutum.de>
|
||||
" Last Change: 2001 Sep 02
|
||||
" Last Change: 2017 Jul 28
|
||||
" Version: 5.4n.1
|
||||
|
||||
" To see your current highlight settings, do
|
||||
@@ -111,17 +111,6 @@ endif
|
||||
nohlsearch
|
||||
normal 0
|
||||
|
||||
" add autocommands to remove temporary file from buffer list
|
||||
aug highlighttest
|
||||
au!
|
||||
au BufUnload Highlight\ test if expand("<afile>") == "Highlight test"
|
||||
au BufUnload Highlight\ test bdelete! Highlight\ test
|
||||
au BufUnload Highlight\ test endif
|
||||
au VimLeavePre * if bufexists("Highlight test")
|
||||
au VimLeavePre * bdelete! Highlight\ test
|
||||
au VimLeavePre * endif
|
||||
aug END
|
||||
|
||||
" we don't want to save this temporary file
|
||||
set nomodified
|
||||
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
" Vim syntax file
|
||||
" Language: Mason (Perl embedded in HTML)
|
||||
" Maintainer: Andrew Smith <andrewdsmith@yahoo.com>
|
||||
" Last change: 2003 May 11
|
||||
" URL: http://www.masonhq.com/editors/mason.vim
|
||||
" Language: Mason (Perl embedded in HTML)
|
||||
" Maintainer: vim-perl <vim-perl@googlegroups.com>
|
||||
" Homepage: http://github.com/vim-perl/vim-perl/tree/master
|
||||
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
|
||||
" Last Change: 2017-09-12
|
||||
" Contributors: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
|
||||
" Andrew Smith <andrewdsmith@yahoo.com>
|
||||
"
|
||||
" This seems to work satisfactorily with html.vim and perl.vim for version 5.5.
|
||||
" Please mail any fixes or improvements to the above address. Things that need
|
||||
" doing include:
|
||||
"
|
||||
" - Add match for component names in <& &> blocks.
|
||||
" - Add match for component names in <%def> and <%method> block delimiters.
|
||||
" TODO:
|
||||
" - Fix <%text> blocks to show HTML tags but ignore Mason tags.
|
||||
"
|
||||
|
||||
@@ -34,30 +32,38 @@ syn cluster htmlPreproc add=@masonTop
|
||||
" Now pull in the Perl syntax.
|
||||
"
|
||||
syn include @perlTop syntax/perl.vim
|
||||
unlet b:current_syntax
|
||||
syn include @podTop syntax/pod.vim
|
||||
|
||||
" It's hard to reduce down to the correct sub-set of Perl to highlight in some
|
||||
" of these cases so I've taken the safe option of just using perlTop in all of
|
||||
" them. If you have any suggestions, please let me know.
|
||||
"
|
||||
syn region masonLine matchgroup=Delimiter start="^%" end="$" contains=@perlTop
|
||||
syn region masonExpr matchgroup=Delimiter start="<%" end="%>" contains=@perlTop
|
||||
syn region masonPerl matchgroup=Delimiter start="<%perl>" end="</%perl>" contains=@perlTop
|
||||
syn region masonComp keepend matchgroup=Delimiter start="<&" end="&>" contains=@perlTop
|
||||
syn region masonPod start="^=[a-z]" end="^=cut" keepend contained contains=@podTop
|
||||
syn cluster perlTop remove=perlBraces
|
||||
syn region masonLine matchgroup=Delimiter start="^%" end="$" keepend contains=@perlTop
|
||||
syn region masonPerlComment start="#" end="\%(%>\)\@=\|$" contained contains=perlTodo,@Spell
|
||||
syn region masonExpr matchgroup=Delimiter start="<%" end="%>" contains=@perlTop,masonPerlComment
|
||||
syn region masonPerl matchgroup=Delimiter start="<%perl>" end="</%perl>" contains=masonPod,@perlTop
|
||||
syn region masonComp keepend matchgroup=Delimiter start="<&\s*\%([-._/[:alnum:]]\+:\)\?[-._/[:alnum:]]*" end="&>" contains=@perlTop
|
||||
syn region masonComp keepend matchgroup=Delimiter skipnl start="<&|\s*\%([-._/[:alnum:]]\+:\)\?[-._/[:alnum:]]*" end="&>" contains=@perlTop nextgroup=masonCompContent
|
||||
syn region masonCompContent matchgroup=Delimiter start="" end="</&>" contained contains=@masonTop
|
||||
|
||||
syn region masonArgs matchgroup=Delimiter start="<%args>" end="</%args>" contains=@perlTop
|
||||
syn region masonArgs matchgroup=Delimiter start="<%args>" end="</%args>" contains=masonPod,@perlTop
|
||||
|
||||
syn region masonInit matchgroup=Delimiter start="<%init>" end="</%init>" contains=@perlTop
|
||||
syn region masonCleanup matchgroup=Delimiter start="<%cleanup>" end="</%cleanup>" contains=@perlTop
|
||||
syn region masonOnce matchgroup=Delimiter start="<%once>" end="</%once>" contains=@perlTop
|
||||
syn region masonShared matchgroup=Delimiter start="<%shared>" end="</%shared>" contains=@perlTop
|
||||
syn region masonInit matchgroup=Delimiter start="<%init>" end="</%init>" contains=masonPod,@perlTop
|
||||
syn region masonCleanup matchgroup=Delimiter start="<%cleanup>" end="</%cleanup>" contains=masonPod,@perlTop
|
||||
syn region masonOnce matchgroup=Delimiter start="<%once>" end="</%once>" contains=masonPod,@perlTop
|
||||
syn region masonClass matchgroup=Delimiter start="<%class>" end="</%class>" contains=masonPod,@perlTop
|
||||
syn region masonShared matchgroup=Delimiter start="<%shared>" end="</%shared>" contains=masonPod,@perlTop
|
||||
|
||||
syn region masonDef matchgroup=Delimiter start="<%def[^>]*>" end="</%def>" contains=@htmlTop
|
||||
syn region masonMethod matchgroup=Delimiter start="<%method[^>]*>" end="</%method>" contains=@htmlTop
|
||||
syn region masonDef matchgroup=Delimiter start="<%def\s*[-._/[:alnum:]]\+\s*>" end="</%def>" contains=@htmlTop
|
||||
syn region masonMethod matchgroup=Delimiter start="<%method\s*[-._/[:alnum:]]\+\s*>" end="</%method>" contains=@htmlTop
|
||||
|
||||
syn region masonFlags matchgroup=Delimiter start="<%flags>" end="</%flags>" contains=@perlTop
|
||||
syn region masonAttr matchgroup=Delimiter start="<%attr>" end="</%attr>" contains=@perlTop
|
||||
syn region masonFlags matchgroup=Delimiter start="<%flags>" end="</%flags>" contains=masonPod,@perlTop
|
||||
syn region masonAttr matchgroup=Delimiter start="<%attr>" end="</%attr>" contains=masonPod,@perlTop
|
||||
|
||||
syn region masonFilter matchgroup=Delimiter start="<%filter>" end="</%filter>" contains=@perlTop
|
||||
syn region masonFilter matchgroup=Delimiter start="<%filter>" end="</%filter>" contains=masonPod,@perlTop
|
||||
|
||||
syn region masonDoc matchgroup=Delimiter start="<%doc>" end="</%doc>"
|
||||
syn region masonText matchgroup=Delimiter start="<%text>" end="</%text>"
|
||||
@@ -67,6 +73,8 @@ syn cluster masonTop contains=masonLine,masonExpr,masonPerl,masonComp,masonArgs,
|
||||
" Set up default highlighting. Almost all of this is done in the included
|
||||
" syntax files.
|
||||
hi def link masonDoc Comment
|
||||
hi def link masonPod Comment
|
||||
hi def link masonPerlComment perlComment
|
||||
|
||||
let b:current_syntax = "mason"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: Murphi model checking language
|
||||
" Maintainer: Matthew Fernandez <matthew.fernandez@gmail.com>
|
||||
" Last Change: 2017 May 3
|
||||
" Last Change: 2017 Aug 27
|
||||
" Version: 2
|
||||
" Remark: Originally authored by Diego Ongaro <ongaro@cs.stanford.edu>
|
||||
|
||||
@@ -105,23 +105,23 @@ syn region murphiComment start="--" end="$" contains=murphiTodo
|
||||
syn region murphiComment start="/\*" end="\*/" contains=murphiTodo
|
||||
|
||||
" Link the rules to some groups.
|
||||
highlight link murphiComment Comment
|
||||
highlight link murphiString String
|
||||
highlight link murphiNumber Number
|
||||
highlight link murphiBoolean Boolean
|
||||
highlight link murphiIdentifier Identifier
|
||||
highlight link murphiFunction Function
|
||||
highlight link murphiStatement Statement
|
||||
highlight link murphiConditional Conditional
|
||||
highlight link murphiRepeat Repeat
|
||||
highlight link murphiLabel Label
|
||||
highlight link murphiOperator Operator
|
||||
highlight link murphiKeyword Keyword
|
||||
highlight link murphiType Type
|
||||
highlight link murphiStructure Structure
|
||||
highlight link murphiSpecial Special
|
||||
highlight link murphiDelimiter Delimiter
|
||||
highlight link murphiError Error
|
||||
highlight link murphiTodo Todo
|
||||
hi def link murphiComment Comment
|
||||
hi def link murphiString String
|
||||
hi def link murphiNumber Number
|
||||
hi def link murphiBoolean Boolean
|
||||
hi def link murphiIdentifier Identifier
|
||||
hi def link murphiFunction Function
|
||||
hi def link murphiStatement Statement
|
||||
hi def link murphiConditional Conditional
|
||||
hi def link murphiRepeat Repeat
|
||||
hi def link murphiLabel Label
|
||||
hi def link murphiOperator Operator
|
||||
hi def link murphiKeyword Keyword
|
||||
hi def link murphiType Type
|
||||
hi def link murphiStructure Structure
|
||||
hi def link murphiSpecial Special
|
||||
hi def link murphiDelimiter Delimiter
|
||||
hi def link murphiError Error
|
||||
hi def link murphiTodo Todo
|
||||
|
||||
let b:current_syntax = "murphi"
|
||||
|
||||
434
runtime/syntax/n1ql.vim
Normal file
434
runtime/syntax/n1ql.vim
Normal file
@@ -0,0 +1,434 @@
|
||||
" Vim syntax file
|
||||
" Language: N1QL / Couchbase Server
|
||||
" Maintainer: Eugene Ciurana <n1ql AT cime.net>
|
||||
" Version: 1.0
|
||||
" Source: https://github.com/pr3d4t0r/n1ql-vim-syntax
|
||||
"
|
||||
" License: Vim is Charityware. n1ql.vim syntax is Charityware.
|
||||
" (c) Copyright 2017 by Eugene Ciurana / pr3d4t0r. Licensed
|
||||
" under the standard VIM LICENSE - Vim command :help uganda.txt
|
||||
" for details.
|
||||
"
|
||||
" Questions, comments: <n1ql AT cime.net>
|
||||
" https://ciurana.eu/pgp, https://keybase.io/pr3d4t0r
|
||||
"
|
||||
" vim: set fileencoding=utf-8:
|
||||
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
syn case ignore
|
||||
|
||||
syn keyword n1qlSpecial DATASTORES
|
||||
syn keyword n1qlSpecial DUAL
|
||||
syn keyword n1qlSpecial FALSE
|
||||
syn keyword n1qlSpecial INDEXES
|
||||
syn keyword n1qlSpecial KEYSPACES
|
||||
syn keyword n1qlSpecial MISSING
|
||||
syn keyword n1qlSpecial NAMESPACES
|
||||
syn keyword n1qlSpecial NULL
|
||||
syn keyword n1qlSpecial TRUE
|
||||
|
||||
|
||||
"
|
||||
" *** keywords ***
|
||||
"
|
||||
syn keyword n1qlKeyword ALL
|
||||
syn keyword n1qlKeyword ANY
|
||||
syn keyword n1qlKeyword ASC
|
||||
syn keyword n1qlKeyword BEGIN
|
||||
syn keyword n1qlKeyword BETWEEN
|
||||
syn keyword n1qlKeyword BREAK
|
||||
syn keyword n1qlKeyword BUCKET
|
||||
syn keyword n1qlKeyword CALL
|
||||
syn keyword n1qlKeyword CASE
|
||||
syn keyword n1qlKeyword CAST
|
||||
syn keyword n1qlKeyword CLUSTER
|
||||
syn keyword n1qlKeyword COLLATE
|
||||
syn keyword n1qlKeyword COLLECTION
|
||||
syn keyword n1qlKeyword CONNECT
|
||||
syn keyword n1qlKeyword CONTINUE
|
||||
syn keyword n1qlKeyword CORRELATE
|
||||
syn keyword n1qlKeyword COVER
|
||||
syn keyword n1qlKeyword DATABASE
|
||||
syn keyword n1qlKeyword DATASET
|
||||
syn keyword n1qlKeyword DATASTORE
|
||||
syn keyword n1qlKeyword DECLARE
|
||||
syn keyword n1qlKeyword DECREMENT
|
||||
syn keyword n1qlKeyword DERIVED
|
||||
syn keyword n1qlKeyword DESC
|
||||
syn keyword n1qlKeyword DESCRIBE
|
||||
syn keyword n1qlKeyword DO
|
||||
syn keyword n1qlKeyword EACH
|
||||
syn keyword n1qlKeyword ELEMENT
|
||||
syn keyword n1qlKeyword ELSE
|
||||
syn keyword n1qlKeyword END
|
||||
syn keyword n1qlKeyword EVERY
|
||||
syn keyword n1qlKeyword EXCLUDE
|
||||
syn keyword n1qlKeyword EXISTS
|
||||
syn keyword n1qlKeyword FETCH
|
||||
syn keyword n1qlKeyword FIRST
|
||||
syn keyword n1qlKeyword FLATTEN
|
||||
syn keyword n1qlKeyword FOR
|
||||
syn keyword n1qlKeyword FORCE
|
||||
syn keyword n1qlKeyword FROM
|
||||
syn keyword n1qlKeyword FUNCTION
|
||||
syn keyword n1qlKeyword GROUP
|
||||
syn keyword n1qlKeyword GSI
|
||||
syn keyword n1qlKeyword HAVING
|
||||
syn keyword n1qlKeyword IF
|
||||
syn keyword n1qlKeyword IGNORE
|
||||
syn keyword n1qlKeyword INCLUDE
|
||||
syn keyword n1qlKeyword INCREMENT
|
||||
syn keyword n1qlKeyword INDEX
|
||||
syn keyword n1qlKeyword INITIAL
|
||||
syn keyword n1qlKeyword INLINE
|
||||
syn keyword n1qlKeyword INNER
|
||||
syn keyword n1qlKeyword INTO
|
||||
syn keyword n1qlKeyword KEY
|
||||
syn keyword n1qlKeyword KEYS
|
||||
syn keyword n1qlKeyword KEYSPACE
|
||||
syn keyword n1qlKeyword KNOWN
|
||||
syn keyword n1qlKeyword LAST
|
||||
syn keyword n1qlKeyword LET
|
||||
syn keyword n1qlKeyword LETTING
|
||||
syn keyword n1qlKeyword LIMIT
|
||||
syn keyword n1qlKeyword LOOP
|
||||
syn keyword n1qlKeyword LSM
|
||||
syn keyword n1qlKeyword MAP
|
||||
syn keyword n1qlKeyword MAPPING
|
||||
syn keyword n1qlKeyword MATCHED
|
||||
syn keyword n1qlKeyword MATERIALIZED
|
||||
syn keyword n1qlKeyword MERGE
|
||||
syn keyword n1qlKeyword NAMESPACE
|
||||
syn keyword n1qlKeyword NEST
|
||||
syn keyword n1qlKeyword OPTION
|
||||
syn keyword n1qlKeyword ORDER
|
||||
syn keyword n1qlKeyword OUTER
|
||||
syn keyword n1qlKeyword OVER
|
||||
syn keyword n1qlKeyword PARSE
|
||||
syn keyword n1qlKeyword PARTITION
|
||||
syn keyword n1qlKeyword PASSWORD
|
||||
syn keyword n1qlKeyword PATH
|
||||
syn keyword n1qlKeyword POOL
|
||||
syn keyword n1qlKeyword PRIMARY
|
||||
syn keyword n1qlKeyword PRIVATE
|
||||
syn keyword n1qlKeyword PRIVILEGE
|
||||
syn keyword n1qlKeyword PROCEDURE
|
||||
syn keyword n1qlKeyword PUBLIC
|
||||
syn keyword n1qlKeyword REALM
|
||||
syn keyword n1qlKeyword REDUCE
|
||||
syn keyword n1qlKeyword RETURN
|
||||
syn keyword n1qlKeyword RETURNING
|
||||
syn keyword n1qlKeyword ROLE
|
||||
syn keyword n1qlKeyword SATISFIES
|
||||
syn keyword n1qlKeyword SCHEMA
|
||||
syn keyword n1qlKeyword SELF
|
||||
syn keyword n1qlKeyword SEMI
|
||||
syn keyword n1qlKeyword SHOW
|
||||
syn keyword n1qlKeyword START
|
||||
syn keyword n1qlKeyword STATISTICS
|
||||
syn keyword n1qlKeyword SYSTEM
|
||||
syn keyword n1qlKeyword THEN
|
||||
syn keyword n1qlKeyword TRANSACTION
|
||||
syn keyword n1qlKeyword TRIGGER
|
||||
syn keyword n1qlKeyword UNDER
|
||||
syn keyword n1qlKeyword UNKNOWN
|
||||
syn keyword n1qlKeyword UNSET
|
||||
syn keyword n1qlKeyword USE
|
||||
syn keyword n1qlKeyword USER
|
||||
syn keyword n1qlKeyword USING
|
||||
syn keyword n1qlKeyword VALIDATE
|
||||
syn keyword n1qlKeyword VALUE
|
||||
syn keyword n1qlKeyword VALUED
|
||||
syn keyword n1qlKeyword VALUES
|
||||
syn keyword n1qlKeyword VIEW
|
||||
syn keyword n1qlKeyword WHEN
|
||||
syn keyword n1qlKeyword WHERE
|
||||
syn keyword n1qlKeyword WHILE
|
||||
syn keyword n1qlKeyword WITHIN
|
||||
syn keyword n1qlKeyword WORK
|
||||
|
||||
|
||||
"
|
||||
" *** functions ***
|
||||
"
|
||||
syn keyword n1qlOperator ABS
|
||||
syn keyword n1qlOperator ACOS
|
||||
syn keyword n1qlOperator ARRAY_AGG
|
||||
syn keyword n1qlOperator ARRAY_APPEND
|
||||
syn keyword n1qlOperator ARRAY_AVG
|
||||
syn keyword n1qlOperator ARRAY_CONCAT
|
||||
syn keyword n1qlOperator ARRAY_CONTAINS
|
||||
syn keyword n1qlOperator ARRAY_COUNT
|
||||
syn keyword n1qlOperator ARRAY_DISTINCT
|
||||
syn keyword n1qlOperator ARRAY_FLATTEN
|
||||
syn keyword n1qlOperator ARRAY_IFNULL
|
||||
syn keyword n1qlOperator ARRAY_INSERT
|
||||
syn keyword n1qlOperator ARRAY_INTERSECT
|
||||
syn keyword n1qlOperator ARRAY_LENGTH
|
||||
syn keyword n1qlOperator ARRAY_MAX
|
||||
syn keyword n1qlOperator ARRAY_MIN
|
||||
syn keyword n1qlOperator ARRAY_POSITION
|
||||
syn keyword n1qlOperator ARRAY_PREPEND
|
||||
syn keyword n1qlOperator ARRAY_PUT
|
||||
syn keyword n1qlOperator ARRAY_RANGE
|
||||
syn keyword n1qlOperator ARRAY_REMOVE
|
||||
syn keyword n1qlOperator ARRAY_REPEAT
|
||||
syn keyword n1qlOperator ARRAY_REPLACE
|
||||
syn keyword n1qlOperator ARRAY_REVERSE
|
||||
syn keyword n1qlOperator ARRAY_SORT
|
||||
syn keyword n1qlOperator ARRAY_START
|
||||
syn keyword n1qlOperator ARRAY_SUM
|
||||
syn keyword n1qlOperator ARRAY_SYMDIFF
|
||||
syn keyword n1qlOperator ARRAY_UNION
|
||||
syn keyword n1qlOperator ASIN
|
||||
syn keyword n1qlOperator ATAN
|
||||
syn keyword n1qlOperator ATAN2
|
||||
syn keyword n1qlOperator AVG
|
||||
syn keyword n1qlOperator BASE64
|
||||
syn keyword n1qlOperator BASE64_DECODE
|
||||
syn keyword n1qlOperator BASE64_ENCODE
|
||||
syn keyword n1qlOperator CEIL
|
||||
syn keyword n1qlOperator CLOCK_LOCAL
|
||||
syn keyword n1qlOperator CLOCK_STR
|
||||
syn keyword n1qlOperator CLOCK_TZ
|
||||
syn keyword n1qlOperator CLOCK_UTC
|
||||
syn keyword n1qlOperator CLOCL_MILLIS
|
||||
syn keyword n1qlOperator CONTAINS
|
||||
syn keyword n1qlOperator COS
|
||||
syn keyword n1qlOperator COUNT
|
||||
syn keyword n1qlOperator DATE_ADD_MILLIS
|
||||
syn keyword n1qlOperator DATE_ADD_STR
|
||||
syn keyword n1qlOperator DATE_DIFF_MILLIS
|
||||
syn keyword n1qlOperator DATE_DIFF_STR
|
||||
syn keyword n1qlOperator DATE_FORMAT_STR
|
||||
syn keyword n1qlOperator DATE_PART_MILLIS
|
||||
syn keyword n1qlOperator DATE_PART_STR
|
||||
syn keyword n1qlOperator DATE_RANGE_MILLIS
|
||||
syn keyword n1qlOperator DATE_RANGE_STR
|
||||
syn keyword n1qlOperator DATE_TRUC_STR
|
||||
syn keyword n1qlOperator DATE_TRUNC_MILLIS
|
||||
syn keyword n1qlOperator DECODE_JSON
|
||||
syn keyword n1qlOperator DEGREES
|
||||
syn keyword n1qlOperator DURATION_TO_STR
|
||||
syn keyword n1qlOperator E
|
||||
syn keyword n1qlOperator ENCODED_SIZE
|
||||
syn keyword n1qlOperator ENCODE_JSON
|
||||
syn keyword n1qlOperator EXP
|
||||
syn keyword n1qlOperator FLOOR
|
||||
syn keyword n1qlOperator GREATEST
|
||||
syn keyword n1qlOperator IFINF
|
||||
syn keyword n1qlOperator IFMISSING
|
||||
syn keyword n1qlOperator IFMISSINGORNULL
|
||||
syn keyword n1qlOperator IFNAN
|
||||
syn keyword n1qlOperator IFNANORINF
|
||||
syn keyword n1qlOperator IFNULL
|
||||
syn keyword n1qlOperator INITCAP
|
||||
syn keyword n1qlOperator ISARRAY
|
||||
syn keyword n1qlOperator ISATOM
|
||||
syn keyword n1qlOperator ISBOOLEAN
|
||||
syn keyword n1qlOperator ISNUMBER
|
||||
syn keyword n1qlOperator ISOBJECT
|
||||
syn keyword n1qlOperator ISSTRING
|
||||
syn keyword n1qlOperator LEAST
|
||||
syn keyword n1qlOperator LENGTH
|
||||
syn keyword n1qlOperator LN
|
||||
syn keyword n1qlOperator LOG
|
||||
syn keyword n1qlOperator LOWER
|
||||
syn keyword n1qlOperator LTRIM
|
||||
syn keyword n1qlOperator MAX
|
||||
syn keyword n1qlOperator META
|
||||
syn keyword n1qlOperator MILLIS
|
||||
syn keyword n1qlOperator MILLIS_TO_LOCAL
|
||||
syn keyword n1qlOperator MILLIS_TO_STR
|
||||
syn keyword n1qlOperator MILLIS_TO_TZ
|
||||
syn keyword n1qlOperator MILLIS_TO_UTC
|
||||
syn keyword n1qlOperator MILLIS_TO_ZONE_NAME
|
||||
syn keyword n1qlOperator MIN
|
||||
syn keyword n1qlOperator MISSINGIF
|
||||
syn keyword n1qlOperator NANIF
|
||||
syn keyword n1qlOperator NEGINFIF
|
||||
syn keyword n1qlOperator NOW_LOCAL
|
||||
syn keyword n1qlOperator NOW_MILLIS
|
||||
syn keyword n1qlOperator NOW_STR
|
||||
syn keyword n1qlOperator NOW_TZ
|
||||
syn keyword n1qlOperator NOW_UTC
|
||||
syn keyword n1qlOperator NULLIF
|
||||
syn keyword n1qlOperator OBJECT_ADD
|
||||
syn keyword n1qlOperator OBJECT_CONCAT
|
||||
syn keyword n1qlOperator OBJECT_INNER_PAIRS
|
||||
syn keyword n1qlOperator OBJECT_INNER_VALUES
|
||||
syn keyword n1qlOperator OBJECT_LENGTH
|
||||
syn keyword n1qlOperator OBJECT_NAMES
|
||||
syn keyword n1qlOperator OBJECT_PAIRS
|
||||
syn keyword n1qlOperator OBJECT_PUT
|
||||
syn keyword n1qlOperator OBJECT_REMOVE
|
||||
syn keyword n1qlOperator OBJECT_RENAME
|
||||
syn keyword n1qlOperator OBJECT_REPLACE
|
||||
syn keyword n1qlOperator OBJECT_UNWRAP
|
||||
syn keyword n1qlOperator OBJECT_VALUES
|
||||
syn keyword n1qlOperator PI
|
||||
syn keyword n1qlOperator POLY_LENGTH
|
||||
syn keyword n1qlOperator POSINIF
|
||||
syn keyword n1qlOperator POSITION
|
||||
syn keyword n1qlOperator POWER
|
||||
syn keyword n1qlOperator RADIANS
|
||||
syn keyword n1qlOperator RANDOM
|
||||
syn keyword n1qlOperator REGEXP_CONTAINS
|
||||
syn keyword n1qlOperator REGEXP_LIKE
|
||||
syn keyword n1qlOperator REGEXP_POSITION
|
||||
syn keyword n1qlOperator REGEXP_REPLACE
|
||||
syn keyword n1qlOperator REPEAT
|
||||
syn keyword n1qlOperator REPLACE
|
||||
syn keyword n1qlOperator REVERSE
|
||||
syn keyword n1qlOperator ROUND
|
||||
syn keyword n1qlOperator RTRIM
|
||||
syn keyword n1qlOperator SIGN
|
||||
syn keyword n1qlOperator SIN
|
||||
syn keyword n1qlOperator SPLIT
|
||||
syn keyword n1qlOperator SQRT
|
||||
syn keyword n1qlOperator STR_TO_DURATION
|
||||
syn keyword n1qlOperator STR_TO_MILLIS
|
||||
syn keyword n1qlOperator STR_TO_TZ
|
||||
syn keyword n1qlOperator STR_TO_UTC
|
||||
syn keyword n1qlOperator STR_TO_ZONE_NAME
|
||||
syn keyword n1qlOperator SUBSTR
|
||||
syn keyword n1qlOperator SUFFIXES
|
||||
syn keyword n1qlOperator SUM
|
||||
syn keyword n1qlOperator TAN
|
||||
syn keyword n1qlOperator TITLE
|
||||
syn keyword n1qlOperator TOARRAY
|
||||
syn keyword n1qlOperator TOATOM
|
||||
syn keyword n1qlOperator TOBOOLEAN
|
||||
syn keyword n1qlOperator TOKENS
|
||||
syn keyword n1qlOperator TONUMBER
|
||||
syn keyword n1qlOperator TOOBJECT
|
||||
syn keyword n1qlOperator TOSTRING
|
||||
syn keyword n1qlOperator TRIM
|
||||
syn keyword n1qlOperator TRUNC
|
||||
syn keyword n1qlOperator TYPE
|
||||
syn keyword n1qlOperator UPPER
|
||||
syn keyword n1qlOperator UUID
|
||||
syn keyword n1qlOperator WEEKDAY_MILLIS
|
||||
syn keyword n1qlOperator WEEKDAY_STR
|
||||
|
||||
|
||||
"
|
||||
" *** operators ***
|
||||
"
|
||||
syn keyword n1qlOperator AND
|
||||
syn keyword n1qlOperator AS
|
||||
syn keyword n1qlOperator BY
|
||||
syn keyword n1qlOperator DISTINCT
|
||||
syn keyword n1qlOperator EXCEPT
|
||||
syn keyword n1qlOperator ILIKE
|
||||
syn keyword n1qlOperator IN
|
||||
syn keyword n1qlOperator INTERSECT
|
||||
syn keyword n1qlOperator IS
|
||||
syn keyword n1qlOperator JOIN
|
||||
syn keyword n1qlOperator LEFT
|
||||
syn keyword n1qlOperator LIKE
|
||||
syn keyword n1qlOperator MINUS
|
||||
syn keyword n1qlOperator NEST
|
||||
syn keyword n1qlOperator NESTING
|
||||
syn keyword n1qlOperator NOT
|
||||
syn keyword n1qlOperator OFFSET
|
||||
syn keyword n1qlOperator ON
|
||||
syn keyword n1qlOperator OR
|
||||
syn keyword n1qlOperator OUT
|
||||
syn keyword n1qlOperator RIGHT
|
||||
syn keyword n1qlOperator SOME
|
||||
syn keyword n1qlOperator TO
|
||||
syn keyword n1qlOperator UNION
|
||||
syn keyword n1qlOperator UNIQUE
|
||||
syn keyword n1qlOperator UNNEST
|
||||
syn keyword n1qlOperator VIA
|
||||
syn keyword n1qlOperator WITH
|
||||
syn keyword n1qlOperator XOR
|
||||
|
||||
|
||||
"
|
||||
" *** statements ***
|
||||
"
|
||||
syn keyword n1qlStatement ALTER
|
||||
syn keyword n1qlStatement ANALYZE
|
||||
syn keyword n1qlStatement BUILD
|
||||
syn keyword n1qlStatement COMMIT
|
||||
syn keyword n1qlStatement CREATE
|
||||
syn keyword n1qlStatement DELETE
|
||||
syn keyword n1qlStatement DROP
|
||||
syn keyword n1qlStatement EXECUTE
|
||||
syn keyword n1qlStatement EXPLAIN
|
||||
syn keyword n1qlStatement GRANT
|
||||
syn keyword n1qlStatement INFER
|
||||
syn keyword n1qlStatement INSERT
|
||||
syn keyword n1qlStatement MERGE
|
||||
syn keyword n1qlStatement PREPARE
|
||||
syn keyword n1qlStatement RENAME
|
||||
syn keyword n1qlStatement REVOKE
|
||||
syn keyword n1qlStatement ROLLBACK
|
||||
syn keyword n1qlStatement SELECT
|
||||
syn keyword n1qlStatement SET
|
||||
syn keyword n1qlStatement TRUNCATE
|
||||
syn keyword n1qlStatement UPDATE
|
||||
syn keyword n1qlStatement UPSERT
|
||||
|
||||
|
||||
"
|
||||
" *** types ***
|
||||
"
|
||||
syn keyword n1qlType ARRAY
|
||||
syn keyword n1qlType BINARY
|
||||
syn keyword n1qlType BOOLEAN
|
||||
syn keyword n1qlType NUMBER
|
||||
syn keyword n1qlType OBJECT
|
||||
syn keyword n1qlType RAW
|
||||
syn keyword n1qlType STRING
|
||||
|
||||
|
||||
"
|
||||
" *** strings and characters ***
|
||||
"
|
||||
syn region n1qlString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
syn region n1qlString start=+'+ skip=+\\\\\|\\'+ end=+'+
|
||||
syn region n1qlBucketSpec start=+`+ skip=+\\\\\|\\'+ end=+`+
|
||||
|
||||
|
||||
"
|
||||
" *** numbers ***
|
||||
"
|
||||
syn match n1qlNumber "-\=\<\d*\.\=[0-9_]\>"
|
||||
|
||||
|
||||
"
|
||||
" *** comments ***
|
||||
"
|
||||
syn region n1qlComment start="/\*" end="\*/" contains=n1qlTODO
|
||||
syn match n1qlComment "--.*$" contains=n1qlTODO
|
||||
syn sync ccomment n1qlComment
|
||||
|
||||
|
||||
"
|
||||
" *** TODO ***
|
||||
"
|
||||
syn keyword n1qlTODO contained TODO FIXME XXX DEBUG NOTE
|
||||
|
||||
|
||||
"
|
||||
" *** enable ***
|
||||
"
|
||||
hi def link n1qlBucketSpec Underlined
|
||||
hi def link n1qlComment Comment
|
||||
hi def link n1qlKeyword Macro
|
||||
hi def link n1qlOperator Function
|
||||
hi def link n1qlSpecial Special
|
||||
hi def link n1qlStatement Statement
|
||||
hi def link n1qlString String
|
||||
hi def link n1qlTODO Todo
|
||||
hi def link n1qlType Type
|
||||
|
||||
let b:current_syntax = "n1ql"
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: vim-perl <vim-perl@googlegroups.com>
|
||||
" Homepage: http://github.com/vim-perl/vim-perl/tree/master
|
||||
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
|
||||
" Last Change: 2013-07-23
|
||||
" Last Change: 2017-09-12
|
||||
" Contributors: Andy Lester <andy@petdance.com>
|
||||
" Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
|
||||
" Lukas Mai <l.mai.web.de>
|
||||
@@ -28,8 +28,9 @@
|
||||
" unlet perl_fold
|
||||
" unlet perl_fold_blocks
|
||||
" unlet perl_nofold_packages
|
||||
" let perl_nofold_subs = 1
|
||||
" unlet perl_nofold_subs
|
||||
" unlet perl_fold_anonymous_subs
|
||||
" unlet perl_no_subprototype_error
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -38,11 +39,6 @@ endif
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists('®expengine')
|
||||
let s:regexpengine=®expengine
|
||||
set regexpengine=1
|
||||
endif
|
||||
|
||||
" POD starts with ^=<word> and ends with ^=cut
|
||||
|
||||
if !exists("perl_include_pod") || perl_include_pod == 1
|
||||
@@ -83,7 +79,7 @@ syn match perlControl "\<\%(BEGIN\|CHECK\|INIT\|END\|UNITCHECK\)\>\_s*" nextgr
|
||||
|
||||
syn match perlStatementStorage "\<\%(my\|our\|local\|state\)\>"
|
||||
syn match perlStatementControl "\<\%(return\|last\|next\|redo\|goto\|break\)\>"
|
||||
syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|uc\%(first\)\=\)\>"
|
||||
syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|fc\|uc\%(first\)\=\)\>"
|
||||
syn match perlStatementRegexp "\<\%(pos\|quotemeta\|split\|study\)\>"
|
||||
syn match perlStatementNumeric "\<\%(abs\|atan2\|cos\|exp\|hex\|int\|log\|oct\|rand\|sin\|sqrt\|srand\)\>"
|
||||
syn match perlStatementList "\<\%(splice\|unshift\|shift\|push\|pop\|join\|reverse\|grep\|map\|sort\|unpack\)\>"
|
||||
@@ -94,9 +90,9 @@ syn match perlStatementFiledesc "\<\%(fcntl\|flock\|ioctl\|open\%(dir\)\=\|read
|
||||
syn match perlStatementVector "\<vec\>"
|
||||
syn match perlStatementFiles "\<\%(ch\%(dir\|mod\|own\|root\)\|glob\|link\|mkdir\|readlink\|rename\|rmdir\|symlink\|umask\|unlink\|utime\)\>"
|
||||
syn match perlStatementFiles "-[rwxoRWXOezsfdlpSbctugkTBMAC]\>"
|
||||
syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\)\>"
|
||||
syn match perlStatementInclude "\<\%(require\|import\)\>"
|
||||
syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\="
|
||||
syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\|evalbytes\)\>"
|
||||
syn match perlStatementInclude "\<\%(require\|import\|unimport\)\>"
|
||||
syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autodie\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|overloading\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\="
|
||||
syn match perlStatementProc "\<\%(alarm\|exec\|fork\|get\%(pgrp\|ppid\|priority\)\|kill\|pipe\|set\%(pgrp\|priority\)\|sleep\|system\|times\|wait\%(pid\)\=\)\>"
|
||||
syn match perlStatementSocket "\<\%(accept\|bind\|connect\|get\%(peername\|sock\%(name\|opt\)\)\|listen\|recv\|send\|setsockopt\|shutdown\|socket\%(pair\)\=\)\>"
|
||||
syn match perlStatementIPC "\<\%(msg\%(ctl\|get\|rcv\|snd\)\|sem\%(ctl\|get\|op\)\|shm\%(ctl\|get\|read\|write\)\)\>"
|
||||
@@ -108,7 +104,7 @@ syn match perlStatementMisc "\<\%(warn\|format\|formline\|reset\|scalar\|protot
|
||||
|
||||
syn keyword perlTodo TODO TODO: TBD TBD: FIXME FIXME: XXX XXX: NOTE NOTE: contained
|
||||
|
||||
syn region perlStatementIndirObjWrap matchgroup=perlStatementIndirObj start="\<\%(map\|grep\|sort\|printf\=\|say\|system\|exec\)\>\s*{" end="}" contains=@perlTop,perlBraces extend
|
||||
syn region perlStatementIndirObjWrap matchgroup=perlStatementIndirObj start="\%(\<\%(map\|grep\|sort\|printf\=\|say\|system\|exec\)\>\s*\)\@<={" end="}" transparent extend
|
||||
|
||||
syn match perlLabel "^\s*\h\w*\s*::\@!\%(\<v\d\+\s*:\)\@<!"
|
||||
|
||||
@@ -125,7 +121,7 @@ syn match perlLabel "^\s*\h\w*\s*::\@!\%(\<v\d\+\s*:\)\@<!"
|
||||
" Special variables first ($^A, ...) and ($|, $', ...)
|
||||
syn match perlVarPlain "$^[ACDEFHILMNOPRSTVWX]\="
|
||||
syn match perlVarPlain "$[\\\"\[\]'&`+*.,;=%~!?@#$<>(-]"
|
||||
syn match perlVarPlain "%+"
|
||||
syn match perlVarPlain "@[-+]"
|
||||
syn match perlVarPlain "$\%(0\|[1-9]\d*\)"
|
||||
" Same as above, but avoids confusion in $::foo (equivalent to $main::foo)
|
||||
syn match perlVarPlain "$::\@!"
|
||||
@@ -143,41 +139,46 @@ syn match perlPackageRef "[$@#%*&]\%(\%(::\|'\)\=\I\i*\%(\%(::\|'\)\I\i*\)*\)\
|
||||
" just set the variable "perl_no_extended_vars"...
|
||||
|
||||
if !exists("perl_no_scope_in_variables")
|
||||
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef
|
||||
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
|
||||
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
|
||||
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
|
||||
else
|
||||
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)"
|
||||
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
|
||||
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
|
||||
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
|
||||
endif
|
||||
|
||||
syn match perlVarPlain2 "%[-+]"
|
||||
|
||||
if !exists("perl_no_extended_vars")
|
||||
syn cluster perlExpr contains=perlStatementIndirObjWrap,perlStatementScalar,perlStatementRegexp,perlStatementNumeric,perlStatementList,perlStatementHash,perlStatementFiles,perlStatementTime,perlStatementMisc,perlVarPlain,perlVarPlain2,perlVarNotInMatches,perlVarSlash,perlVarBlock,perlVarBlock2,perlShellCommand,perlFloat,perlNumber,perlStringUnexpanded,perlString,perlQQ,perlArrow,perlBraces
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*\[" end="\]" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*{" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
|
||||
syn match perlArrow "->\s*{\s*\I\i*\s*}" contains=perlVarSimpleMemberName nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*\$*\I\i*\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
|
||||
syn region perlVarBlock matchgroup=perlVarPlain start="\%($#\|[$@]\)\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
|
||||
syn region perlVarBlock2 matchgroup=perlVarPlain start="[%&*]\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
|
||||
syn match perlVarPlain2 "[%&*]\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
|
||||
syn match perlVarPlain "\%(\$#\|[@$]\)\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
|
||||
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\={" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
|
||||
syn match perlVarSimpleMember "\%(->\)\={\s*\I\i*\s*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contains=perlVarSimpleMemberName contained extend
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*\[" end="\]" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*{" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
|
||||
syn match perlArrow "->\s*{\s*\I\i*\s*}" contains=perlVarSimpleMemberName nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*\$*\I\i*\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
|
||||
syn region perlVarBlock matchgroup=perlVarPlain start="\%($#\|[$@]\)\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
|
||||
syn region perlVarBlock2 matchgroup=perlVarPlain start="[%&*]\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
|
||||
syn match perlVarPlain2 "[%&*]\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
|
||||
syn match perlVarPlain "\%(\$#\|[@$]\)\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
|
||||
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\={" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
|
||||
syn match perlVarSimpleMember "\%(->\)\={\s*\I\i*\s*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contains=perlVarSimpleMemberName contained extend
|
||||
syn match perlVarSimpleMemberName "\I\i*" contained
|
||||
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
|
||||
syn match perlPackageConst "__PACKAGE__" nextgroup=perlMethod
|
||||
syn match perlMethod "->\$*\I\i*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod
|
||||
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
|
||||
syn match perlPackageConst "__PACKAGE__" nextgroup=perlMethod,perlPostDeref
|
||||
syn match perlMethod "->\$*\I\i*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
|
||||
syn match perlPostDeref "->\%($#\|[$@%&*]\)\*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
|
||||
syn region perlPostDeref start="->\%($#\|[$@%&*]\)\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
|
||||
syn region perlPostDeref matchgroup=perlPostDeref start="->\%($#\|[$@%&*]\){" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
|
||||
endif
|
||||
|
||||
" File Descriptors
|
||||
syn match perlFiledescRead "<\h\w*>"
|
||||
|
||||
syn match perlFiledescStatementComma "(\=\s*\u\w*\s*,"me=e-1 transparent contained contains=perlFiledescStatement
|
||||
syn match perlFiledescStatementNocomma "(\=\s*\u\w*\s*[^, \t]"me=e-1 transparent contained contains=perlFiledescStatement
|
||||
syn match perlFiledescStatementComma "(\=\s*\<\u\w*\>\s*,"me=e-1 transparent contained contains=perlFiledescStatement
|
||||
syn match perlFiledescStatementNocomma "(\=\s*\<\u\w*\>\s*[^, \t]"me=e-1 transparent contained contains=perlFiledescStatement
|
||||
|
||||
syn match perlFiledescStatement "\u\w*" contained
|
||||
syn match perlFiledescStatement "\<\u\w*\>" contained
|
||||
|
||||
" Special characters in strings and matches
|
||||
syn match perlSpecialString "\\\%(\o\{1,3}\|x\%({\x\+}\|\x\{1,2}\)\|c.\|[^cx]\)" contained extend
|
||||
@@ -241,20 +242,18 @@ syn region perlAnglesDQ start=+<+ end=+>+ extend contained contains=perlAnglesD
|
||||
|
||||
|
||||
" Simple version of searches and matches
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1[msixpodualgc]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m#+ end=+#[msixpodualgc]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*'+ end=+'[msixpodualgc]*+ contains=@perlInterpSQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*/+ end=+/[msixpodualgc]*+ contains=@perlInterpSlash keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*(+ end=+)[msixpodualgc]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
|
||||
|
||||
" A special case for m{}, m<> and m[] which allows for comments and extra whitespace in the pattern
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*{+ end=+}[msixpodualgc]*+ contains=@perlInterpMatch,perlComment,perlBracesDQ extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*<+ end=+>[msixpodualgc]*+ contains=@perlInterpMatch,perlAnglesDQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*\[+ end=+\][msixpodualgc]*+ contains=@perlInterpMatch,perlComment,perlBracketsDQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1[msixpodualgcn]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m#+ end=+#[msixpodualgcn]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*'+ end=+'[msixpodualgcn]*+ contains=@perlInterpSQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*/+ end=+/[msixpodualgcn]*+ contains=@perlInterpSlash keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*(+ end=+)[msixpodualgcn]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*{+ end=+}[msixpodualgcn]*+ contains=@perlInterpMatch,perlBracesDQ extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*<+ end=+>[msixpodualgcn]*+ contains=@perlInterpMatch,perlAnglesDQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*\[+ end=+\][msixpodualgcn]*+ contains=@perlInterpMatch,perlBracketsDQ keepend extend
|
||||
|
||||
" Below some hacks to recognise the // variant. This is virtually impossible to catch in all
|
||||
" cases as the / is used in so many other ways, but these should be the most obvious ones.
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start="\%([$@%&*]\@<!\%(\<split\|\<while\|\<if\|\<unless\|\.\.\|[-+*!~(\[{=]\)\s*\)\@<=/\%(/=\)\@!" start=+^/\%(/=\)\@!+ start=+\s\@<=/\%(/=\)\@![^[:space:][:digit:]$@%=]\@=\%(/\_s*\%([([{$@%&*[:digit:]"'`]\|\_s\w\|[[:upper:]_abd-fhjklnqrt-wyz]\)\)\@!+ skip=+\\/+ end=+/[msixpodualgc]*+ contains=@perlInterpSlash extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start="\%([$@%&*]\@<!\%(\<split\|\<while\|\<if\|\<unless\|\.\.\|[-+*!~(\[{=]\)\s*\)\@<=/\%(/=\)\@!" start=+^/\%(/=\)\@!+ start=+\s\@<=/\%(/=\)\@![^[:space:][:digit:]$@%=]\@=\%(/\_s*\%([([{$@%&*[:digit:]"'`]\|\_s\w\|[[:upper:]_abd-fhjklnqrt-wyz]\)\)\@!+ skip=+\\/+ end=+/[msixpodualgcn]*+ contains=@perlInterpSlash extend
|
||||
|
||||
|
||||
" Substitutions
|
||||
@@ -267,12 +266,12 @@ syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*<+ end=+>+ contains=@perlInterpMatch,perlAnglesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*\[+ end=+\]+ contains=@perlInterpMatch,perlBracketsDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*{+ end=+}+ contains=@perlInterpMatch,perlBracesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]'([{<]\)+ end=+\z1[msixpodualgcer]*+ keepend contained contains=@perlInterpDQ extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+(+ end=+)[msixpodualgcer]*+ contained contains=@perlInterpDQ,perlParensDQ keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][msixpodualgcer]*+ contained contains=@perlInterpDQ,perlBracketsDQ keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+{+ end=+}[msixpodualgcer]*+ contained contains=@perlInterpDQ,perlBracesDQ keepend extend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+<+ end=+>[msixpodualgcer]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend extend
|
||||
syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[msixpodualgcer]*+ contained contains=@perlInterpSQ keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]'([{<]\)+ end=+\z1[msixpodualgcern]*+ keepend contained contains=@perlInterpDQ extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+(+ end=+)[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlParensDQ keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][msixpodualgcern]*+ contained contains=@perlInterpDQ,perlBracketsDQ keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+{+ end=+}[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlBracesDQ keepend extend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+<+ end=+>[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend extend
|
||||
syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[msixpodualgcern]*+ contained contains=@perlInterpSQ keepend extend
|
||||
|
||||
" Translations
|
||||
" perlMatch is the first part, perlTranslation* is the second, translator part.
|
||||
@@ -314,35 +313,40 @@ syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ keepend extend
|
||||
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\>\s*\z([^[:space:]#([{<'/]\)+ end=+\z1[imosx]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*/+ end=+/[imosx]*+ contains=@perlInterpSlash keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr#+ end=+#[imosx]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*'+ end=+'[imosx]*+ contains=@perlInterpSQ keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*(+ end=+)[imosx]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\>\s*\z([^[:space:]#([{<'/]\)+ end=+\z1[imosxdual]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*/+ end=+/[imosxdual]*+ contains=@perlInterpSlash keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr#+ end=+#[imosxdual]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*'+ end=+'[imosxdual]*+ contains=@perlInterpSQ keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*(+ end=+)[imosxdual]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
|
||||
|
||||
" A special case for qr{}, qr<> and qr[] which allows for comments and extra whitespace in the pattern
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*{+ end=+}[imosx]*+ contains=@perlInterpMatch,perlBracesDQ,perlComment keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*<+ end=+>[imosx]*+ contains=@perlInterpMatch,perlAnglesDQ,perlComment keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*\[+ end=+\][imosx]*+ contains=@perlInterpMatch,perlBracketsDQ,perlComment keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*{+ end=+}[imosxdual]*+ contains=@perlInterpMatch,perlBracesDQ,perlComment keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*<+ end=+>[imosxdual]*+ contains=@perlInterpMatch,perlAnglesDQ,perlComment keepend extend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*\[+ end=+\][imosxdual]*+ contains=@perlInterpMatch,perlBracketsDQ,perlComment keepend extend
|
||||
|
||||
" Constructs such as print <<EOF [...] EOF, 'here' documents
|
||||
"
|
||||
" XXX Any statements after the identifier are in perlString colour (i.e.
|
||||
" 'if $a' in 'print <<EOF if $a'). This is almost impossible to get right it
|
||||
" seems due to the 'auto-extending nature' of regions.
|
||||
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\z(\I\i*\)+ end=+$+ contains=@perlTop oneline
|
||||
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+$+ contains=@perlTop oneline
|
||||
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+$+ contains=@perlTop oneline
|
||||
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*""+ end=+$+ contains=@perlTop oneline
|
||||
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*''+ end=+$+ contains=@perlTop oneline
|
||||
if exists("perl_fold")
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\).*+ end=+^\z1$+ contains=@perlInterpDQ fold extend
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ fold extend
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ fold extend
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine fold extend
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine fold extend
|
||||
syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend
|
||||
syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend
|
||||
syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ fold extend
|
||||
syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine fold extend
|
||||
syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine fold extend
|
||||
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL fold extend
|
||||
else
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\).*+ end=+^\z1$+ contains=@perlInterpDQ
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine
|
||||
syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ
|
||||
syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ
|
||||
syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ
|
||||
syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine
|
||||
syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine
|
||||
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL
|
||||
endif
|
||||
|
||||
@@ -356,28 +360,22 @@ syn keyword perlStatementPackage package contained
|
||||
" sub [name] [(prototype)] {
|
||||
"
|
||||
syn match perlSubError "[^[:space:];{#]" contained
|
||||
if v:version == 701 && !has('patch221') " XXX I hope that's the right one
|
||||
syn match perlSubAttributes ":" contained
|
||||
syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained
|
||||
syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ
|
||||
syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup
|
||||
syn match perlSubAttributes "" contained nextgroup=perlSubError
|
||||
syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
|
||||
if get(g:, "perl_sub_signatures", 0)
|
||||
syn match perlSignature +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained
|
||||
else
|
||||
syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained
|
||||
syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ
|
||||
syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup
|
||||
syn match perlSubAttributes "" contained nextgroup=perlSubError
|
||||
syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
|
||||
syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
|
||||
syn match perlSubPrototype +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError
|
||||
endif
|
||||
syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
|
||||
syn match perlSubPrototype +(\_[^)]*)\_s*\|+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError
|
||||
syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype,perlComment
|
||||
|
||||
syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype,perlSignature,perlSubAttributes,perlComment
|
||||
|
||||
syn match perlFunction +\<sub\>\_s*+ nextgroup=perlSubName
|
||||
|
||||
if !exists("perl_no_scope_in_variables")
|
||||
syn match perlFunctionPRef "\h\w*::" contained
|
||||
syn match perlFunctionName "\h\w*[^:]" contained
|
||||
else
|
||||
syn match perlFunctionName "\h[[:alnum:]_:]*" contained
|
||||
endif
|
||||
|
||||
" The => operator forces a bareword to the left of it to be interpreted as
|
||||
" a string
|
||||
syn match perlString "\I\@<!-\?\I\i*\%(\s*=>\)\@="
|
||||
@@ -397,10 +395,10 @@ syn match perlFormatField "@$" contained
|
||||
|
||||
" __END__ and __DATA__ clauses
|
||||
if exists("perl_fold")
|
||||
syntax region perlDATA start="^__DATA__$" skip="." end="." fold
|
||||
syntax region perlDATA start="^__DATA__$" skip="." end="." contains=@perlDATA fold
|
||||
syntax region perlDATA start="^__END__$" skip="." end="." contains=perlPOD,@perlDATA fold
|
||||
else
|
||||
syntax region perlDATA start="^__DATA__$" skip="." end="."
|
||||
syntax region perlDATA start="^__DATA__$" skip="." end="." contains=@perlDATA
|
||||
syntax region perlDATA start="^__END__$" skip="." end="." contains=perlPOD,@perlDATA
|
||||
endif
|
||||
|
||||
@@ -414,9 +412,9 @@ if exists("perl_fold")
|
||||
syn region perlPackageFold start="^package \S\+;\s*\%(#.*\)\=$" end="^1;\=\s*\%(#.*\)\=$" end="\n\+package"me=s-1 transparent fold keepend
|
||||
endif
|
||||
if !exists("perl_nofold_subs")
|
||||
if exists("perl_fold_anonymous_subs") && perl_fold_anonymous_subs
|
||||
syn region perlSubFold start="\<sub\>[^\n;]*{" end="}" transparent fold keepend extend
|
||||
syn region perlSubFold start="\<\%(BEGIN\|END\|CHECK\|INIT\)\>\s*{" end="}" transparent fold keepend
|
||||
if get(g:, "perl_fold_anonymous_subs", 0)
|
||||
syn region perlSubFold start="\<sub\>[^{]*{" end="}" transparent fold keepend extend
|
||||
syn region perlSubFold start="\<\%(BEGIN\|END\|CHECK\|INIT\)\>\s*{" end="}" transparent fold keepend
|
||||
else
|
||||
syn region perlSubFold start="^\z(\s*\)\<sub\>.*[^};]$" end="^\z1}\s*\%(#.*\)\=$" transparent fold keepend
|
||||
syn region perlSubFold start="^\z(\s*\)\<\%(BEGIN\|END\|CHECK\|INIT\|UNITCHECK\)\>.*[^};]$" end="^\z1}\s*$" transparent fold keepend
|
||||
@@ -424,7 +422,7 @@ if exists("perl_fold")
|
||||
endif
|
||||
|
||||
if exists("perl_fold_blocks")
|
||||
syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)foreach\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
|
||||
syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)for\%(each\)\=\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
|
||||
syn region perlBlockFold start="^\z(\s*\)\%(do\|else\)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*while" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
|
||||
endif
|
||||
|
||||
@@ -435,7 +433,6 @@ else
|
||||
syn sync minlines=0
|
||||
endif
|
||||
|
||||
|
||||
" NOTE: If you're linking new highlight groups to perlString, please also put
|
||||
" them into b:match_skip in ftplugin/perl.vim.
|
||||
|
||||
@@ -458,6 +455,7 @@ hi def link perlOperator Operator
|
||||
hi def link perlFunction Keyword
|
||||
hi def link perlSubName Function
|
||||
hi def link perlSubPrototype Type
|
||||
hi def link perlSignature Type
|
||||
hi def link perlSubAttributes PreProc
|
||||
hi def link perlSubAttributesCont perlSubAttributes
|
||||
hi def link perlComment Comment
|
||||
@@ -516,8 +514,11 @@ hi def link perlStatementMisc perlStatement
|
||||
hi def link perlStatementIndirObj perlStatement
|
||||
hi def link perlFunctionName perlIdentifier
|
||||
hi def link perlMethod perlIdentifier
|
||||
hi def link perlPostDeref perlIdentifier
|
||||
hi def link perlFunctionPRef perlType
|
||||
hi def link perlPOD perlComment
|
||||
if !get(g:, 'perl_include_pod', 1)
|
||||
hi def link perlPOD perlComment
|
||||
endif
|
||||
hi def link perlShellCommand perlString
|
||||
hi def link perlSpecialAscii perlSpecial
|
||||
hi def link perlSpecialDollar perlSpecial
|
||||
@@ -548,7 +549,6 @@ hi def link perlElseIfError Error
|
||||
hi def link perlSubPrototypeError Error
|
||||
hi def link perlSubError Error
|
||||
|
||||
|
||||
" Syncing to speed up processing
|
||||
"
|
||||
if !exists("perl_no_sync_on_sub")
|
||||
@@ -575,11 +575,6 @@ syn sync match perlSyncPOD grouphere NONE "^=cut"
|
||||
|
||||
let b:current_syntax = "perl"
|
||||
|
||||
if exists('®expengine')
|
||||
let ®expengine=s:regexpengine
|
||||
unlet s:regexpengine
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
" Previously: Scott Bigham <dsb@killerbunnies.org>
|
||||
" Homepage: http://github.com/vim-perl/vim-perl
|
||||
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
|
||||
" Last Change: 2013-07-21
|
||||
" Last Change: 2017-09-12
|
||||
|
||||
" To add embedded POD documentation highlighting to your syntax file, add
|
||||
" the commands:
|
||||
@@ -68,7 +68,7 @@ syn match podEscape2 "\d\+>"me=e-1 contained contains=@NoSpell
|
||||
|
||||
hi def link podCommand Statement
|
||||
hi def link podCmdText String
|
||||
hi def link podOverIndent Number
|
||||
hi def link podOverIndent Number
|
||||
hi def link podForKeywd Identifier
|
||||
hi def link podFormat Identifier
|
||||
hi def link podVerbatimLine PreProc
|
||||
@@ -76,7 +76,6 @@ hi def link podSpecial Identifier
|
||||
hi def link podEscape String
|
||||
hi def link podEscape2 Number
|
||||
|
||||
|
||||
if exists("perl_pod_spellcheck_headings")
|
||||
" Spell-check headings
|
||||
syn clear podCmdText
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: readline(3) configuration file
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2012-04-25
|
||||
" Latest Revision: 2017-06-25
|
||||
" readline_has_bash - if defined add support for bash specific
|
||||
" settings/functions
|
||||
|
||||
@@ -119,6 +119,7 @@ syn keyword readlineVariable contained
|
||||
\ nextgroup=readlineBoolean
|
||||
\ skipwhite
|
||||
\ bind-tty-special-chars
|
||||
\ colored-stats
|
||||
\ completion-ignore-case
|
||||
\ completion-map-case
|
||||
\ convert-meta
|
||||
@@ -142,6 +143,7 @@ syn keyword readlineVariable contained
|
||||
\ revert-all-at-newline
|
||||
\ show-all-if-ambiguous
|
||||
\ show-all-if-unmodified
|
||||
\ show-mode-in-prompt
|
||||
\ skip-completed-text
|
||||
\ visible-stats
|
||||
|
||||
@@ -158,6 +160,7 @@ syn keyword readlineVariable contained
|
||||
\ completion-prefix-display-length
|
||||
\ completion-query-items
|
||||
\ history-size
|
||||
\ keyseq-timeout
|
||||
|
||||
syn keyword readlineVariable contained
|
||||
\ nextgroup=readlineEditingMode
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Zhen-Huan Hu <wildkeny@gmail.com>
|
||||
" Original Maintainer: James Kidd <james.kidd@covance.com>
|
||||
" Version: 3.0.0
|
||||
" Last Change: Mar 10, 2017
|
||||
" Last Change: Aug 26, 2017
|
||||
"
|
||||
" 2017 Mar 7
|
||||
"
|
||||
@@ -120,7 +120,7 @@ syn match sasDataStepStatement '\v%(^|;)\s*\zs%(dcl|declare)>' display contained
|
||||
syn match sasDataStepStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
syn match sasDataStepStatement '\v%(^|;)\s*\zs%(format|informat|input|put)>' display contained contains=sasDataStepStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
|
||||
syn match sasDataStepStatement '\v%(^|;)\s*\zs%(cards|datalines|lines)4=\s*;' display contained contains=sasDataStepStatementKeyword nextgroup=sasDataLine skipwhite skipnl skipempty
|
||||
syn region sasDataLine start='^' end='^;'me=s-1 contained
|
||||
syn region sasDataLine start='^' end='^\s*;'me=s-1 contained
|
||||
syn region sasDataStep matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsdata>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,@sasDataStepSyntax
|
||||
syn cluster sasDataStepSyntax contains=sasDataStepFunction,sasDataStepHashOperator,sasDataStepHashAttribute,sasDataStepHashMethod,sasDataStepControl,sasDataStepStatement
|
||||
|
||||
|
||||
97
runtime/syntax/tap.vim
Normal file
97
runtime/syntax/tap.vim
Normal file
@@ -0,0 +1,97 @@
|
||||
" Vim syntax file
|
||||
" Language: Verbose TAP Output
|
||||
" Maintainer: Rufus Cable <rufus@threebytesfull.com>
|
||||
" Remark: Simple syntax highlighting for TAP output
|
||||
" License:
|
||||
" Copyright: (c) 2008-2013 Rufus Cable
|
||||
" Last Change: 2014-12-13
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn match tapTestDiag /^ *#.*/ contains=tapTestTodo
|
||||
syn match tapTestTime /^ *\[\d\d:\d\d:\d\d\].*/ contains=tapTestFile
|
||||
syn match tapTestFile /\w\+\/[^. ]*/ contained
|
||||
syn match tapTestFileWithDot /\w\+\/[^ ]*/ contained
|
||||
|
||||
syn match tapTestPlan /^ *\d\+\.\.\d\+$/
|
||||
|
||||
" tapTest is a line like 'ok 1', 'not ok 2', 'ok 3 - xxxx'
|
||||
syn match tapTest /^ *\(not \)\?ok \d\+.*/ contains=tapTestStatusOK,tapTestStatusNotOK,tapTestLine
|
||||
|
||||
" tapTestLine is the line without the ok/not ok status - i.e. number and
|
||||
" optional message
|
||||
syn match tapTestLine /\d\+\( .*\|$\)/ contains=tapTestNumber,tapTestLoadMessage,tapTestTodo,tapTestSkip contained
|
||||
|
||||
" turn ok/not ok messages green/red respectively
|
||||
syn match tapTestStatusOK /ok/ contained
|
||||
syn match tapTestStatusNotOK /not ok/ contained
|
||||
|
||||
" highlight todo tests
|
||||
syn match tapTestTodo /\(# TODO\|Failed (TODO)\) .*$/ contained contains=tapTestTodoRev
|
||||
syn match tapTestTodoRev /\<TODO\>/ contained
|
||||
|
||||
" highlight skipped tests
|
||||
syn match tapTestSkip /# skip .*$/ contained contains=tapTestSkipTag
|
||||
syn match tapTestSkipTag /\(# \)\@<=skip\>/ contained
|
||||
|
||||
" look behind so "ok 123" and "not ok 124" match test number
|
||||
syn match tapTestNumber /\(ok \)\@<=\d\d*/ contained
|
||||
syn match tapTestLoadMessage /\*\*\*.*\*\*\*/ contained contains=tapTestThreeStars,tapTestFileWithDot
|
||||
syn match tapTestThreeStars /\*\*\*/ contained
|
||||
|
||||
syn region tapTestRegion start=/^ *\(not \)\?ok.*$/me=e+1 end=/^\(\(not \)\?ok\|# Looks like you planned \|All tests successful\|Bailout called\)/me=s-1 fold transparent excludenl
|
||||
syn region tapTestResultsOKRegion start=/^\(All tests successful\|Result: PASS\)/ end=/$/
|
||||
syn region tapTestResultsNotOKRegion start=/^\(# Looks like you planned \|Bailout called\|# Looks like you failed \|Result: FAIL\)/ end=/$/
|
||||
syn region tapTestResultsSummaryRegion start=/^Test Summary Report/ end=/^Files=.*$/ contains=tapTestResultsSummaryHeading,tapTestResultsSummaryNotOK
|
||||
|
||||
syn region tapTestResultsSummaryHeading start=/^Test Summary Report/ end=/^-\+$/ contained
|
||||
syn region tapTestResultsSummaryNotOK start=/TODO passed:/ end=/$/ contained
|
||||
|
||||
syn region tapTestInstructionsRegion start=/\%1l/ end=/^$/
|
||||
|
||||
set foldtext=TAPTestLine_foldtext()
|
||||
function! TAPTestLine_foldtext()
|
||||
let line = getline(v:foldstart)
|
||||
let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
|
||||
return sub
|
||||
endfunction
|
||||
|
||||
set foldminlines=5
|
||||
set foldcolumn=2
|
||||
set foldenable
|
||||
set foldmethod=syntax
|
||||
syn sync fromstart
|
||||
|
||||
if !exists("did_tapverboseoutput_syntax_inits")
|
||||
let did_tapverboseoutput_syntax_inits = 1
|
||||
|
||||
hi tapTestStatusOK term=bold ctermfg=green guifg=Green
|
||||
hi tapTestStatusNotOK term=reverse ctermfg=black ctermbg=red guifg=Black guibg=Red
|
||||
hi tapTestTodo term=bold ctermfg=yellow ctermbg=black guifg=Yellow guibg=Black
|
||||
hi tapTestTodoRev term=reverse ctermfg=black ctermbg=yellow guifg=Black guibg=Yellow
|
||||
hi tapTestSkip term=bold ctermfg=lightblue guifg=LightBlue
|
||||
hi tapTestSkipTag term=reverse ctermfg=black ctermbg=lightblue guifg=Black guibg=LightBlue
|
||||
hi tapTestTime term=bold ctermfg=blue guifg=Blue
|
||||
hi tapTestFile term=reverse ctermfg=black ctermbg=yellow guibg=Black guifg=Yellow
|
||||
hi tapTestLoadedFile term=bold ctermfg=black ctermbg=cyan guibg=Cyan guifg=Black
|
||||
hi tapTestThreeStars term=reverse ctermfg=blue guifg=Blue
|
||||
hi tapTestPlan term=bold ctermfg=yellow guifg=Yellow
|
||||
|
||||
hi link tapTestFileWithDot tapTestLoadedFile
|
||||
hi link tapTestNumber Number
|
||||
hi link tapTestDiag Comment
|
||||
|
||||
hi tapTestRegion ctermbg=green
|
||||
|
||||
hi tapTestResultsOKRegion ctermbg=green ctermfg=black
|
||||
hi tapTestResultsNotOKRegion ctermbg=red ctermfg=black
|
||||
|
||||
hi tapTestResultsSummaryHeading ctermbg=blue ctermfg=white
|
||||
hi tapTestResultsSummaryNotOK ctermbg=red ctermfg=black
|
||||
|
||||
hi tapTestInstructionsRegion ctermbg=lightmagenta ctermfg=black
|
||||
endif
|
||||
|
||||
let b:current_syntax="tapVerboseOutput"
|
||||
@@ -3,10 +3,10 @@
|
||||
" Author: Moriki, Atsushi <4woods+vim@gmail.com>
|
||||
" Homepage: http://github.com/vim-perl/vim-perl
|
||||
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
|
||||
" Last Change: 2013-07-21
|
||||
" Last Change: 2015-04-25
|
||||
"
|
||||
" Instration:
|
||||
" put tt2.vim and tt2html.vim in to your syntax diretory.
|
||||
" Installation:
|
||||
" put tt2.vim and tt2html.vim in to your syntax directory.
|
||||
"
|
||||
" add below in your filetype.vim.
|
||||
" au BufNewFile,BufRead *.tt2 setf tt2
|
||||
|
||||
@@ -78,7 +78,7 @@ syn case match
|
||||
|
||||
" Function Names {{{2
|
||||
syn keyword vimFuncName contained abs append argv assert_fails assert_notequal atan2 buflisted bufwinid byteidxcomp ch_close_in ch_getjob ch_open ch_sendraw char2nr complete copy cscope_connection did_filetype escape execute expand filewritable float2nr fnamemodify foldtext function getbufline getcharsearch getcmdwintype getfontname getftype getpid getregtype getwininfo glob has_key histdel hlexists index inputrestore invert items job_start js_decode json_encode libcall line2byte log map match matcharg matchlist max mode nr2char perleval printf pyeval reltime remote_expr remote_read rename reverse screenchar search searchpairpos serverlist setcmdpos setloclist setqflist settabwinvar shellescape sin soundfold split str2nr strdisplaywidth stridx strpart strwidth synID synconcealed systemlist tabpagewinnr tan test_alloc_fail test_garbagecollect_now test_null_job test_null_string timer_pause timer_stopall tr undofile values wildmenumode win_gotoid winbufnr winline winrestview wordcount
|
||||
syn keyword vimFuncName contained acos argc asin assert_false assert_notmatch browse bufloaded bufwinnr call ch_evalexpr ch_info ch_read ch_setoptions cindent complete_add cos cursor diff_filler eval exepath extend filter floor foldclosed foldtextresult garbagecollect getbufvar getcmdline getcompletion getfperm getline getpos gettabinfo getwinposx glob2regpat haslocaldir histget hostname input inputsave isdirectory job_getchannel job_status js_encode keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr min mzeval or pow pumvisible range reltimefloat remote_foreground remote_send repeat round screencol searchdecl searchpos setbufvar setfperm setmatches setreg setwinvar shiftwidth sinh spellbadword sqrt strcharpart strftime string strridx submatch synIDattr synstack tabpagebuflist tagfiles tanh test_autochdir test_null_channel test_null_list test_settime timer_start tolower trunc undotree virtcol win_findbuf win_id2tabwin wincol winnr winsaveview writefile
|
||||
syn keyword vimFuncName contained acos argc asin assert_false assert_notmatch browse bufloaded bufwinnr call ch_evalexpr ch_info ch_read ch_setoptions cindent complete_add cos cursor diff_filler eval exepath extend filter floor foldclosed foldtextresult garbagecollect getbufvar getcmdline getcompletion getfperm getline getpos gettabinfo getwinposx glob2regpat haslocaldir histget hostname input inputsave isdirectory job_getchannel job_status js_encode keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr min mzeval or pow pumvisible range reltimefloat remote_foreground remote_send repeat round screencol searchdecl searchpos setbufline setbufvar setfperm setmatches setreg setwinvar shiftwidth sinh spellbadword sqrt strcharpart strftime string strridx submatch synIDattr synstack tabpagebuflist tagfiles tanh test_autochdir test_null_channel test_null_list test_settime timer_start tolower trunc undotree virtcol win_findbuf win_id2tabwin wincol winnr winsaveview writefile
|
||||
syn keyword vimFuncName contained add argidx assert_equal assert_inrange assert_true browsedir bufname byte2line ceil ch_evalraw ch_log ch_readraw ch_status clearmatches complete_check cosh deepcopy diff_hlID eventhandler exists feedkeys finddir fmod foldclosedend foreground get getchar getcmdpos getcurpos getfsize getloclist getqflist gettabvar getwinposy globpath hasmapto histnr iconv inputdialog inputsecret islocked job_info job_stop json_decode len line localtime luaeval mapcheck matchaddpos matchend matchstrpos mkdir nextnonblank pathshorten prevnonblank py3eval readfile reltimestr remote_peek remove resolve screenattr screenrow searchpair server2client setcharsearch setline setpos settabvar sha256 simplify sort spellsuggest str2float strchars strgetchar strlen strtrans substitute synIDtrans system tabpagenr taglist tempname test_disable_char_avail test_null_dict test_null_partial timer_info timer_stop toupper type uniq visualmode win_getid win_id2win winheight winrestcmd winwidth xor
|
||||
syn keyword vimFuncName contained and arglistid assert_exception assert_match atan bufexists bufnr byteidx ch_close ch_getbufnr ch_logfile ch_sendexpr changenr col confirm count delete empty executable exp filereadable findfile fnameescape foldlevel funcref getbufinfo getcharmod getcmdtype getcwd getftime getmatches getreg gettabwinvar getwinvar has histadd hlID indent inputlist insert isnan job_setoptions join
|
||||
|
||||
@@ -560,7 +560,7 @@ syn match vimHiBang contained "!" skipwhite nextgroup=@vimHighlightCluster
|
||||
|
||||
syn match vimHiGroup contained "\i\+"
|
||||
syn case ignore
|
||||
syn keyword vimHiAttrib contained none bold inverse italic reverse standout underline undercurl
|
||||
syn keyword vimHiAttrib contained none bold inverse italic reverse standout underline undercurl nocombine
|
||||
syn keyword vimFgBgAttrib contained none bg background fg foreground
|
||||
syn case match
|
||||
syn match vimHiAttribList contained "\i\+" contains=vimHiAttrib
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@
|
||||
|
||||
ATTENTION:
|
||||
The commands in the lessons will modify the text. Make a copy of this
|
||||
file to practise on (if you started "vimtutor" this is already a copy).
|
||||
file to practice on (if you started "vimtutor" this is already a copy).
|
||||
|
||||
It is important to remember that this tutor is set up to teach by
|
||||
use. That means that you need to execute the commands to learn them
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -790,10 +790,10 @@
|
||||
1. Переместите курсор вниз, к первой строке помеченной --->, и в начало
|
||||
первого слова xxx.
|
||||
|
||||
2. Теперь нажмите R и введите число указанный ниже во второй строке чтобы
|
||||
2. Теперь нажмите R и введите число, указанное ниже во второй строке, чтобы
|
||||
заменить xxx.
|
||||
|
||||
3. Нажмите <ESC> для выхода из режима замены. Заметьте что остаток строки
|
||||
3. Нажмите <ESC> для выхода из режима замены. Заметьте, что остаток строки
|
||||
не был изменён.
|
||||
|
||||
4. Повторите эти шаги для замены оставшихся xxx.
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
ATTENTION:
|
||||
The commands in the lessons will modify the text. Make a copy of this
|
||||
file to practise on (if you started "vimtutor" this is already a copy).
|
||||
file to practice on (if you started "vimtutor" this is already a copy).
|
||||
|
||||
It is important to remember that this tutor is set up to teach by
|
||||
use. That means that you need to execute the commands to learn them
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
---> 現在您應該已經學會如何移動到下一講吧。
|
||||
|
||||
3. 現在請使用下行鍵,將光標移動到第二講。
|
||||
3. 現在請使用下行鍵,將光標移動到第一講第二節。
|
||||
|
||||
提示︰如果您不敢確定您所按下的字母,請按下<ESC>鍵回到正常(Normal)模式。
|
||||
然後再次從鍵盤輸入您想要的命令。
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
---> 現在您應該已經學會如何移動到下一講吧。
|
||||
|
||||
3. 現在請使用下行鍵,將光標移動到第二講。
|
||||
3. 現在請使用下行鍵,將光標移動到第一講第二節。
|
||||
|
||||
提示︰如果您不敢確定您所按下的字母,請按下<ESC>鍵回到正常(Normal)模式。
|
||||
然後再次從鍵盤輸入您想要的命令。
|
||||
|
||||
@@ -36,8 +36,16 @@ CPU = i386
|
||||
|
||||
!ifdef SDK_INCLUDE_DIR
|
||||
!include $(SDK_INCLUDE_DIR)\Win32.mak
|
||||
!else
|
||||
!elseif "$(USE_WIN32MAK)"=="yes"
|
||||
!include <Win32.mak>
|
||||
!else
|
||||
cc = cl
|
||||
link = link
|
||||
rc = rc
|
||||
cflags = -nologo -c
|
||||
lflags = -incremental:no -nologo
|
||||
rcflags = /r
|
||||
olelibsdll = ole32.lib uuid.lib oleaut32.lib user32.lib gdi32.lib advapi32.lib
|
||||
!endif
|
||||
|
||||
# include CPUARG
|
||||
|
||||
@@ -481,7 +481,10 @@ You need to set the following variables:
|
||||
MZSCHEME: Where Racket is installed.
|
||||
E.g. C:\Program Files (x86)\Racket
|
||||
DYNAMIC_MZSCHEME: Whether dynamic linking is used. Usually, set to yes.
|
||||
MZSCHEME_VER: Racket DLL version. E.g. 3m_9z0ds0 for Racket 6.3.
|
||||
MZSCHEME_VER: Racket DLL version which is used for the file name.
|
||||
E.g. 3m_9z0ds0 for Racket 6.3.
|
||||
The DLL can be found under the lib directory. E.g.
|
||||
C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
|
||||
MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at
|
||||
runtime. Default: $(MZSCHEME)\collects
|
||||
User can override this with the PLTCOLLECTS environment
|
||||
|
||||
@@ -76,6 +76,10 @@ endif
|
||||
# Set to yes to enable terminal support.
|
||||
TERMINAL=no
|
||||
|
||||
ifndef CTAGS
|
||||
# this assumes ctags is Exuberant ctags
|
||||
CTAGS = ctags -I INIT+ --fields=+S
|
||||
endif
|
||||
|
||||
# Link against the shared version of libstdc++ by default. Set
|
||||
# STATIC_STDCPLUS to "yes" to link against static version instead.
|
||||
@@ -217,6 +221,8 @@ endif
|
||||
# MZSCHEME=[Path to MzScheme directory] (Set inside Make_cyg.mak or Make_ming.mak)
|
||||
# DYNAMIC_MZSCHEME=yes (to load the MzScheme DLL dynamically)
|
||||
# MZSCHEME_VER=[MzScheme version] (default is 3m_a0solc (6.6))
|
||||
# Used for the DLL file name. E.g.:
|
||||
# C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
|
||||
# MZSCHEME_DEBUG=no
|
||||
ifdef MZSCHEME
|
||||
ifndef DYNAMIC_MZSCHEME
|
||||
@@ -340,6 +346,7 @@ endif
|
||||
# TCL_VER=[TCL version, eg 83, 84] (default is 86)
|
||||
# TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.6)
|
||||
# You must set TCL_VER_LONG when you set TCL_VER.
|
||||
# TCL_DLL=[TCL dll name, eg tcl86.dll] (default is tcl86.dll)
|
||||
ifdef TCL
|
||||
ifndef DYNAMIC_TCL
|
||||
DYNAMIC_TCL=yes
|
||||
@@ -350,6 +357,9 @@ endif
|
||||
ifndef TCL_VER_LONG
|
||||
TCL_VER_LONG = 8.6
|
||||
endif
|
||||
ifndef TCL_DLL
|
||||
TCL_DLL = tcl$(TCL_VER).dll
|
||||
endif
|
||||
TCLINC += -I$(TCL)/include
|
||||
endif
|
||||
|
||||
@@ -526,7 +536,7 @@ endif
|
||||
ifdef TCL
|
||||
CFLAGS += -DFEAT_TCL $(TCLINC)
|
||||
ifeq (yes, $(DYNAMIC_TCL))
|
||||
CFLAGS += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\" -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
|
||||
CFLAGS += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -881,6 +891,12 @@ xxd/xxd.exe: xxd/xxd.c
|
||||
GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
|
||||
$(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE) CXX='$(CXX)' STATIC_STDCPLUS=$(STATIC_STDCPLUS)
|
||||
|
||||
tags: notags
|
||||
$(CTAGS) *.c *.cpp *.h if_perl.xs
|
||||
|
||||
notags:
|
||||
-$(DEL) tags
|
||||
|
||||
clean:
|
||||
-$(DEL) $(OUTDIR)$(DIRSLASH)*.o
|
||||
-$(DEL) $(OUTDIR)$(DIRSLASH)*.res
|
||||
@@ -971,7 +987,11 @@ $(OUTDIR)/terminal.o: terminal.c $(INCL) $(TERM_DEPS)
|
||||
$(CC) -c $(CFLAGS) terminal.c -o $(OUTDIR)/terminal.o
|
||||
|
||||
|
||||
CCCTERM = $(CC) -c $(CFLAGS) -Ilibvterm/include -DINLINE="" -DVSNPRINTF=vim_vsnprintf
|
||||
CCCTERM = $(CC) -c $(CFLAGS) -Ilibvterm/include -DINLINE="" \
|
||||
-DVSNPRINTF=vim_vsnprintf \
|
||||
-DIS_COMBINING_FUNCTION=utf_iscomposing_uint \
|
||||
-DWCWIDTH_FUNCTION=utf_uint2cells
|
||||
|
||||
$(OUTDIR)/term_encoding.o: libvterm/src/encoding.c $(TERM_DEPS)
|
||||
$(CCCTERM) libvterm/src/encoding.c -o $@
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
# This will build the console version of Vim with no additional interfaces.
|
||||
# To add features, define any of the following:
|
||||
#
|
||||
# For MSVC 11 you need to specify where the Win32.mak file is, e.g.:
|
||||
# For MSVC 11, if you want to include Win32.mak, you need to specify
|
||||
# where the file is, e.g.:
|
||||
# SDK_INCLUDE_DIR="C:\Program Files\Microsoft SDKs\Windows\v7.1\Include"
|
||||
#
|
||||
# !!!! After changing features do "nmake clean" first !!!!
|
||||
@@ -46,7 +47,9 @@
|
||||
# MzScheme interface:
|
||||
# MZSCHEME=[Path to MzScheme directory]
|
||||
# DYNAMIC_MZSCHEME=yes (to load the MzScheme DLLs dynamically)
|
||||
# MZSCHEME_VER=[version, 205_000, ...] (default is 3m_a0solc (6.6))
|
||||
# MZSCHEME_VER=[MzScheme version] (default is 3m_a0solc (6.6))
|
||||
# Used for the DLL file name. E.g.:
|
||||
# C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
|
||||
# MZSCHEME_DEBUG=no
|
||||
#
|
||||
# Perl interface:
|
||||
@@ -83,6 +86,7 @@
|
||||
# TCL_VER=[Tcl version, e.g. 80, 83] (default is 86)
|
||||
# TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.6)
|
||||
# You must set TCL_VER_LONG when you set TCL_VER.
|
||||
# TCL_DLL=[Tcl dll name, e.g. tcl86.dll] (default is tcl86.dll)
|
||||
#
|
||||
# Cscope support: CSCOPE=yes
|
||||
#
|
||||
@@ -212,7 +216,7 @@ OBJDIR = $(OBJDIR)Z
|
||||
OBJDIR = $(OBJDIR)d
|
||||
!endif
|
||||
|
||||
# Win32.mak requires that CPU be set appropriately.
|
||||
# If you include Win32.mak, it requires that CPU be set appropriately.
|
||||
# To cross-compile for Win64, set CPU=AMD64 or CPU=IA64.
|
||||
|
||||
!ifdef PROCESSOR_ARCHITECTURE
|
||||
@@ -253,12 +257,15 @@ MAKEFLAGS_GVIMEXT = DEBUG=yes
|
||||
!endif
|
||||
|
||||
|
||||
# Get all sorts of useful, standard macros from the Platform SDK.
|
||||
# Get all sorts of useful, standard macros from the Platform SDK,
|
||||
# if SDK_INCLUDE_DIR is set or USE_WIN32MAK is set to "yes".
|
||||
|
||||
!ifdef SDK_INCLUDE_DIR
|
||||
!include $(SDK_INCLUDE_DIR)\Win32.mak
|
||||
!else
|
||||
!elseif "$(USE_WIN32MAK)"=="yes"
|
||||
!include <Win32.mak>
|
||||
!else
|
||||
link = link
|
||||
!endif
|
||||
|
||||
|
||||
@@ -339,7 +346,8 @@ FEATURES = HUGE
|
||||
!endif
|
||||
|
||||
!ifndef CTAGS
|
||||
CTAGS = ctags
|
||||
# this assumes ctags is Exuberant ctags
|
||||
CTAGS = ctags -I INIT+ --fields=+S
|
||||
!endif
|
||||
|
||||
!ifndef CSCOPE
|
||||
@@ -828,7 +836,9 @@ TCL_VER_LONG = 8.6
|
||||
!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
|
||||
!if "$(DYNAMIC_TCL)" == "yes"
|
||||
!message Tcl DLL will be loaded dynamically
|
||||
!ifndef TCL_DLL
|
||||
TCL_DLL = tcl$(TCL_VER).dll
|
||||
!endif
|
||||
CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" \
|
||||
-DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
|
||||
TCL_OBJ = $(OUTDIR)\if_tcl.obj
|
||||
@@ -1213,7 +1223,7 @@ GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
|
||||
|
||||
|
||||
tags: notags
|
||||
$(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
|
||||
$(CTAGS) *.c *.cpp *.h if_perl.xs
|
||||
|
||||
notags:
|
||||
- if exist tags del tags
|
||||
@@ -1470,7 +1480,12 @@ $(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
|
||||
$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
|
||||
|
||||
|
||||
CCCTERM = $(CC) $(CFLAGS) -Ilibvterm/include -DINLINE="" -DVSNPRINTF=vim_vsnprintf -D_CRT_SECURE_NO_WARNINGS
|
||||
CCCTERM = $(CC) $(CFLAGS) -Ilibvterm/include -DINLINE="" \
|
||||
-DVSNPRINTF=vim_vsnprintf \
|
||||
-DIS_COMBINING_FUNCTION=utf_iscomposing_uint \
|
||||
-DWCWIDTH_FUNCTION=utf_uint2cells \
|
||||
-D_CRT_SECURE_NO_WARNINGS
|
||||
|
||||
$(OUTDIR)/term_encoding.obj: $(OUTDIR) libvterm/src/encoding.c $(TERM_DEPS)
|
||||
$(CCCTERM) -Fo$@ libvterm/src/encoding.c
|
||||
|
||||
|
||||
34
src/Makefile
34
src/Makefile
@@ -2100,17 +2100,17 @@ test1 \
|
||||
test_listchars \
|
||||
test_search_mbyte \
|
||||
test_wordcount \
|
||||
test3 test4 test5 test6 test7 test8 test9 \
|
||||
test11 test12 test14 test15 test17 test18 test19 \
|
||||
test20 test21 test22 test25 test27 test28 test29 \
|
||||
test3 test4 test5 test7 test8 \
|
||||
test11 test12 test14 test15 test17 test19 \
|
||||
test20 test25 test28 test29 \
|
||||
test30 test31 test32 test33 test34 test36 test37 test38 test39 \
|
||||
test40 test41 test42 test43 test44 test45 test48 test49 \
|
||||
test50 test51 test52 test53 test54 test55 test56 test57 test59 \
|
||||
test50 test52 test53 test54 test55 test56 test57 test59 \
|
||||
test60 test64 test66 test68 test69 \
|
||||
test70 test72 test73 test74 test77 test78 test79 \
|
||||
test80 test83 test84 test85 test86 test87 test88 \
|
||||
test91 test94 test95 test98 test99 \
|
||||
test100 test101 test103 test104 test107 test108:
|
||||
test70 test72 test73 test77 test78 test79 \
|
||||
test83 test85 test86 test87 test88 \
|
||||
test94 test95 test99 \
|
||||
test108:
|
||||
cd testdir; rm -f $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
|
||||
|
||||
# Run individual NEW style test, assuming that Vim was already compiled.
|
||||
@@ -2122,6 +2122,7 @@ test_arglist \
|
||||
test_autocmd \
|
||||
test_backspace_opt \
|
||||
test_breakindent \
|
||||
test_bufline \
|
||||
test_bufwintabinfo \
|
||||
test_cd \
|
||||
test_cdo \
|
||||
@@ -2137,6 +2138,7 @@ test_arglist \
|
||||
test_crypt \
|
||||
test_cscope \
|
||||
test_cursor_func \
|
||||
test_curswant \
|
||||
test_delete \
|
||||
test_diffmode \
|
||||
test_digraph \
|
||||
@@ -2155,6 +2157,7 @@ test_arglist \
|
||||
test_farsi \
|
||||
test_feedkeys \
|
||||
test_file_perm \
|
||||
test_file_size \
|
||||
test_fileformat \
|
||||
test_filetype \
|
||||
test_filter_cmd \
|
||||
@@ -2167,6 +2170,7 @@ test_arglist \
|
||||
test_functions \
|
||||
test_ga \
|
||||
test_getcwd \
|
||||
test_getvar \
|
||||
test_gf \
|
||||
test_glob2regpat \
|
||||
test_global \
|
||||
@@ -2178,6 +2182,7 @@ test_arglist \
|
||||
test_help \
|
||||
test_help_tagjump \
|
||||
test_hide \
|
||||
test_highlight \
|
||||
test_history \
|
||||
test_hlsearch \
|
||||
test_increment \
|
||||
@@ -2189,6 +2194,8 @@ test_arglist \
|
||||
test_lambda \
|
||||
test_langmap \
|
||||
test_largefile \
|
||||
test_let \
|
||||
test_lineending \
|
||||
test_lispwords \
|
||||
test_listlbr \
|
||||
test_listlbr_utf8 \
|
||||
@@ -2233,6 +2240,7 @@ test_arglist \
|
||||
test_reltime \
|
||||
test_retab \
|
||||
test_ruby \
|
||||
test_scrollbind \
|
||||
test_search \
|
||||
test_searchpos \
|
||||
test_set \
|
||||
@@ -2257,6 +2265,7 @@ test_arglist \
|
||||
test_taglist \
|
||||
test_tcl \
|
||||
test_terminal \
|
||||
test_terminal_fail \
|
||||
test_textobjects \
|
||||
test_timers \
|
||||
test_true_false \
|
||||
@@ -2267,9 +2276,12 @@ test_arglist \
|
||||
test_utf8_comparisons \
|
||||
test_viminfo \
|
||||
test_vimscript \
|
||||
test_virtualedit \
|
||||
test_visual \
|
||||
test_winbar \
|
||||
test_window_cmd \
|
||||
test_window_id \
|
||||
test_windows_home \
|
||||
test_writefile \
|
||||
test_alot_latin \
|
||||
test_alot_utf8 \
|
||||
@@ -3288,7 +3300,11 @@ objects/channel.o: channel.c
|
||||
Makefile:
|
||||
@echo The name of the makefile MUST be "Makefile" (with capital M)!!!!
|
||||
|
||||
CCCTERM = $(CCC) -Ilibvterm/include -DINLINE="" -DVSNPRINTF=vim_vsnprintf
|
||||
CCCTERM = $(CCC_NF) -Ilibvterm/include $(ALL_CFLAGS) -DINLINE="" \
|
||||
-DVSNPRINTF=vim_vsnprintf \
|
||||
-DIS_COMBINING_FUNCTION=utf_iscomposing_uint \
|
||||
-DWCWIDTH_FUNCTION=utf_uint2cells
|
||||
|
||||
objects/term_encoding.o: libvterm/src/encoding.c $(TERM_DEPS)
|
||||
$(CCCTERM) -o $@ libvterm/src/encoding.c
|
||||
|
||||
|
||||
27
src/auto/configure
vendored
27
src/auto/configure
vendored
@@ -5717,9 +5717,10 @@ $as_echo "OK" >&6; }
|
||||
fi
|
||||
done
|
||||
|
||||
perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
|
||||
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[^ ]*//' \
|
||||
-e 's/-fdebug-prefix-map[^ ]*//g'`
|
||||
perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
|
||||
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[^ ]*//' \
|
||||
-e 's/-fdebug-prefix-map[^ ]*//g' \
|
||||
-e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=.//g'`
|
||||
perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \
|
||||
sed -e '/Warning/d' -e '/Note (probably harmless)/d' \
|
||||
-e 's/-bE:perl.exp//' -e 's/-lc //'`
|
||||
@@ -7473,20 +7474,34 @@ $as_echo_n "checking --enable-terminal argument... " >&6; }
|
||||
# Check whether --enable-terminal was given.
|
||||
if test "${enable_terminal+set}" = set; then :
|
||||
enableval=$enable_terminal; enable_terminal="yes"
|
||||
else
|
||||
enable_terminal="auto"
|
||||
fi
|
||||
|
||||
if test "$enable_terminal" = "yes"; then
|
||||
if test "$enable_terminal" = "yes" || test "$enable_terminal" = "auto" -a "x$features" = "xhuge" ; then
|
||||
if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use terminal emulator with tiny or small features" >&5
|
||||
$as_echo "cannot use terminal emulator with tiny or small features" >&6; }
|
||||
enable_terminal="no"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
if test "$enable_terminal" = "auto"; then
|
||||
enable_terminal="yes"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: defaulting to yes" >&5
|
||||
$as_echo "defaulting to yes" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
fi
|
||||
fi
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
if test "$enable_terminal" = "auto"; then
|
||||
enable_terminal="no"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: defaulting to no" >&5
|
||||
$as_echo "defaulting to no" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
fi
|
||||
if test "$enable_terminal" = "yes"; then
|
||||
$as_echo "#define FEAT_TERMINAL 1" >>confdefs.h
|
||||
|
||||
272
src/buffer.c
272
src/buffer.c
@@ -59,7 +59,7 @@ static void clear_wininfo(buf_T *buf);
|
||||
static void insert_sign(buf_T *buf, signlist_T *prev, signlist_T *next, int id, linenr_T lnum, int typenr);
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
|
||||
#if defined(FEAT_QUICKFIX)
|
||||
static char *msg_loclist = N_("[Location List]");
|
||||
static char *msg_qflist = N_("[Quickfix List]");
|
||||
#endif
|
||||
@@ -458,11 +458,9 @@ close_buffer(
|
||||
int is_curbuf;
|
||||
int nwindows;
|
||||
bufref_T bufref;
|
||||
# ifdef FEAT_WINDOWS
|
||||
int is_curwin = (curwin != NULL && curwin->w_buffer == buf);
|
||||
win_T *the_curwin = curwin;
|
||||
tabpage_T *the_curtab = curtab;
|
||||
# endif
|
||||
#endif
|
||||
int unload_buf = (action != 0);
|
||||
int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
|
||||
@@ -487,6 +485,31 @@ close_buffer(
|
||||
else if (buf->b_p_bh[0] == 'u') /* 'bufhidden' == "unload" */
|
||||
unload_buf = TRUE;
|
||||
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (bt_terminal(buf) && (buf->b_nwindows == 1 || del_buf))
|
||||
{
|
||||
if (term_job_running(buf->b_term))
|
||||
{
|
||||
if (wipe_buf || unload_buf)
|
||||
/* Wiping out or unloading a terminal buffer kills the job. */
|
||||
free_terminal(buf);
|
||||
else
|
||||
{
|
||||
/* The job keeps running, hide the buffer. */
|
||||
del_buf = FALSE;
|
||||
unload_buf = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* A terminal buffer is wiped out if the job has finished. */
|
||||
del_buf = TRUE;
|
||||
unload_buf = TRUE;
|
||||
wipe_buf = TRUE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* Disallow deleting the buffer when it is locked (already being closed or
|
||||
* halfway a command that relies on it). Unloading is allowed. */
|
||||
@@ -497,11 +520,8 @@ close_buffer(
|
||||
}
|
||||
#endif
|
||||
|
||||
if (win != NULL
|
||||
#ifdef FEAT_WINDOWS
|
||||
&& win_valid_any_tab(win) /* in case autocommands closed the window */
|
||||
#endif
|
||||
)
|
||||
/* check no autocommands closed the window */
|
||||
if (win != NULL && win_valid_any_tab(win))
|
||||
{
|
||||
/* Set b_last_cursor when closing the last window for the buffer.
|
||||
* Remember the last cursor position and window options of the buffer.
|
||||
@@ -556,7 +576,6 @@ aucmd_abort:
|
||||
# endif
|
||||
}
|
||||
|
||||
# ifdef FEAT_WINDOWS
|
||||
/* If the buffer was in curwin and the window has changed, go back to that
|
||||
* window, if it still exists. This avoids that ":edit x" triggering a
|
||||
* "tabnext" BufUnload autocmd leaves a window behind without a buffer. */
|
||||
@@ -566,7 +585,6 @@ aucmd_abort:
|
||||
goto_tabpage_win(the_curtab, the_curwin);
|
||||
unblock_autocmds();
|
||||
}
|
||||
# endif
|
||||
|
||||
nwindows = buf->b_nwindows;
|
||||
#endif
|
||||
@@ -625,13 +643,7 @@ aucmd_abort:
|
||||
if (buf == curbuf && !is_curbuf)
|
||||
return;
|
||||
|
||||
if (
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_valid_any_tab(win) &&
|
||||
#else
|
||||
win != NULL &&
|
||||
#endif
|
||||
win->w_buffer == buf)
|
||||
if (win_valid_any_tab(win) && win->w_buffer == buf)
|
||||
win->w_buffer = NULL; /* make sure we don't use the buffer now */
|
||||
|
||||
/* Autocommands may have opened or closed windows for this buffer.
|
||||
@@ -721,11 +733,9 @@ buf_freeall(buf_T *buf, int flags)
|
||||
#ifdef FEAT_AUTOCMD
|
||||
int is_curbuf = (buf == curbuf);
|
||||
bufref_T bufref;
|
||||
# ifdef FEAT_WINDOWS
|
||||
int is_curwin = (curwin != NULL && curwin->w_buffer == buf);
|
||||
win_T *the_curwin = curwin;
|
||||
tabpage_T *the_curtab = curtab;
|
||||
# endif
|
||||
|
||||
/* Make sure the buffer isn't closed by autocommands. */
|
||||
++buf->b_locked;
|
||||
@@ -756,7 +766,6 @@ buf_freeall(buf_T *buf, int flags)
|
||||
}
|
||||
--buf->b_locked;
|
||||
|
||||
# ifdef FEAT_WINDOWS
|
||||
/* If the buffer was in curwin and the window has changed, go back to that
|
||||
* window, if it still exists. This avoids that ":edit x" triggering a
|
||||
* "tabnext" BufUnload autocmd leaves a window behind without a buffer. */
|
||||
@@ -766,7 +775,6 @@ buf_freeall(buf_T *buf, int flags)
|
||||
goto_tabpage_win(the_curtab, the_curwin);
|
||||
unblock_autocmds();
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef FEAT_EVAL
|
||||
if (aborting()) /* autocmds may abort script processing */
|
||||
@@ -793,7 +801,6 @@ buf_freeall(buf_T *buf, int flags)
|
||||
|
||||
#ifdef FEAT_FOLDING
|
||||
/* No folds in an empty buffer. */
|
||||
# ifdef FEAT_WINDOWS
|
||||
{
|
||||
win_T *win;
|
||||
tabpage_T *tp;
|
||||
@@ -802,10 +809,6 @@ buf_freeall(buf_T *buf, int flags)
|
||||
if (win->w_buffer == buf)
|
||||
clearFolding(win);
|
||||
}
|
||||
# else
|
||||
if (curwin != NULL && curwin->w_buffer == buf)
|
||||
clearFolding(curwin);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_TCL
|
||||
@@ -976,7 +979,7 @@ goto_buffer(
|
||||
int dir,
|
||||
int count)
|
||||
{
|
||||
# if defined(FEAT_WINDOWS) && defined(HAS_SWAP_EXISTS_ACTION)
|
||||
# if defined(HAS_SWAP_EXISTS_ACTION)
|
||||
bufref_T old_curbuf;
|
||||
|
||||
set_bufref(&old_curbuf, curbuf);
|
||||
@@ -985,7 +988,7 @@ goto_buffer(
|
||||
# endif
|
||||
(void)do_buffer(*eap->cmd == 's' ? DOBUF_SPLIT : DOBUF_GOTO,
|
||||
start, dir, count, eap->forceit);
|
||||
# if defined(FEAT_WINDOWS) && defined(HAS_SWAP_EXISTS_ACTION)
|
||||
# if defined(HAS_SWAP_EXISTS_ACTION)
|
||||
if (swap_exists_action == SEA_QUIT && *eap->cmd == 's')
|
||||
{
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
@@ -1244,11 +1247,9 @@ empty_curbuf(
|
||||
}
|
||||
|
||||
set_bufref(&bufref, buf);
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (close_others)
|
||||
/* Close any other windows on this buffer, then make it empty. */
|
||||
close_windows(buf, TRUE);
|
||||
#endif
|
||||
|
||||
setpcmark();
|
||||
retval = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE,
|
||||
@@ -1385,11 +1386,9 @@ do_buffer(
|
||||
if (unload)
|
||||
{
|
||||
int forward;
|
||||
# if defined(FEAT_AUTOCMD) || defined(FEAT_WINDOWS)
|
||||
bufref_T bufref;
|
||||
|
||||
set_bufref(&bufref, buf);
|
||||
# endif
|
||||
|
||||
/* When unloading or deleting a buffer that's already unloaded and
|
||||
* unlisted: fail silently. */
|
||||
@@ -1436,33 +1435,28 @@ do_buffer(
|
||||
if (bp == NULL && buf == curbuf)
|
||||
return empty_curbuf(TRUE, forceit, action);
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* If the deleted buffer is the current one, close the current window
|
||||
* (unless it's the only window). Repeat this so long as we end up in
|
||||
* a window with this buffer.
|
||||
*/
|
||||
while (buf == curbuf
|
||||
# ifdef FEAT_AUTOCMD
|
||||
#ifdef FEAT_AUTOCMD
|
||||
&& !(curwin->w_closing || curwin->w_buffer->b_locked > 0)
|
||||
# endif
|
||||
#endif
|
||||
&& (!ONE_WINDOW || first_tabpage->tp_next != NULL))
|
||||
{
|
||||
if (win_close(curwin, FALSE) == FAIL)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If the buffer to be deleted is not the current one, delete it here.
|
||||
*/
|
||||
if (buf != curbuf)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
close_windows(buf, FALSE);
|
||||
if (buf != curbuf && bufref_valid(&bufref))
|
||||
#endif
|
||||
if (buf->b_nwindows <= 0)
|
||||
if (buf != curbuf && bufref_valid(&bufref) && buf->b_nwindows <= 0)
|
||||
close_buffer(NULL, buf, action, FALSE);
|
||||
return OK;
|
||||
}
|
||||
@@ -1581,7 +1575,6 @@ do_buffer(
|
||||
*/
|
||||
if (action == DOBUF_SPLIT) /* split window first */
|
||||
{
|
||||
# ifdef FEAT_WINDOWS
|
||||
/* If 'switchbuf' contains "useopen": jump to first window containing
|
||||
* "buf" if one exists */
|
||||
if ((swb_flags & SWB_USEOPEN) && buf_jump_open_win(buf))
|
||||
@@ -1591,7 +1584,6 @@ do_buffer(
|
||||
if ((swb_flags & SWB_USETAB) && buf_jump_open_tab(buf))
|
||||
return OK;
|
||||
if (win_split(0, 0) == FAIL)
|
||||
# endif
|
||||
return FAIL;
|
||||
}
|
||||
#endif
|
||||
@@ -1623,7 +1615,7 @@ do_buffer(
|
||||
if (bufIsChanged(curbuf))
|
||||
#endif
|
||||
{
|
||||
EMSG(_(e_nowrtmsg));
|
||||
no_write_message();
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
@@ -1694,30 +1686,24 @@ set_curbuf(buf_T *buf, int action)
|
||||
if (prevbuf == curwin->w_buffer)
|
||||
reset_synblock(curwin);
|
||||
#endif
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (unload)
|
||||
close_windows(prevbuf, FALSE);
|
||||
#endif
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
if (bufref_valid(&bufref) && !aborting())
|
||||
#else
|
||||
if (bufref_valid(&bufref))
|
||||
#endif
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *previouswin = curwin;
|
||||
#endif
|
||||
if (prevbuf == curbuf)
|
||||
u_sync(FALSE);
|
||||
close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf,
|
||||
unload ? action : (action == DOBUF_GOTO
|
||||
&& !P_HID(prevbuf)
|
||||
&& !buf_hide(prevbuf)
|
||||
&& !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE);
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (curwin != previouswin && win_valid(previouswin))
|
||||
/* autocommands changed curwin, Grr! */
|
||||
curwin = previouswin;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef FEAT_AUTOCMD
|
||||
@@ -1726,12 +1712,9 @@ set_curbuf(buf_T *buf, int action)
|
||||
* If curwin->w_buffer is null, enter_buffer() will make it valid again */
|
||||
if ((buf_valid(buf) && buf != curbuf
|
||||
# ifdef FEAT_EVAL
|
||||
&& !aborting()
|
||||
&& !aborting()
|
||||
# endif
|
||||
# ifdef FEAT_WINDOWS
|
||||
) || curwin->w_buffer == NULL
|
||||
# endif
|
||||
)
|
||||
) || curwin->w_buffer == NULL)
|
||||
#endif
|
||||
{
|
||||
enter_buffer(buf);
|
||||
@@ -1872,6 +1855,28 @@ do_autochdir(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
no_write_message(void)
|
||||
{
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (term_job_running(curbuf->b_term))
|
||||
EMSG(_("E948: Job still running (add ! to end the job)"));
|
||||
else
|
||||
#endif
|
||||
EMSG(_("E37: No write since last change (add ! to override)"));
|
||||
}
|
||||
|
||||
void
|
||||
no_write_message_nobang(void)
|
||||
{
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (term_job_running(curbuf->b_term))
|
||||
EMSG(_("E948: Job still running"));
|
||||
else
|
||||
#endif
|
||||
EMSG(_("E37: No write since last change"));
|
||||
}
|
||||
|
||||
/*
|
||||
* functions for dealing with the buffer list
|
||||
*/
|
||||
@@ -2280,9 +2285,7 @@ buflist_getfile(
|
||||
int forceit)
|
||||
{
|
||||
buf_T *buf;
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp = NULL;
|
||||
#endif
|
||||
pos_T *fpos;
|
||||
colnr_T col;
|
||||
|
||||
@@ -2320,7 +2323,6 @@ buflist_getfile(
|
||||
else
|
||||
col = 0;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (options & GETF_SWITCH)
|
||||
{
|
||||
/* If 'switchbuf' contains "useopen": jump to first window containing
|
||||
@@ -2346,7 +2348,6 @@ buflist_getfile(
|
||||
RESET_BINDING(curwin);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
++RedrawingDisabled;
|
||||
if (GETFILE_SUCCESS(getfile(buf->b_fnum, NULL, NULL,
|
||||
@@ -2551,7 +2552,6 @@ buflist_findpat(
|
||||
{
|
||||
/* Ignore the match if the buffer is not open in
|
||||
* the current tab. */
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
@@ -2559,10 +2559,6 @@ buflist_findpat(
|
||||
break;
|
||||
if (wp == NULL)
|
||||
continue;
|
||||
#else
|
||||
if (curwin->w_buffer != buf)
|
||||
continue;
|
||||
#endif
|
||||
}
|
||||
if (match >= 0) /* already found a match */
|
||||
{
|
||||
@@ -3009,6 +3005,8 @@ buflist_list(exarg_T *eap)
|
||||
buf_T *buf;
|
||||
int len;
|
||||
int i;
|
||||
int ro_char;
|
||||
int changed_char;
|
||||
|
||||
for (buf = firstbuf; buf != NULL && !got_int; buf = buf->b_next)
|
||||
{
|
||||
@@ -3035,6 +3033,24 @@ buflist_list(exarg_T *eap)
|
||||
if (message_filtered(NameBuff))
|
||||
continue;
|
||||
|
||||
changed_char = (buf->b_flags & BF_READERR) ? 'x'
|
||||
: (bufIsChanged(buf) ? '+' : ' ');
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (term_job_running(buf->b_term))
|
||||
{
|
||||
if (term_none_open(buf->b_term))
|
||||
ro_char = '?';
|
||||
else
|
||||
ro_char = 'R';
|
||||
changed_char = ' '; /* bufIsChanged() returns TRUE to avoid
|
||||
* closing, but it's not actually changed. */
|
||||
}
|
||||
else if (buf->b_term != NULL)
|
||||
ro_char = 'F';
|
||||
else
|
||||
#endif
|
||||
ro_char = !buf->b_p_ma ? '-' : (buf->b_p_ro ? '=' : ' ');
|
||||
|
||||
msg_putchar('\n');
|
||||
len = vim_snprintf((char *)IObuff, IOSIZE - 20, "%3d%c%c%c%c%c \"%s\"",
|
||||
buf->b_fnum,
|
||||
@@ -3043,9 +3059,8 @@ buflist_list(exarg_T *eap)
|
||||
(curwin->w_alt_fnum == buf->b_fnum ? '#' : ' '),
|
||||
buf->b_ml.ml_mfp == NULL ? ' ' :
|
||||
(buf->b_nwindows == 0 ? 'h' : 'a'),
|
||||
!buf->b_p_ma ? '-' : (buf->b_p_ro ? '=' : ' '),
|
||||
(buf->b_flags & BF_READERR) ? 'x'
|
||||
: (bufIsChanged(buf) ? '+' : ' '),
|
||||
ro_char,
|
||||
changed_char,
|
||||
NameBuff);
|
||||
if (len > IOSIZE - 20)
|
||||
len = IOSIZE - 20;
|
||||
@@ -3229,9 +3244,7 @@ buf_name_changed(buf_T *buf)
|
||||
#ifdef FEAT_TITLE
|
||||
maketitle(); /* set window title */
|
||||
#endif
|
||||
#ifdef FEAT_WINDOWS
|
||||
status_redraw_all(); /* status lines need to be redrawn */
|
||||
#endif
|
||||
fmarks_check_names(buf); /* check named file marks */
|
||||
ml_timestamp(buf); /* reset timestamp */
|
||||
}
|
||||
@@ -3852,8 +3865,8 @@ build_stl_str_hl(
|
||||
char_u *t;
|
||||
int byteval;
|
||||
#ifdef FEAT_EVAL
|
||||
win_T *o_curwin;
|
||||
buf_T *o_curbuf;
|
||||
win_T *save_curwin;
|
||||
buf_T *save_curbuf;
|
||||
#endif
|
||||
int empty_line;
|
||||
colnr_T virtcol;
|
||||
@@ -3895,6 +3908,9 @@ build_stl_str_hl(
|
||||
char_u tmp[TMPLEN];
|
||||
char_u *usefmt = fmt;
|
||||
struct stl_hlrec *sp;
|
||||
int save_must_redraw = must_redraw;
|
||||
int save_redr_type = curwin->w_redr_type;
|
||||
int save_highlight_shcnaged = need_highlight_changed;
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
/*
|
||||
@@ -4204,15 +4220,15 @@ build_stl_str_hl(
|
||||
vim_snprintf((char *)tmp, sizeof(tmp), "%d", curbuf->b_fnum);
|
||||
set_internal_string_var((char_u *)"actual_curbuf", tmp);
|
||||
|
||||
o_curbuf = curbuf;
|
||||
o_curwin = curwin;
|
||||
save_curbuf = curbuf;
|
||||
save_curwin = curwin;
|
||||
curwin = wp;
|
||||
curbuf = wp->w_buffer;
|
||||
|
||||
str = eval_to_string_safe(p, &t, use_sandbox);
|
||||
|
||||
curwin = o_curwin;
|
||||
curbuf = o_curbuf;
|
||||
curwin = save_curwin;
|
||||
curbuf = save_curbuf;
|
||||
do_unlet((char_u *)"g:actual_curbuf", TRUE);
|
||||
|
||||
if (str != NULL && *str != 0)
|
||||
@@ -4356,7 +4372,7 @@ build_stl_str_hl(
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
|
||||
#if defined(FEAT_QUICKFIX)
|
||||
case STL_PREVIEWFLAG:
|
||||
case STL_PREVIEWFLAG_ALT:
|
||||
itemisflag = TRUE;
|
||||
@@ -4667,6 +4683,13 @@ build_stl_str_hl(
|
||||
sp->userhl = 0;
|
||||
}
|
||||
|
||||
/* We do not want redrawing a stausline, ruler, title, etc. to trigger
|
||||
* another redraw, it may cause an endless loop. This happens when a
|
||||
* statusline changes a highlight group. */
|
||||
must_redraw = save_must_redraw;
|
||||
curwin->w_redr_type = save_redr_type;
|
||||
need_highlight_changed = save_highlight_shcnaged;
|
||||
|
||||
return width;
|
||||
}
|
||||
#endif /* FEAT_STL_OPT */
|
||||
@@ -4835,7 +4858,6 @@ alist_name(aentry_T *aep)
|
||||
return bp->b_fname;
|
||||
}
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
/*
|
||||
* do_arg_all(): Open up to 'count' windows, one for each argument.
|
||||
*/
|
||||
@@ -4961,12 +4983,12 @@ do_arg_all(
|
||||
|
||||
if (i == opened_len && !keep_tabs)/* close this window */
|
||||
{
|
||||
if (P_HID(buf) || forceit || buf->b_nwindows > 1
|
||||
if (buf_hide(buf) || forceit || buf->b_nwindows > 1
|
||||
|| !bufIsChanged(buf))
|
||||
{
|
||||
/* If the buffer was changed, and we would like to hide it,
|
||||
* try autowriting. */
|
||||
if (!P_HID(buf) && buf->b_nwindows <= 1
|
||||
if (!buf_hide(buf) && buf->b_nwindows <= 1
|
||||
&& bufIsChanged(buf))
|
||||
{
|
||||
#ifdef FEAT_AUTOCMD
|
||||
@@ -4984,23 +5006,19 @@ do_arg_all(
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* don't close last window */
|
||||
if (ONE_WINDOW
|
||||
&& (first_tabpage->tp_next == NULL || !had_tab))
|
||||
#endif
|
||||
use_firstwin = TRUE;
|
||||
#ifdef FEAT_WINDOWS
|
||||
else
|
||||
{
|
||||
win_close(wp, !P_HID(buf) && !bufIsChanged(buf));
|
||||
# ifdef FEAT_AUTOCMD
|
||||
win_close(wp, !buf_hide(buf) && !bufIsChanged(buf));
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* check if autocommands removed the next window */
|
||||
if (!win_valid(wpnext))
|
||||
wpnext = firstwin; /* start all over... */
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5032,13 +5050,11 @@ do_arg_all(
|
||||
last_curwin = curwin;
|
||||
last_curtab = curtab;
|
||||
win_enter(lastwin, FALSE);
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* ":drop all" should re-use an empty window to avoid "--remote-tab"
|
||||
* leaving an empty tab page when executed locally. */
|
||||
if (keep_tabs && BUFEMPTY() && curbuf->b_nwindows == 1
|
||||
&& curbuf->b_ffname == NULL && !curbuf->b_changed)
|
||||
use_firstwin = TRUE;
|
||||
#endif
|
||||
|
||||
for (i = 0; i < count && i < opened_len && !got_int; ++i)
|
||||
{
|
||||
@@ -5092,7 +5108,7 @@ do_arg_all(
|
||||
}
|
||||
(void)do_ecmd(0, alist_name(&AARGLIST(alist)[i]), NULL, NULL,
|
||||
ECMD_ONE,
|
||||
((P_HID(curwin->w_buffer)
|
||||
((buf_hide(curwin->w_buffer)
|
||||
|| bufIsChanged(curwin->w_buffer)) ? ECMD_HIDE : 0)
|
||||
+ ECMD_OLDBUF, curwin);
|
||||
#ifdef FEAT_AUTOCMD
|
||||
@@ -5149,10 +5165,8 @@ ex_buffer_all(exarg_T *eap)
|
||||
int r;
|
||||
int count; /* Maximum number of windows to open. */
|
||||
int all; /* When TRUE also load inactive buffers. */
|
||||
#ifdef FEAT_WINDOWS
|
||||
int had_tab = cmdmod.tab;
|
||||
tabpage_T *tpnext;
|
||||
#endif
|
||||
|
||||
if (eap->addr_count == 0) /* make as many windows as possible */
|
||||
count = 9999;
|
||||
@@ -5173,25 +5187,20 @@ ex_buffer_all(exarg_T *eap)
|
||||
* Close superfluous windows (two windows for the same buffer).
|
||||
* Also close windows that are not full-width.
|
||||
*/
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (had_tab > 0)
|
||||
goto_tabpage_tp(first_tabpage, TRUE, TRUE);
|
||||
for (;;)
|
||||
{
|
||||
#endif
|
||||
tpnext = curtab->tp_next;
|
||||
for (wp = firstwin; wp != NULL; wp = wpnext)
|
||||
{
|
||||
wpnext = wp->w_next;
|
||||
if ((wp->w_buffer->b_nwindows > 1
|
||||
#ifdef FEAT_WINDOWS
|
||||
|| ((cmdmod.split & WSP_VERT)
|
||||
? wp->w_height + wp->w_status_height < Rows - p_ch
|
||||
- tabline_height()
|
||||
: wp->w_width != Columns)
|
||||
|| (had_tab > 0 && wp != firstwin)
|
||||
#endif
|
||||
) && !ONE_WINDOW
|
||||
|| (had_tab > 0 && wp != firstwin)) && !ONE_WINDOW
|
||||
#ifdef FEAT_AUTOCMD
|
||||
&& !(wp->w_closing || wp->w_buffer->b_locked > 0)
|
||||
#endif
|
||||
@@ -5209,13 +5218,11 @@ ex_buffer_all(exarg_T *eap)
|
||||
++open_wins;
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Without the ":tab" modifier only do the current tab page. */
|
||||
if (had_tab == 0 || tpnext == NULL)
|
||||
break;
|
||||
goto_tabpage_tp(tpnext, TRUE, TRUE);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Go through the buffer list. When a buffer doesn't have a window yet,
|
||||
@@ -5236,7 +5243,6 @@ ex_buffer_all(exarg_T *eap)
|
||||
if ((!all && buf->b_ml.ml_mfp == NULL) || !buf->b_p_bl)
|
||||
continue;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (had_tab != 0)
|
||||
{
|
||||
/* With the ":tab" modifier don't move the window. */
|
||||
@@ -5246,7 +5252,6 @@ ex_buffer_all(exarg_T *eap)
|
||||
wp = NULL;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* Check if this buffer already has a window */
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
@@ -5328,11 +5333,9 @@ ex_buffer_all(exarg_T *eap)
|
||||
if (aborting())
|
||||
break;
|
||||
#endif
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* When ":tab" was used open a new tab for a new window repeatedly. */
|
||||
if (had_tab > 0 && tabpage_index(NULL) <= p_tpm)
|
||||
cmdmod.tab = 9999;
|
||||
#endif
|
||||
}
|
||||
#ifdef FEAT_AUTOCMD
|
||||
--autocmd_no_enter;
|
||||
@@ -5347,7 +5350,7 @@ ex_buffer_all(exarg_T *eap)
|
||||
*/
|
||||
for (wp = lastwin; open_wins > count; )
|
||||
{
|
||||
r = (P_HID(wp->w_buffer) || !bufIsChanged(wp->w_buffer)
|
||||
r = (buf_hide(wp->w_buffer) || !bufIsChanged(wp->w_buffer)
|
||||
|| autowrite(wp->w_buffer, FALSE) == OK);
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (!win_valid(wp))
|
||||
@@ -5359,7 +5362,7 @@ ex_buffer_all(exarg_T *eap)
|
||||
#endif
|
||||
if (r)
|
||||
{
|
||||
win_close(wp, !P_HID(wp->w_buffer));
|
||||
win_close(wp, !buf_hide(wp->w_buffer));
|
||||
--open_wins;
|
||||
wp = lastwin;
|
||||
}
|
||||
@@ -5373,7 +5376,6 @@ ex_buffer_all(exarg_T *eap)
|
||||
}
|
||||
# endif /* FEAT_LISTCMDS */
|
||||
|
||||
#endif /* FEAT_WINDOWS */
|
||||
|
||||
static int chk_modeline(linenr_T, int);
|
||||
|
||||
@@ -5600,10 +5602,8 @@ read_viminfo_bufferlist(
|
||||
write_viminfo_bufferlist(FILE *fp)
|
||||
{
|
||||
buf_T *buf;
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *win;
|
||||
tabpage_T *tp;
|
||||
#endif
|
||||
char_u *line;
|
||||
int max_buffers;
|
||||
|
||||
@@ -5619,12 +5619,8 @@ write_viminfo_bufferlist(FILE *fp)
|
||||
if (line == NULL)
|
||||
return;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
FOR_ALL_TAB_WINDOWS(tp, win)
|
||||
set_last_cursor(win);
|
||||
#else
|
||||
set_last_cursor(curwin);
|
||||
#endif
|
||||
|
||||
fputs(_("\n# Buffer list:\n"), fp);
|
||||
FOR_ALL_BUFFERS(buf)
|
||||
@@ -5633,6 +5629,9 @@ write_viminfo_bufferlist(FILE *fp)
|
||||
|| !buf->b_p_bl
|
||||
#ifdef FEAT_QUICKFIX
|
||||
|| bt_quickfix(buf)
|
||||
#endif
|
||||
#ifdef FEAT_TERMINAL
|
||||
|| bt_terminal(buf)
|
||||
#endif
|
||||
|| removable(buf->b_ffname))
|
||||
continue;
|
||||
@@ -5734,7 +5733,7 @@ buf_hide(buf_T *buf)
|
||||
char_u *
|
||||
buf_spname(buf_T *buf)
|
||||
{
|
||||
#if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)
|
||||
#if defined(FEAT_QUICKFIX)
|
||||
if (bt_quickfix(buf))
|
||||
{
|
||||
win_T *win;
|
||||
@@ -5759,8 +5758,8 @@ buf_spname(buf_T *buf)
|
||||
if (buf->b_term != NULL)
|
||||
return term_get_status_text(buf->b_term);
|
||||
#endif
|
||||
if (buf->b_sfname != NULL)
|
||||
return buf->b_sfname;
|
||||
if (buf->b_fname != NULL)
|
||||
return buf->b_fname;
|
||||
return (char_u *)_("[Scratch]");
|
||||
}
|
||||
|
||||
@@ -5769,9 +5768,50 @@ buf_spname(buf_T *buf)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
|
||||
#if defined(FEAT_JOB_CHANNEL) \
|
||||
|| defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) \
|
||||
|| defined(PROTO)
|
||||
# define SWITCH_TO_WIN
|
||||
|
||||
/*
|
||||
* Find a window that contains "buf" and switch to it.
|
||||
* If there is no such window, use the current window and change "curbuf".
|
||||
* Caller must initialize save_curbuf to NULL.
|
||||
* restore_win_for_buf() MUST be called later!
|
||||
*/
|
||||
void
|
||||
switch_to_win_for_buf(
|
||||
buf_T *buf,
|
||||
win_T **save_curwinp,
|
||||
tabpage_T **save_curtabp,
|
||||
bufref_T *save_curbuf)
|
||||
{
|
||||
win_T *wp;
|
||||
tabpage_T *tp;
|
||||
|
||||
if (find_win_for_buf(buf, &wp, &tp) == FAIL)
|
||||
switch_buffer(save_curbuf, buf);
|
||||
else if (switch_win(save_curwinp, save_curtabp, wp, tp, TRUE) == FAIL)
|
||||
{
|
||||
restore_win(*save_curwinp, *save_curtabp, TRUE);
|
||||
switch_buffer(save_curbuf, buf);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
restore_win_for_buf(
|
||||
win_T *save_curwin,
|
||||
tabpage_T *save_curtab,
|
||||
bufref_T *save_curbuf)
|
||||
{
|
||||
if (save_curbuf->br_buf == NULL)
|
||||
restore_win(save_curwin, save_curtab, TRUE);
|
||||
else
|
||||
restore_buffer(save_curbuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_QUICKFIX) || defined(SWITCH_TO_WIN) || defined(PROTO)
|
||||
/*
|
||||
* Find a window for buffer "buf".
|
||||
* If found OK is returned and "wp" and "tp" are set to the window and tabpage.
|
||||
|
||||
931
src/channel.c
931
src/channel.c
File diff suppressed because it is too large
Load Diff
@@ -1092,10 +1092,7 @@ win_lbr_chartabsize(
|
||||
&& VIM_ISBREAK(c)
|
||||
&& !VIM_ISBREAK((int)s[1])
|
||||
&& wp->w_p_wrap
|
||||
# ifdef FEAT_WINDOWS
|
||||
&& wp->w_width != 0
|
||||
# endif
|
||||
)
|
||||
&& wp->w_width != 0)
|
||||
{
|
||||
/*
|
||||
* Count all characters from first non-blank after a blank up to next
|
||||
@@ -1249,10 +1246,8 @@ in_win_border(win_T *wp, colnr_T vcol)
|
||||
int width1; /* width of first line (after line number) */
|
||||
int width2; /* width of further lines */
|
||||
|
||||
# ifdef FEAT_WINDOWS
|
||||
if (wp->w_width == 0) /* there is no border */
|
||||
return FALSE;
|
||||
# endif
|
||||
width1 = W_WIDTH(wp) - win_col_off(wp);
|
||||
if ((int)vcol < width1 - 1)
|
||||
return FALSE;
|
||||
@@ -1535,6 +1530,22 @@ skipwhite(char_u *q)
|
||||
return p;
|
||||
}
|
||||
|
||||
/*
|
||||
* getwhitecols: return the number of whitespace
|
||||
* columns (bytes) at the start of a given line
|
||||
*/
|
||||
int
|
||||
getwhitecols_curline()
|
||||
{
|
||||
return getwhitecols(ml_get_curline());
|
||||
}
|
||||
|
||||
int
|
||||
getwhitecols(char_u *p)
|
||||
{
|
||||
return skipwhite(p) - p;
|
||||
}
|
||||
|
||||
/*
|
||||
* skip over digits
|
||||
*/
|
||||
@@ -2013,8 +2024,7 @@ hex2nr(int c)
|
||||
return c - '0';
|
||||
}
|
||||
|
||||
#if defined(FEAT_TERMRESPONSE) \
|
||||
|| (defined(FEAT_GUI_GTK) && defined(FEAT_WINDOWS)) || defined(PROTO)
|
||||
#if defined(FEAT_TERMRESPONSE) || defined(FEAT_GUI_GTK) || defined(PROTO)
|
||||
/*
|
||||
* Convert two hex characters to a byte.
|
||||
* Return -1 if one of the characters is not hex.
|
||||
|
||||
@@ -1005,9 +1005,11 @@ if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
|
||||
AC_SUBST(vi_cv_perl_xsubpp)
|
||||
dnl Remove "-fno-something", it breaks using cproto.
|
||||
dnl Remove "-fdebug-prefix-map", it isn't supported by clang.
|
||||
dnl Remove "FORTIFY_SOURCE", it will be defined twice.
|
||||
perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
|
||||
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//' \
|
||||
-e 's/-fdebug-prefix-map[[^ ]]*//g'`
|
||||
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//' \
|
||||
-e 's/-fdebug-prefix-map[[^ ]]*//g' \
|
||||
-e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=.//g'`
|
||||
dnl Remove "-lc", it breaks on FreeBSD when using "-pthread".
|
||||
perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \
|
||||
sed -e '/Warning/d' -e '/Note (probably harmless)/d' \
|
||||
@@ -2031,16 +2033,26 @@ fi
|
||||
AC_MSG_CHECKING(--enable-terminal argument)
|
||||
AC_ARG_ENABLE(terminal,
|
||||
[ --enable-terminal Enable terminal emulation support.],
|
||||
[enable_terminal="yes"], )
|
||||
if test "$enable_terminal" = "yes"; then
|
||||
[enable_terminal="yes"], [enable_terminal="auto"])
|
||||
if test "$enable_terminal" = "yes" || test "$enable_terminal" = "auto" -a "x$features" = "xhuge" ; then
|
||||
if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
|
||||
AC_MSG_RESULT([cannot use terminal emulator with tiny or small features])
|
||||
enable_terminal="no"
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
if test "$enable_terminal" = "auto"; then
|
||||
enable_terminal="yes"
|
||||
AC_MSG_RESULT(defaulting to yes)
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
fi
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test "$enable_terminal" = "auto"; then
|
||||
enable_terminal="no"
|
||||
AC_MSG_RESULT(defaulting to no)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
if test "$enable_terminal" = "yes"; then
|
||||
AC_DEFINE(FEAT_TERMINAL)
|
||||
|
||||
83
src/diff.c
83
src/diff.c
@@ -1660,6 +1660,40 @@ diff_equal_entry(diff_T *dp, int idx1, int idx2)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compare the characters at "p1" and "p2". If they are equal (possibly
|
||||
* ignoring case) return TRUE and set "len" to the number of bytes.
|
||||
*/
|
||||
static int
|
||||
diff_equal_char(char_u *p1, char_u *p2, int *len)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
int l = (*mb_ptr2len)(p1);
|
||||
|
||||
if (l != (*mb_ptr2len)(p2))
|
||||
return FALSE;
|
||||
if (l > 1)
|
||||
{
|
||||
if (STRNCMP(p1, p2, l) != 0
|
||||
&& (!enc_utf8
|
||||
|| !(diff_flags & DIFF_ICASE)
|
||||
|| utf_fold(utf_ptr2char(p1))
|
||||
!= utf_fold(utf_ptr2char(p2))))
|
||||
return FALSE;
|
||||
*len = l;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if ((*p1 != *p2)
|
||||
&& (!(diff_flags & DIFF_ICASE)
|
||||
|| TOLOWER_LOC(*p1) != TOLOWER_LOC(*p2)))
|
||||
return FALSE;
|
||||
*len = 1;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compare strings "s1" and "s2" according to 'diffopt'.
|
||||
* Return non-zero when they are different.
|
||||
@@ -1668,9 +1702,7 @@ diff_equal_entry(diff_T *dp, int idx1, int idx2)
|
||||
diff_cmp(char_u *s1, char_u *s2)
|
||||
{
|
||||
char_u *p1, *p2;
|
||||
#ifdef FEAT_MBYTE
|
||||
int l;
|
||||
#endif
|
||||
|
||||
if ((diff_flags & (DIFF_ICASE | DIFF_IWHITE)) == 0)
|
||||
return STRCMP(s1, s2);
|
||||
@@ -1689,30 +1721,10 @@ diff_cmp(char_u *s1, char_u *s2)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
l = (*mb_ptr2len)(p1);
|
||||
if (l != (*mb_ptr2len)(p2))
|
||||
if (!diff_equal_char(p1, p2, &l))
|
||||
break;
|
||||
if (l > 1)
|
||||
{
|
||||
if (STRNCMP(p1, p2, l) != 0
|
||||
&& (!enc_utf8
|
||||
|| !(diff_flags & DIFF_ICASE)
|
||||
|| utf_fold(utf_ptr2char(p1))
|
||||
!= utf_fold(utf_ptr2char(p2))))
|
||||
break;
|
||||
p1 += l;
|
||||
p2 += l;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (*p1 != *p2 && (!(diff_flags & DIFF_ICASE)
|
||||
|| TOLOWER_LOC(*p1) != TOLOWER_LOC(*p2)))
|
||||
break;
|
||||
++p1;
|
||||
++p2;
|
||||
}
|
||||
p1 += l;
|
||||
p2 += l;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1969,6 +1981,8 @@ diff_find_change(
|
||||
int idx;
|
||||
int off;
|
||||
int added = TRUE;
|
||||
char_u *p1, *p2;
|
||||
int l;
|
||||
|
||||
/* Make a copy of the line, the next ml_get() will invalidate it. */
|
||||
line_org = vim_strsave(ml_get_buf(wp->w_buffer, lnum, FALSE));
|
||||
@@ -2017,10 +2031,11 @@ diff_find_change(
|
||||
}
|
||||
else
|
||||
{
|
||||
if (line_org[si_org] != line_new[si_new])
|
||||
if (!diff_equal_char(line_org + si_org, line_new + si_new,
|
||||
&l))
|
||||
break;
|
||||
++si_org;
|
||||
++si_new;
|
||||
si_org += l;
|
||||
si_new += l;
|
||||
}
|
||||
}
|
||||
#ifdef FEAT_MBYTE
|
||||
@@ -2056,10 +2071,16 @@ diff_find_change(
|
||||
}
|
||||
else
|
||||
{
|
||||
if (line_org[ei_org] != line_new[ei_new])
|
||||
p1 = line_org + ei_org;
|
||||
p2 = line_new + ei_new;
|
||||
#ifdef FEAT_MBYTE
|
||||
p1 -= (*mb_head_off)(line_org, p1);
|
||||
p2 -= (*mb_head_off)(line_new, p2);
|
||||
#endif
|
||||
if (!diff_equal_char(p1, p2, &l))
|
||||
break;
|
||||
--ei_org;
|
||||
--ei_new;
|
||||
ei_org -= l;
|
||||
ei_new -= l;
|
||||
}
|
||||
}
|
||||
if (*endp < ei_org)
|
||||
|
||||
@@ -2426,9 +2426,7 @@ ex_loadkeymap(exarg_T *eap)
|
||||
p_cpo = save_cpo;
|
||||
|
||||
curbuf->b_kmap_state |= KEYMAP_LOADED;
|
||||
#ifdef FEAT_WINDOWS
|
||||
status_redraw_curbuf();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2462,9 +2460,7 @@ keymap_unload(void)
|
||||
|
||||
ga_clear(&curbuf->b_kmap_ga);
|
||||
curbuf->b_kmap_state &= ~KEYMAP_LOADED;
|
||||
#ifdef FEAT_WINDOWS
|
||||
status_redraw_curbuf();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* FEAT_KEYMAP */
|
||||
|
||||
48
src/edit.c
48
src/edit.c
@@ -1360,7 +1360,7 @@ doESCkey:
|
||||
/* FALLTHROUGH */
|
||||
case CAR:
|
||||
case NL:
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
|
||||
#if defined(FEAT_QUICKFIX)
|
||||
/* In a quickfix window a <CR> jumps to the error under the
|
||||
* cursor. */
|
||||
if (bt_quickfix(curbuf) && c == CAR)
|
||||
@@ -4045,22 +4045,16 @@ ins_compl_fixRedoBufForLeader(char_u *ptr_arg)
|
||||
static buf_T *
|
||||
ins_compl_next_buf(buf_T *buf, int flag)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
static win_T *wp;
|
||||
#endif
|
||||
|
||||
if (flag == 'w') /* just windows */
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (buf == curbuf) /* first call for this flag/expansion */
|
||||
wp = curwin;
|
||||
while ((wp = (wp->w_next != NULL ? wp->w_next : firstwin)) != curwin
|
||||
&& wp->w_buffer->b_scanned)
|
||||
;
|
||||
buf = wp->w_buffer;
|
||||
#else
|
||||
buf = curbuf;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
/* 'b' (just loaded buffers), 'u' (just non-loaded buffers) or 'U'
|
||||
@@ -5182,7 +5176,7 @@ ins_complete(int c, int enable_pum)
|
||||
* first non_blank in the line, if it is not a wordchar
|
||||
* include it to get a better pattern, but then we don't
|
||||
* want the "\\<" prefix, check it bellow */
|
||||
compl_col = (colnr_T)(skipwhite(line) - line);
|
||||
compl_col = (colnr_T)getwhitecols(line);
|
||||
compl_startpos.col = compl_col;
|
||||
compl_startpos.lnum = curwin->w_cursor.lnum;
|
||||
compl_cont_status &= ~CONT_SOL; /* clear SOL if present */
|
||||
@@ -5348,7 +5342,7 @@ ins_complete(int c, int enable_pum)
|
||||
}
|
||||
else if (CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode))
|
||||
{
|
||||
compl_col = (colnr_T)(skipwhite(line) - line);
|
||||
compl_col = (colnr_T)getwhitecols(line);
|
||||
compl_length = (int)curs_col - (int)compl_col;
|
||||
if (compl_length < 0) /* cursor in indent: empty pattern */
|
||||
compl_length = 0;
|
||||
@@ -8208,8 +8202,7 @@ in_cinkeys(
|
||||
{
|
||||
/* "0=word": Check if there are only blanks before the
|
||||
* word. */
|
||||
line = ml_get_curline();
|
||||
if ((int)(skipwhite(line) - line) !=
|
||||
if (getwhitecols(line) !=
|
||||
(int)(curwin->w_cursor.col - (p - look)))
|
||||
match = FALSE;
|
||||
}
|
||||
@@ -8541,7 +8534,7 @@ ins_ctrl_hat(void)
|
||||
if (gui.in_use)
|
||||
gui_update_cursor(TRUE, FALSE);
|
||||
#endif
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP)
|
||||
#if defined(FEAT_KEYMAP)
|
||||
/* Show/unshow value of 'keymap' in status lines. */
|
||||
status_redraw_curbuf();
|
||||
#endif
|
||||
@@ -9383,7 +9376,6 @@ ins_mouse(int c)
|
||||
tpos = curwin->w_cursor;
|
||||
if (do_mouse(NULL, c, BACKWARD, 1L, 0))
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *new_curwin = curwin;
|
||||
|
||||
if (curwin != old_curwin && win_valid(old_curwin))
|
||||
@@ -9393,40 +9385,32 @@ ins_mouse(int c)
|
||||
curwin = old_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
}
|
||||
#endif
|
||||
start_arrow(curwin == old_curwin ? &tpos : NULL);
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (curwin != new_curwin && win_valid(new_curwin))
|
||||
{
|
||||
curwin = new_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
}
|
||||
#endif
|
||||
# ifdef FEAT_CINDENT
|
||||
can_cindent = TRUE;
|
||||
# endif
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* redraw status lines (in case another window became active) */
|
||||
redraw_statuslines();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
ins_mousescroll(int dir)
|
||||
{
|
||||
pos_T tpos;
|
||||
# if defined(FEAT_WINDOWS)
|
||||
win_T *old_curwin = curwin;
|
||||
# endif
|
||||
win_T *old_curwin = curwin, *wp;
|
||||
# ifdef FEAT_INS_EXPAND
|
||||
int did_scroll = FALSE;
|
||||
# endif
|
||||
|
||||
tpos = curwin->w_cursor;
|
||||
|
||||
# ifdef FEAT_WINDOWS
|
||||
if (mouse_row >= 0 && mouse_col >= 0)
|
||||
{
|
||||
int row, col;
|
||||
@@ -9435,20 +9419,18 @@ ins_mousescroll(int dir)
|
||||
col = mouse_col;
|
||||
|
||||
/* find the window at the pointer coordinates */
|
||||
curwin = mouse_find_win(&row, &col);
|
||||
wp = mouse_find_win(&row, &col);
|
||||
if (wp == NULL)
|
||||
return;
|
||||
curwin = wp;
|
||||
curbuf = curwin->w_buffer;
|
||||
}
|
||||
if (curwin == old_curwin)
|
||||
# endif
|
||||
undisplay_dollar();
|
||||
|
||||
# ifdef FEAT_INS_EXPAND
|
||||
/* Don't scroll the window in which completion is being done. */
|
||||
if (!pum_visible()
|
||||
# if defined(FEAT_WINDOWS)
|
||||
|| curwin != old_curwin
|
||||
# endif
|
||||
)
|
||||
if (!pum_visible() || curwin != old_curwin)
|
||||
# endif
|
||||
{
|
||||
if (dir == MSCR_DOWN || dir == MSCR_UP)
|
||||
@@ -9477,12 +9459,10 @@ ins_mousescroll(int dir)
|
||||
# endif
|
||||
}
|
||||
|
||||
# ifdef FEAT_WINDOWS
|
||||
curwin->w_redr_status = TRUE;
|
||||
|
||||
curwin = old_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
# endif
|
||||
|
||||
# ifdef FEAT_INS_EXPAND
|
||||
/* The popup menu may overlay the window, need to redraw it.
|
||||
@@ -9680,7 +9660,7 @@ ins_left(
|
||||
#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
|
||||
/* Only call start_arrow() when not busy with preediting, it will
|
||||
* break undo. K_LEFT is inserted in im_correct_cursor(). */
|
||||
if (!im_is_preediting())
|
||||
if (p_imst == IM_OVER_THE_SPOT || !im_is_preediting())
|
||||
#endif
|
||||
{
|
||||
start_arrow_with_change(&tpos, end_change);
|
||||
@@ -9881,7 +9861,6 @@ ins_pageup(void)
|
||||
|
||||
undisplay_dollar();
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (mod_mask & MOD_MASK_CTRL)
|
||||
{
|
||||
/* <C-PageUp>: tab page back */
|
||||
@@ -9892,7 +9871,6 @@ ins_pageup(void)
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
tpos = curwin->w_cursor;
|
||||
if (onepage(BACKWARD, 1L) == OK)
|
||||
@@ -9944,7 +9922,6 @@ ins_pagedown(void)
|
||||
|
||||
undisplay_dollar();
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (mod_mask & MOD_MASK_CTRL)
|
||||
{
|
||||
/* <C-PageDown>: tab page forward */
|
||||
@@ -9955,7 +9932,6 @@ ins_pagedown(void)
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
tpos = curwin->w_cursor;
|
||||
if (onepage(FORWARD, 1L) == OK)
|
||||
|
||||
82
src/eval.c
82
src/eval.c
@@ -187,6 +187,10 @@ static struct vimvar
|
||||
{VV_NAME("t_none", VAR_NUMBER), VV_RO},
|
||||
{VV_NAME("t_job", VAR_NUMBER), VV_RO},
|
||||
{VV_NAME("t_channel", VAR_NUMBER), VV_RO},
|
||||
{VV_NAME("termrgbresp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("termu7resp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("termstyleresp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("termblinkresp", VAR_STRING), VV_RO},
|
||||
};
|
||||
|
||||
/* shorthand */
|
||||
@@ -207,9 +211,7 @@ static char_u *skip_var_one(char_u *arg);
|
||||
static void list_glob_vars(int *first);
|
||||
static void list_buf_vars(int *first);
|
||||
static void list_win_vars(int *first);
|
||||
#ifdef FEAT_WINDOWS
|
||||
static void list_tab_vars(int *first);
|
||||
#endif
|
||||
static void list_vim_vars(int *first);
|
||||
static void list_script_vars(int *first);
|
||||
static char_u *list_arg_vars(exarg_T *eap, char_u *arg, int *first);
|
||||
@@ -1201,9 +1203,7 @@ ex_let(exarg_T *eap)
|
||||
list_glob_vars(&first);
|
||||
list_buf_vars(&first);
|
||||
list_win_vars(&first);
|
||||
#ifdef FEAT_WINDOWS
|
||||
list_tab_vars(&first);
|
||||
#endif
|
||||
list_script_vars(&first);
|
||||
list_func_vars(&first);
|
||||
list_vim_vars(&first);
|
||||
@@ -1465,7 +1465,6 @@ list_win_vars(int *first)
|
||||
(char_u *)"w:", TRUE, first);
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* List tab page variables.
|
||||
*/
|
||||
@@ -1475,7 +1474,6 @@ list_tab_vars(int *first)
|
||||
list_hashtable_vars(&curtab->tp_vars->dv_hashtab,
|
||||
(char_u *)"t:", TRUE, first);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* List Vim variables.
|
||||
@@ -1561,9 +1559,7 @@ list_arg_vars(exarg_T *eap, char_u *arg, int *first)
|
||||
case 'g': list_glob_vars(first); break;
|
||||
case 'b': list_buf_vars(first); break;
|
||||
case 'w': list_win_vars(first); break;
|
||||
#ifdef FEAT_WINDOWS
|
||||
case 't': list_tab_vars(first); break;
|
||||
#endif
|
||||
case 'v': list_vim_vars(first); break;
|
||||
case 's': list_script_vars(first); break;
|
||||
case 'l': list_func_vars(first); break;
|
||||
@@ -3071,9 +3067,7 @@ get_user_var_name(expand_T *xp, int idx)
|
||||
static long_u gdone;
|
||||
static long_u bdone;
|
||||
static long_u wdone;
|
||||
#ifdef FEAT_WINDOWS
|
||||
static long_u tdone;
|
||||
#endif
|
||||
static int vidx;
|
||||
static hashitem_T *hi;
|
||||
hashtab_T *ht;
|
||||
@@ -3081,9 +3075,7 @@ get_user_var_name(expand_T *xp, int idx)
|
||||
if (idx == 0)
|
||||
{
|
||||
gdone = bdone = wdone = vidx = 0;
|
||||
#ifdef FEAT_WINDOWS
|
||||
tdone = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Global variables */
|
||||
@@ -3126,7 +3118,6 @@ get_user_var_name(expand_T *xp, int idx)
|
||||
return cat_prefix_varname('w', hi->hi_key);
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* t: variables */
|
||||
ht = &curtab->tp_vars->dv_hashtab;
|
||||
if (tdone < ht->ht_used)
|
||||
@@ -3139,7 +3130,6 @@ get_user_var_name(expand_T *xp, int idx)
|
||||
++hi;
|
||||
return cat_prefix_varname('t', hi->hi_key);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* v: variables */
|
||||
if (vidx < VV_LEN)
|
||||
@@ -5234,9 +5224,7 @@ garbage_collect(int testing)
|
||||
win_T *wp;
|
||||
int i;
|
||||
int did_free = FALSE;
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp;
|
||||
#endif
|
||||
|
||||
if (!testing)
|
||||
{
|
||||
@@ -5279,13 +5267,10 @@ garbage_collect(int testing)
|
||||
NULL, NULL);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* tabpage-local variables */
|
||||
FOR_ALL_TABPAGES(tp)
|
||||
abort = abort || set_ref_in_item(&tp->tp_winvar.di_tv, copyID,
|
||||
NULL, NULL);
|
||||
#endif
|
||||
|
||||
/* global variables */
|
||||
abort = abort || set_ref_in_ht(&globvarht, copyID, NULL);
|
||||
|
||||
@@ -5683,9 +5668,9 @@ get_var_special_name(int nr)
|
||||
* If the memory is allocated "tofree" is set to it, otherwise NULL.
|
||||
* "numbuf" is used for a number.
|
||||
* When "copyID" is not NULL replace recursive lists and dicts with "...".
|
||||
* When both "echo_style" and "dict_val" are FALSE, put quotes around stings as
|
||||
* "string()", otherwise does not put quotes around strings, as ":echo"
|
||||
* displays values.
|
||||
* When both "echo_style" and "composite_val" are FALSE, put quotes around
|
||||
* stings as "string()", otherwise does not put quotes around strings, as
|
||||
* ":echo" displays values.
|
||||
* When "restore_copyID" is FALSE, repeated items in dictionaries and lists
|
||||
* are replaced with "...".
|
||||
* May return NULL.
|
||||
@@ -5698,7 +5683,7 @@ echo_string_core(
|
||||
int copyID,
|
||||
int echo_style,
|
||||
int restore_copyID,
|
||||
int dict_val)
|
||||
int composite_val)
|
||||
{
|
||||
static int recurse = 0;
|
||||
char_u *r = NULL;
|
||||
@@ -5721,10 +5706,12 @@ echo_string_core(
|
||||
switch (tv->v_type)
|
||||
{
|
||||
case VAR_STRING:
|
||||
if (echo_style && !dict_val)
|
||||
if (echo_style && !composite_val)
|
||||
{
|
||||
*tofree = NULL;
|
||||
r = get_tv_string_buf(tv, numbuf);
|
||||
r = tv->vval.v_string;
|
||||
if (r == NULL)
|
||||
r = (char_u *)"";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5841,10 +5828,19 @@ echo_string_core(
|
||||
|
||||
case VAR_NUMBER:
|
||||
case VAR_UNKNOWN:
|
||||
*tofree = NULL;
|
||||
r = get_tv_string_buf(tv, numbuf);
|
||||
break;
|
||||
|
||||
case VAR_JOB:
|
||||
case VAR_CHANNEL:
|
||||
*tofree = NULL;
|
||||
r = get_tv_string_buf(tv, numbuf);
|
||||
if (composite_val)
|
||||
{
|
||||
*tofree = string_quote(r, FALSE);
|
||||
r = *tofree;
|
||||
}
|
||||
break;
|
||||
|
||||
case VAR_FLOAT:
|
||||
@@ -7374,9 +7370,7 @@ find_var_in_ht(
|
||||
case 'v': return &vimvars_var;
|
||||
case 'b': return &curbuf->b_bufvar;
|
||||
case 'w': return &curwin->w_winvar;
|
||||
#ifdef FEAT_WINDOWS
|
||||
case 't': return &curtab->tp_winvar;
|
||||
#endif
|
||||
case 'l': return get_funccal_local_var();
|
||||
case 'a': return get_funccal_args_var();
|
||||
}
|
||||
@@ -7446,10 +7440,8 @@ find_var_ht(char_u *name, char_u **varname)
|
||||
return &curbuf->b_vars->dv_hashtab;
|
||||
if (*name == 'w') /* window variable */
|
||||
return &curwin->w_vars->dv_hashtab;
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (*name == 't') /* tab page variable */
|
||||
return &curtab->tp_vars->dv_hashtab;
|
||||
#endif
|
||||
if (*name == 'v') /* v: variable */
|
||||
return &vimvarht;
|
||||
if (*name == 'a') /* a: function argument */
|
||||
@@ -8260,13 +8252,7 @@ ex_echo(exarg_T *eap)
|
||||
void
|
||||
ex_echohl(exarg_T *eap)
|
||||
{
|
||||
int id;
|
||||
|
||||
id = syn_name2id(eap->arg);
|
||||
if (id == 0)
|
||||
echo_attr = 0;
|
||||
else
|
||||
echo_attr = syn_id2attr(id);
|
||||
echo_attr = syn_name2attr(eap->arg);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8371,14 +8357,11 @@ find_win_by_nr(
|
||||
typval_T *vp,
|
||||
tabpage_T *tp UNUSED) /* NULL for current tab page */
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
#endif
|
||||
int nr;
|
||||
|
||||
nr = (int)get_tv_number_chk(vp, NULL);
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (nr < 0)
|
||||
return NULL;
|
||||
if (nr == 0)
|
||||
@@ -8397,11 +8380,6 @@ find_win_by_nr(
|
||||
if (nr >= LOWEST_WIN_ID)
|
||||
return NULL;
|
||||
return wp;
|
||||
#else
|
||||
if (nr == 0 || nr == 1 || nr == curwin->w_id)
|
||||
return curwin;
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8450,18 +8428,14 @@ getwinvar(
|
||||
dictitem_T *v;
|
||||
tabpage_T *tp = NULL;
|
||||
int done = FALSE;
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *oldcurwin;
|
||||
tabpage_T *oldtabpage;
|
||||
int need_switch_win;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (off == 1)
|
||||
tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
|
||||
else
|
||||
tp = curtab;
|
||||
#endif
|
||||
win = find_win_by_nr(&argvars[off], tp);
|
||||
varname = get_tv_string_chk(&argvars[off + 1]);
|
||||
++emsg_off;
|
||||
@@ -8471,14 +8445,12 @@ getwinvar(
|
||||
|
||||
if (win != NULL && varname != NULL)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Set curwin to be our win, temporarily. Also set the tabpage,
|
||||
* otherwise the window is not valid. Only do this when needed,
|
||||
* autocommands get blocked. */
|
||||
need_switch_win = !(tp == curtab && win == curwin);
|
||||
if (!need_switch_win
|
||||
|| switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE) == OK)
|
||||
#endif
|
||||
{
|
||||
if (*varname == '&')
|
||||
{
|
||||
@@ -8511,11 +8483,9 @@ getwinvar(
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (need_switch_win)
|
||||
/* restore previous notion of curwin */
|
||||
restore_win(oldcurwin, oldtabpage, TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!done && argvars[off + 2].v_type != VAR_UNKNOWN)
|
||||
@@ -8532,11 +8502,9 @@ getwinvar(
|
||||
setwinvar(typval_T *argvars, typval_T *rettv UNUSED, int off)
|
||||
{
|
||||
win_T *win;
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *save_curwin;
|
||||
tabpage_T *save_curtab;
|
||||
int need_switch_win;
|
||||
#endif
|
||||
char_u *varname, *winvarname;
|
||||
typval_T *varp;
|
||||
char_u nbuf[NUMBUFLEN];
|
||||
@@ -8545,23 +8513,19 @@ setwinvar(typval_T *argvars, typval_T *rettv UNUSED, int off)
|
||||
if (check_restricted() || check_secure())
|
||||
return;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (off == 1)
|
||||
tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
|
||||
else
|
||||
tp = curtab;
|
||||
#endif
|
||||
win = find_win_by_nr(&argvars[off], tp);
|
||||
varname = get_tv_string_chk(&argvars[off + 1]);
|
||||
varp = &argvars[off + 2];
|
||||
|
||||
if (win != NULL && varname != NULL && varp != NULL)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
need_switch_win = !(tp == curtab && win == curwin);
|
||||
if (!need_switch_win
|
||||
|| switch_win(&save_curwin, &save_curtab, win, tp, TRUE) == OK)
|
||||
#endif
|
||||
{
|
||||
if (*varname == '&')
|
||||
{
|
||||
@@ -8587,10 +8551,8 @@ setwinvar(typval_T *argvars, typval_T *rettv UNUSED, int off)
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (need_switch_win)
|
||||
restore_win(save_curwin, save_curtab, TRUE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
378
src/evalfunc.c
378
src/evalfunc.c
@@ -328,6 +328,7 @@ static void f_searchpairpos(typval_T *argvars, typval_T *rettv);
|
||||
static void f_searchpos(typval_T *argvars, typval_T *rettv);
|
||||
static void f_server2client(typval_T *argvars, typval_T *rettv);
|
||||
static void f_serverlist(typval_T *argvars, typval_T *rettv);
|
||||
static void f_setbufline(typval_T *argvars, typval_T *rettv);
|
||||
static void f_setbufvar(typval_T *argvars, typval_T *rettv);
|
||||
static void f_setcharsearch(typval_T *argvars, typval_T *rettv);
|
||||
static void f_setcmdpos(typval_T *argvars, typval_T *rettv);
|
||||
@@ -392,6 +393,7 @@ static void f_tagfiles(typval_T *argvars, typval_T *rettv);
|
||||
static void f_tempname(typval_T *argvars, typval_T *rettv);
|
||||
static void f_test_alloc_fail(typval_T *argvars, typval_T *rettv);
|
||||
static void f_test_autochdir(typval_T *argvars, typval_T *rettv);
|
||||
static void f_test_feedinput(typval_T *argvars, typval_T *rettv);
|
||||
static void f_test_override(typval_T *argvars, typval_T *rettv);
|
||||
static void f_test_garbagecollect_now(typval_T *argvars, typval_T *rettv);
|
||||
static void f_test_ignore_error(typval_T *argvars, typval_T *rettv);
|
||||
@@ -764,6 +766,7 @@ static struct fst
|
||||
{"searchpos", 1, 4, f_searchpos},
|
||||
{"server2client", 2, 2, f_server2client},
|
||||
{"serverlist", 0, 0, f_serverlist},
|
||||
{"setbufline", 3, 3, f_setbufline},
|
||||
{"setbufvar", 3, 3, f_setbufvar},
|
||||
{"setcharsearch", 1, 1, f_setcharsearch},
|
||||
{"setcmdpos", 1, 1, f_setcmdpos},
|
||||
@@ -831,19 +834,25 @@ static struct fst
|
||||
#endif
|
||||
{"tempname", 0, 0, f_tempname},
|
||||
#ifdef FEAT_TERMINAL
|
||||
{"term_getaltscreen", 1, 1, f_term_getaltscreen},
|
||||
{"term_getattr", 2, 2, f_term_getattr},
|
||||
{"term_getcursor", 1, 1, f_term_getcursor},
|
||||
{"term_getjob", 1, 1, f_term_getjob},
|
||||
{"term_getline", 1, 2, f_term_getline},
|
||||
{"term_getline", 2, 2, f_term_getline},
|
||||
{"term_getscrolled", 1, 1, f_term_getscrolled},
|
||||
{"term_getsize", 1, 1, f_term_getsize},
|
||||
{"term_getstatus", 1, 1, f_term_getstatus},
|
||||
{"term_gettitle", 1, 1, f_term_gettitle},
|
||||
{"term_gettty", 1, 2, f_term_gettty},
|
||||
{"term_list", 0, 0, f_term_list},
|
||||
{"term_scrape", 1, 2, f_term_scrape},
|
||||
{"term_scrape", 2, 2, f_term_scrape},
|
||||
{"term_sendkeys", 2, 2, f_term_sendkeys},
|
||||
{"term_start", 1, 2, f_term_start},
|
||||
{"term_wait", 1, 1, f_term_wait},
|
||||
{"term_wait", 1, 2, f_term_wait},
|
||||
#endif
|
||||
{"test_alloc_fail", 3, 3, f_test_alloc_fail},
|
||||
{"test_autochdir", 0, 0, f_test_autochdir},
|
||||
{"test_feedinput", 1, 1, f_test_feedinput},
|
||||
{"test_garbagecollect_now", 0, 0, f_test_garbagecollect_now},
|
||||
{"test_ignore_error", 1, 1, f_test_ignore_error},
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
@@ -1629,16 +1638,13 @@ f_bufnr(typval_T *argvars, typval_T *rettv)
|
||||
static void
|
||||
buf_win_common(typval_T *argvars, typval_T *rettv, int get_nr)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
int winnr = 0;
|
||||
#endif
|
||||
buf_T *buf;
|
||||
|
||||
(void)get_tv_number(&argvars[0]); /* issue errmsg if type error */
|
||||
++emsg_off;
|
||||
buf = get_buf_tv(&argvars[0], TRUE);
|
||||
#ifdef FEAT_WINDOWS
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
{
|
||||
++winnr;
|
||||
@@ -1646,10 +1652,6 @@ buf_win_common(typval_T *argvars, typval_T *rettv, int get_nr)
|
||||
break;
|
||||
}
|
||||
rettv->vval.v_number = (wp != NULL ? (get_nr ? winnr : wp->w_id) : -1);
|
||||
#else
|
||||
rettv->vval.v_number = (curwin->w_buffer == buf
|
||||
? (get_nr ? 1 : curwin->w_id) : -1);
|
||||
#endif
|
||||
--emsg_off;
|
||||
}
|
||||
|
||||
@@ -1927,6 +1929,9 @@ f_ch_logfile(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
char_u *opt = (char_u *)"";
|
||||
char_u buf[NUMBUFLEN];
|
||||
|
||||
/* Don't open a file in restricted mode. */
|
||||
if (check_restricted() || check_secure())
|
||||
return;
|
||||
fname = get_tv_string(&argvars[0]);
|
||||
if (argvars[1].v_type == VAR_STRING)
|
||||
opt = get_tv_string_buf(&argvars[1], buf);
|
||||
@@ -2013,7 +2018,7 @@ f_ch_setoptions(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
return;
|
||||
clear_job_options(&opt);
|
||||
if (get_job_options(&argvars[1], &opt,
|
||||
JO_CB_ALL + JO_TIMEOUT_ALL + JO_MODE_ALL) == OK)
|
||||
JO_CB_ALL + JO_TIMEOUT_ALL + JO_MODE_ALL, 0) == OK)
|
||||
channel_set_options(channel, &opt);
|
||||
free_job_options(&opt);
|
||||
}
|
||||
@@ -2037,7 +2042,7 @@ f_ch_status(typval_T *argvars, typval_T *rettv)
|
||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
clear_job_options(&opt);
|
||||
if (get_job_options(&argvars[1], &opt, JO_PART) == OK
|
||||
if (get_job_options(&argvars[1], &opt, JO_PART, 0) == OK
|
||||
&& (opt.jo_set & JO_PART))
|
||||
part = opt.jo_part;
|
||||
}
|
||||
@@ -3247,11 +3252,18 @@ f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
/* Avoid a 1 second delay when the keys start Insert mode. */
|
||||
msg_scroll = FALSE;
|
||||
|
||||
if (!dangerous)
|
||||
++ex_normal_busy;
|
||||
exec_normal(TRUE);
|
||||
if (!dangerous)
|
||||
--ex_normal_busy;
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (term_use_loop())
|
||||
terminal_loop(FALSE);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (!dangerous)
|
||||
++ex_normal_busy;
|
||||
exec_normal(TRUE);
|
||||
if (!dangerous)
|
||||
--ex_normal_busy;
|
||||
}
|
||||
msg_scroll |= save_msg_scroll;
|
||||
}
|
||||
}
|
||||
@@ -3623,11 +3635,16 @@ f_foldtextresult(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
char_u buf[FOLD_TEXT_LEN];
|
||||
foldinfo_T foldinfo;
|
||||
int fold_count;
|
||||
static int entered = FALSE;
|
||||
#endif
|
||||
|
||||
rettv->v_type = VAR_STRING;
|
||||
rettv->vval.v_string = NULL;
|
||||
#ifdef FEAT_FOLDING
|
||||
if (entered)
|
||||
return; /* reject recursive use */
|
||||
entered = TRUE;
|
||||
|
||||
lnum = get_tv_lnum(argvars);
|
||||
/* treat illegal types and illegal string values for {lnum} the same */
|
||||
if (lnum < 0)
|
||||
@@ -3641,6 +3658,8 @@ f_foldtextresult(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
text = vim_strsave(text);
|
||||
rettv->vval.v_string = text;
|
||||
}
|
||||
|
||||
entered = FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -4364,9 +4383,7 @@ f_getchar(typval_T *argvars, typval_T *rettv)
|
||||
int col = mouse_col;
|
||||
win_T *win;
|
||||
linenr_T lnum;
|
||||
# ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
# endif
|
||||
int winnr = 1;
|
||||
|
||||
if (row >= 0 && col >= 0)
|
||||
@@ -4374,11 +4391,11 @@ f_getchar(typval_T *argvars, typval_T *rettv)
|
||||
/* Find the window at the mouse coordinates and compute the
|
||||
* text position. */
|
||||
win = mouse_find_win(&row, &col);
|
||||
if (win == NULL)
|
||||
return;
|
||||
(void)mouse_comp_pos(win, &row, &col, &lnum);
|
||||
# ifdef FEAT_WINDOWS
|
||||
for (wp = firstwin; wp != win; wp = wp->w_next)
|
||||
++winnr;
|
||||
# endif
|
||||
set_vim_var_nr(VV_MOUSE_WIN, winnr);
|
||||
set_vim_var_nr(VV_MOUSE_WINID, win->w_id);
|
||||
set_vim_var_nr(VV_MOUSE_LNUM, lnum);
|
||||
@@ -4800,7 +4817,7 @@ get_qf_loc_list(int is_qf, win_T *wp, typval_T *what_arg, typval_T *rettv)
|
||||
{
|
||||
if (rettv_list_alloc(rettv) == OK)
|
||||
if (is_qf || wp != NULL)
|
||||
(void)get_errorlist(wp, -1, rettv->vval.v_list);
|
||||
(void)get_errorlist(NULL, wp, -1, rettv->vval.v_list);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4812,7 +4829,7 @@ get_qf_loc_list(int is_qf, win_T *wp, typval_T *what_arg, typval_T *rettv)
|
||||
dict_T *d = what_arg->vval.v_dict;
|
||||
|
||||
if (d != NULL)
|
||||
get_errorlist_properties(wp, d, rettv->vval.v_dict);
|
||||
qf_get_properties(wp, d, rettv->vval.v_dict);
|
||||
}
|
||||
else
|
||||
EMSG(_(e_dictreq));
|
||||
@@ -5077,7 +5094,6 @@ f_getregtype(typval_T *argvars, typval_T *rettv)
|
||||
rettv->vval.v_string = vim_strsave(buf);
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* Returns information (variables, options, etc.) about a tab page
|
||||
* as a dictionary.
|
||||
@@ -5109,7 +5125,6 @@ get_tabpage_info(tabpage_T *tp, int tp_idx)
|
||||
|
||||
return dict;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* "gettabinfo()" function
|
||||
@@ -5117,7 +5132,6 @@ get_tabpage_info(tabpage_T *tp, int tp_idx)
|
||||
static void
|
||||
f_gettabinfo(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp, *tparg = NULL;
|
||||
dict_T *d;
|
||||
int tpnr = 0;
|
||||
@@ -5145,7 +5159,6 @@ f_gettabinfo(typval_T *argvars, typval_T *rettv)
|
||||
if (tparg != NULL)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5200,7 +5213,6 @@ f_gettabwinvar(typval_T *argvars, typval_T *rettv)
|
||||
getwinvar(argvars, rettv, 1);
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* Returns information about a window as a dictionary.
|
||||
*/
|
||||
@@ -5217,9 +5229,15 @@ get_win_info(win_T *wp, short tpnr, short winnr)
|
||||
dict_add_nr_str(dict, "winnr", winnr, NULL);
|
||||
dict_add_nr_str(dict, "winid", wp->w_id, NULL);
|
||||
dict_add_nr_str(dict, "height", wp->w_height, NULL);
|
||||
#ifdef FEAT_MENU
|
||||
dict_add_nr_str(dict, "winbar", wp->w_winbar_height, NULL);
|
||||
#endif
|
||||
dict_add_nr_str(dict, "width", wp->w_width, NULL);
|
||||
dict_add_nr_str(dict, "bufnr", wp->w_buffer->b_fnum, NULL);
|
||||
|
||||
#ifdef FEAT_TERMINAL
|
||||
dict_add_nr_str(dict, "terminal", bt_terminal(wp->w_buffer), NULL);
|
||||
#endif
|
||||
#ifdef FEAT_QUICKFIX
|
||||
dict_add_nr_str(dict, "quickfix", bt_quickfix(wp->w_buffer), NULL);
|
||||
dict_add_nr_str(dict, "loclist",
|
||||
@@ -5231,7 +5249,6 @@ get_win_info(win_T *wp, short tpnr, short winnr)
|
||||
|
||||
return dict;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* "getwininfo()" function
|
||||
@@ -5239,17 +5256,14 @@ get_win_info(win_T *wp, short tpnr, short winnr)
|
||||
static void
|
||||
f_getwininfo(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp;
|
||||
win_T *wp = NULL, *wparg = NULL;
|
||||
dict_T *d;
|
||||
short tabnr = 0, winnr;
|
||||
#endif
|
||||
|
||||
if (rettv_list_alloc(rettv) != OK)
|
||||
return;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (argvars[0].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
wparg = win_id2wp(argvars);
|
||||
@@ -5277,7 +5291,6 @@ f_getwininfo(typval_T *argvars, typval_T *rettv)
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5913,7 +5926,7 @@ f_has(typval_T *argvars, typval_T *rettv)
|
||||
#ifdef FEAT_TERMGUICOLORS
|
||||
"termguicolors",
|
||||
#endif
|
||||
#ifdef FEAT_TERMINAL
|
||||
#if defined(FEAT_TERMINAL) && !defined(WIN3264)
|
||||
"terminal",
|
||||
#endif
|
||||
#ifdef TERMINFO
|
||||
@@ -5947,9 +5960,7 @@ f_has(typval_T *argvars, typval_T *rettv)
|
||||
#ifdef FEAT_VIMINFO
|
||||
"viminfo",
|
||||
#endif
|
||||
#ifdef FEAT_WINDOWS
|
||||
"vertsplit",
|
||||
#endif
|
||||
#ifdef FEAT_VIRTUALEDIT
|
||||
"virtualedit",
|
||||
#endif
|
||||
@@ -5966,9 +5977,7 @@ f_has(typval_T *argvars, typval_T *rettv)
|
||||
#ifdef FEAT_WILDMENU
|
||||
"wildmenu",
|
||||
#endif
|
||||
#ifdef FEAT_WINDOWS
|
||||
"windows",
|
||||
#endif
|
||||
#ifdef FEAT_WAK
|
||||
"winaltkeys",
|
||||
#endif
|
||||
@@ -6120,6 +6129,10 @@ f_has(typval_T *argvars, typval_T *rettv)
|
||||
#ifdef FEAT_NETBEANS_INTG
|
||||
else if (STRICMP(name, "netbeans_enabled") == 0)
|
||||
n = netbeans_active();
|
||||
#endif
|
||||
#if defined(FEAT_TERMINAL) && defined(WIN3264)
|
||||
else if (STRICMP(name, "terminal") == 0)
|
||||
n = terminal_enabled();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -6775,7 +6788,7 @@ f_job_setoptions(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
if (job == NULL)
|
||||
return;
|
||||
clear_job_options(&opt);
|
||||
if (get_job_options(&argvars[1], &opt, JO_STOPONEXIT + JO_EXIT_CB) == OK)
|
||||
if (get_job_options(&argvars[1], &opt, JO_STOPONEXIT + JO_EXIT_CB, 0) == OK)
|
||||
job_set_options(job, &opt);
|
||||
free_job_options(&opt);
|
||||
}
|
||||
@@ -7233,10 +7246,17 @@ f_mapcheck(typval_T *argvars, typval_T *rettv)
|
||||
get_maparg(argvars, rettv, FALSE);
|
||||
}
|
||||
|
||||
static void find_some_match(typval_T *argvars, typval_T *rettv, int start);
|
||||
typedef enum
|
||||
{
|
||||
MATCH_END, /* matchend() */
|
||||
MATCH_MATCH, /* match() */
|
||||
MATCH_STR, /* matchstr() */
|
||||
MATCH_LIST, /* matchlist() */
|
||||
MATCH_POS /* matchstrpos() */
|
||||
} matchtype_T;
|
||||
|
||||
static void
|
||||
find_some_match(typval_T *argvars, typval_T *rettv, int type)
|
||||
find_some_match(typval_T *argvars, typval_T *rettv, matchtype_T type)
|
||||
{
|
||||
char_u *str = NULL;
|
||||
long len = 0;
|
||||
@@ -7260,13 +7280,13 @@ find_some_match(typval_T *argvars, typval_T *rettv, int type)
|
||||
p_cpo = (char_u *)"";
|
||||
|
||||
rettv->vval.v_number = -1;
|
||||
if (type == 3 || type == 4)
|
||||
if (type == MATCH_LIST || type == MATCH_POS)
|
||||
{
|
||||
/* type 3: return empty list when there are no matches.
|
||||
* type 4: return ["", -1, -1, -1] */
|
||||
/* type MATCH_LIST: return empty list when there are no matches.
|
||||
* type MATCH_POS: return ["", -1, -1, -1] */
|
||||
if (rettv_list_alloc(rettv) == FAIL)
|
||||
goto theend;
|
||||
if (type == 4
|
||||
if (type == MATCH_POS
|
||||
&& (list_append_string(rettv->vval.v_list,
|
||||
(char_u *)"", 0) == FAIL
|
||||
|| list_append_number(rettv->vval.v_list,
|
||||
@@ -7281,7 +7301,7 @@ find_some_match(typval_T *argvars, typval_T *rettv, int type)
|
||||
goto theend;
|
||||
}
|
||||
}
|
||||
else if (type == 2)
|
||||
else if (type == MATCH_STR)
|
||||
{
|
||||
rettv->v_type = VAR_STRING;
|
||||
rettv->vval.v_string = NULL;
|
||||
@@ -7393,7 +7413,7 @@ find_some_match(typval_T *argvars, typval_T *rettv, int type)
|
||||
|
||||
if (match)
|
||||
{
|
||||
if (type == 4)
|
||||
if (type == MATCH_POS)
|
||||
{
|
||||
listitem_T *li1 = rettv->vval.v_list->lv_first;
|
||||
listitem_T *li2 = li1->li_next;
|
||||
@@ -7410,7 +7430,7 @@ find_some_match(typval_T *argvars, typval_T *rettv, int type)
|
||||
if (l != NULL)
|
||||
li2->li_tv.vval.v_number = (varnumber_T)idx;
|
||||
}
|
||||
else if (type == 3)
|
||||
else if (type == MATCH_LIST)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -7430,7 +7450,7 @@ find_some_match(typval_T *argvars, typval_T *rettv, int type)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (type == 2)
|
||||
else if (type == MATCH_STR)
|
||||
{
|
||||
/* return matched string */
|
||||
if (l != NULL)
|
||||
@@ -7443,7 +7463,7 @@ find_some_match(typval_T *argvars, typval_T *rettv, int type)
|
||||
rettv->vval.v_number = idx;
|
||||
else
|
||||
{
|
||||
if (type != 0)
|
||||
if (type != MATCH_END)
|
||||
rettv->vval.v_number =
|
||||
(varnumber_T)(regmatch.startp[0] - str);
|
||||
else
|
||||
@@ -7455,12 +7475,11 @@ find_some_match(typval_T *argvars, typval_T *rettv, int type)
|
||||
vim_regfree(regmatch.regprog);
|
||||
}
|
||||
|
||||
if (type == 4 && l == NULL)
|
||||
theend:
|
||||
if (type == MATCH_POS && l == NULL && rettv->vval.v_list != NULL)
|
||||
/* matchstrpos() without a list: drop the second item. */
|
||||
listitem_remove(rettv->vval.v_list,
|
||||
rettv->vval.v_list->lv_first->li_next);
|
||||
|
||||
theend:
|
||||
vim_free(tofree);
|
||||
p_cpo = save_cpo;
|
||||
}
|
||||
@@ -7471,7 +7490,7 @@ theend:
|
||||
static void
|
||||
f_match(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
find_some_match(argvars, rettv, 1);
|
||||
find_some_match(argvars, rettv, MATCH_MATCH);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -7639,7 +7658,7 @@ f_matchdelete(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
static void
|
||||
f_matchend(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
find_some_match(argvars, rettv, 0);
|
||||
find_some_match(argvars, rettv, MATCH_END);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -7648,7 +7667,7 @@ f_matchend(typval_T *argvars, typval_T *rettv)
|
||||
static void
|
||||
f_matchlist(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
find_some_match(argvars, rettv, 3);
|
||||
find_some_match(argvars, rettv, MATCH_LIST);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -7657,7 +7676,7 @@ f_matchlist(typval_T *argvars, typval_T *rettv)
|
||||
static void
|
||||
f_matchstr(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
find_some_match(argvars, rettv, 2);
|
||||
find_some_match(argvars, rettv, MATCH_STR);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -7666,7 +7685,7 @@ f_matchstr(typval_T *argvars, typval_T *rettv)
|
||||
static void
|
||||
f_matchstrpos(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
find_some_match(argvars, rettv, 4);
|
||||
find_some_match(argvars, rettv, MATCH_POS);
|
||||
}
|
||||
|
||||
static void max_min(typval_T *argvars, typval_T *rettv, int domax);
|
||||
@@ -7838,6 +7857,10 @@ f_mode(typval_T *argvars, typval_T *rettv)
|
||||
buf[0] = 'x';
|
||||
buf[1] = '!';
|
||||
}
|
||||
#ifdef FEAT_TERMINAL
|
||||
else if (term_use_loop())
|
||||
buf[0] = 't';
|
||||
#endif
|
||||
else if (VIsual_active)
|
||||
{
|
||||
if (VIsual_select)
|
||||
@@ -8607,7 +8630,10 @@ remote_common(typval_T *argvars, typval_T *rettv, int expr)
|
||||
# endif
|
||||
{
|
||||
if (r != NULL)
|
||||
{
|
||||
EMSG(r); /* sending worked but evaluation failed */
|
||||
vim_free(r);
|
||||
}
|
||||
else
|
||||
EMSG2(_("E241: Unable to send to %s"), server_name);
|
||||
return;
|
||||
@@ -8667,6 +8693,8 @@ f_remote_foreground(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
argvars[1].v_type = VAR_STRING;
|
||||
argvars[1].vval.v_string = vim_strsave((char_u *)"foreground()");
|
||||
argvars[2].v_type = VAR_UNKNOWN;
|
||||
rettv->v_type = VAR_STRING;
|
||||
rettv->vval.v_string = NULL;
|
||||
remote_common(argvars, rettv, TRUE);
|
||||
vim_free(argvars[1].vval.v_string);
|
||||
# endif
|
||||
@@ -9840,6 +9868,118 @@ f_serverlist(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
rettv->vval.v_string = r;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set line or list of lines in buffer "buf".
|
||||
*/
|
||||
static void
|
||||
set_buffer_lines(buf_T *buf, linenr_T lnum, typval_T *lines, typval_T *rettv)
|
||||
{
|
||||
char_u *line = NULL;
|
||||
list_T *l = NULL;
|
||||
listitem_T *li = NULL;
|
||||
long added = 0;
|
||||
linenr_T lcount;
|
||||
buf_T *curbuf_save;
|
||||
int is_curbuf = buf == curbuf;
|
||||
|
||||
/* When using the current buffer ml_mfp will be set if needed. Useful when
|
||||
* setline() is used on startup. For other buffers the buffer must be
|
||||
* loaded. */
|
||||
if (buf == NULL || (!is_curbuf && buf->b_ml.ml_mfp == NULL) || lnum < 1)
|
||||
{
|
||||
rettv->vval.v_number = 1; /* FAIL */
|
||||
return;
|
||||
}
|
||||
|
||||
curbuf_save = curbuf;
|
||||
curbuf = buf;
|
||||
|
||||
lcount = curbuf->b_ml.ml_line_count;
|
||||
|
||||
if (lines->v_type == VAR_LIST)
|
||||
{
|
||||
l = lines->vval.v_list;
|
||||
li = l->lv_first;
|
||||
}
|
||||
else
|
||||
line = get_tv_string_chk(lines);
|
||||
|
||||
/* default result is zero == OK */
|
||||
for (;;)
|
||||
{
|
||||
if (l != NULL)
|
||||
{
|
||||
/* list argument, get next string */
|
||||
if (li == NULL)
|
||||
break;
|
||||
line = get_tv_string_chk(&li->li_tv);
|
||||
li = li->li_next;
|
||||
}
|
||||
|
||||
rettv->vval.v_number = 1; /* FAIL */
|
||||
if (line == NULL || lnum < 1 || lnum > curbuf->b_ml.ml_line_count + 1)
|
||||
break;
|
||||
|
||||
/* When coming here from Insert mode, sync undo, so that this can be
|
||||
* undone separately from what was previously inserted. */
|
||||
if (u_sync_once == 2)
|
||||
{
|
||||
u_sync_once = 1; /* notify that u_sync() was called */
|
||||
u_sync(TRUE);
|
||||
}
|
||||
|
||||
if (lnum <= curbuf->b_ml.ml_line_count)
|
||||
{
|
||||
/* existing line, replace it */
|
||||
if (u_savesub(lnum) == OK && ml_replace(lnum, line, TRUE) == OK)
|
||||
{
|
||||
changed_bytes(lnum, 0);
|
||||
if (is_curbuf && lnum == curwin->w_cursor.lnum)
|
||||
check_cursor_col();
|
||||
rettv->vval.v_number = 0; /* OK */
|
||||
}
|
||||
}
|
||||
else if (added > 0 || u_save(lnum - 1, lnum) == OK)
|
||||
{
|
||||
/* lnum is one past the last line, append the line */
|
||||
++added;
|
||||
if (ml_append(lnum - 1, line, (colnr_T)0, FALSE) == OK)
|
||||
rettv->vval.v_number = 0; /* OK */
|
||||
}
|
||||
|
||||
if (l == NULL) /* only one string argument */
|
||||
break;
|
||||
++lnum;
|
||||
}
|
||||
|
||||
if (added > 0)
|
||||
appended_lines_mark(lcount, added);
|
||||
|
||||
curbuf = curbuf_save;
|
||||
}
|
||||
|
||||
/*
|
||||
* "setbufline()" function
|
||||
*/
|
||||
static void
|
||||
f_setbufline(argvars, rettv)
|
||||
typval_T *argvars;
|
||||
typval_T *rettv;
|
||||
{
|
||||
linenr_T lnum;
|
||||
buf_T *buf;
|
||||
|
||||
buf = get_buf_tv(&argvars[0], FALSE);
|
||||
if (buf == NULL)
|
||||
rettv->vval.v_number = 1; /* FAIL */
|
||||
else
|
||||
{
|
||||
lnum = get_tv_lnum_buf(&argvars[1], buf);
|
||||
|
||||
set_buffer_lines(buf, lnum, &argvars[2], rettv);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* "setbufvar()" function
|
||||
*/
|
||||
@@ -9994,72 +10134,9 @@ f_setfperm(typval_T *argvars, typval_T *rettv)
|
||||
static void
|
||||
f_setline(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
linenr_T lnum;
|
||||
char_u *line = NULL;
|
||||
list_T *l = NULL;
|
||||
listitem_T *li = NULL;
|
||||
long added = 0;
|
||||
linenr_T lcount = curbuf->b_ml.ml_line_count;
|
||||
linenr_T lnum = get_tv_lnum(&argvars[0]);
|
||||
|
||||
lnum = get_tv_lnum(&argvars[0]);
|
||||
if (argvars[1].v_type == VAR_LIST)
|
||||
{
|
||||
l = argvars[1].vval.v_list;
|
||||
li = l->lv_first;
|
||||
}
|
||||
else
|
||||
line = get_tv_string_chk(&argvars[1]);
|
||||
|
||||
/* default result is zero == OK */
|
||||
for (;;)
|
||||
{
|
||||
if (l != NULL)
|
||||
{
|
||||
/* list argument, get next string */
|
||||
if (li == NULL)
|
||||
break;
|
||||
line = get_tv_string_chk(&li->li_tv);
|
||||
li = li->li_next;
|
||||
}
|
||||
|
||||
rettv->vval.v_number = 1; /* FAIL */
|
||||
if (line == NULL || lnum < 1 || lnum > curbuf->b_ml.ml_line_count + 1)
|
||||
break;
|
||||
|
||||
/* When coming here from Insert mode, sync undo, so that this can be
|
||||
* undone separately from what was previously inserted. */
|
||||
if (u_sync_once == 2)
|
||||
{
|
||||
u_sync_once = 1; /* notify that u_sync() was called */
|
||||
u_sync(TRUE);
|
||||
}
|
||||
|
||||
if (lnum <= curbuf->b_ml.ml_line_count)
|
||||
{
|
||||
/* existing line, replace it */
|
||||
if (u_savesub(lnum) == OK && ml_replace(lnum, line, TRUE) == OK)
|
||||
{
|
||||
changed_bytes(lnum, 0);
|
||||
if (lnum == curwin->w_cursor.lnum)
|
||||
check_cursor_col();
|
||||
rettv->vval.v_number = 0; /* OK */
|
||||
}
|
||||
}
|
||||
else if (added > 0 || u_save(lnum - 1, lnum) == OK)
|
||||
{
|
||||
/* lnum is one past the last line, append the line */
|
||||
++added;
|
||||
if (ml_append(lnum - 1, line, (colnr_T)0, FALSE) == OK)
|
||||
rettv->vval.v_number = 0; /* OK */
|
||||
}
|
||||
|
||||
if (l == NULL) /* only one string argument */
|
||||
break;
|
||||
++lnum;
|
||||
}
|
||||
|
||||
if (added > 0)
|
||||
appended_lines_mark(lcount, added);
|
||||
set_buffer_lines(curbuf, lnum, &argvars[1], rettv);
|
||||
}
|
||||
|
||||
static void set_qf_ll_list(win_T *wp, typval_T *list_arg, typval_T *action_arg, typval_T *what_arg, typval_T *rettv);
|
||||
@@ -10427,10 +10504,8 @@ free_lstval:
|
||||
static void
|
||||
f_settabvar(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *save_curtab;
|
||||
tabpage_T *tp;
|
||||
#endif
|
||||
char_u *varname, *tabvarname;
|
||||
typval_T *varp;
|
||||
|
||||
@@ -10439,22 +10514,14 @@ f_settabvar(typval_T *argvars, typval_T *rettv)
|
||||
if (check_restricted() || check_secure())
|
||||
return;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
|
||||
#endif
|
||||
varname = get_tv_string_chk(&argvars[1]);
|
||||
varp = &argvars[2];
|
||||
|
||||
if (varname != NULL && varp != NULL
|
||||
#ifdef FEAT_WINDOWS
|
||||
&& tp != NULL
|
||||
#endif
|
||||
)
|
||||
if (varname != NULL && varp != NULL && tp != NULL)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
save_curtab = curtab;
|
||||
goto_tabpage_tp(tp, FALSE, FALSE);
|
||||
#endif
|
||||
|
||||
tabvarname = alloc((unsigned)STRLEN(varname) + 3);
|
||||
if (tabvarname != NULL)
|
||||
@@ -10465,11 +10532,9 @@ f_settabvar(typval_T *argvars, typval_T *rettv)
|
||||
vim_free(tabvarname);
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Restore current tabpage */
|
||||
if (valid_tabpage(save_curtab))
|
||||
goto_tabpage_tp(save_curtab, FALSE, FALSE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11816,6 +11881,10 @@ f_synIDattr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
case 's':
|
||||
if (TOLOWER_ASC(what[1]) == 'p') /* sp[#] */
|
||||
p = highlight_color(id, what, modec);
|
||||
/* strikeout */
|
||||
else if (TOLOWER_ASC(what[1]) == 't' &&
|
||||
TOLOWER_ASC(what[2]) == 'r')
|
||||
p = highlight_has_attr(id, HL_STRIKETHROUGH, modec);
|
||||
else /* standout */
|
||||
p = highlight_has_attr(id, HL_STANDOUT, modec);
|
||||
break;
|
||||
@@ -12171,7 +12240,6 @@ f_systemlist(typval_T *argvars, typval_T *rettv)
|
||||
static void
|
||||
f_tabpagebuflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp;
|
||||
win_T *wp = NULL;
|
||||
|
||||
@@ -12190,7 +12258,6 @@ f_tabpagebuflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
wp->w_buffer->b_fnum) == FAIL)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -12201,7 +12268,6 @@ f_tabpagebuflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
f_tabpagenr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
int nr = 1;
|
||||
#ifdef FEAT_WINDOWS
|
||||
char_u *arg;
|
||||
|
||||
if (argvars[0].v_type != VAR_UNKNOWN)
|
||||
@@ -12218,12 +12284,10 @@ f_tabpagenr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
}
|
||||
else
|
||||
nr = tabpage_index(curtab);
|
||||
#endif
|
||||
rettv->vval.v_number = nr;
|
||||
}
|
||||
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
static int get_winnr(tabpage_T *tp, typval_T *argvar);
|
||||
|
||||
/*
|
||||
@@ -12272,7 +12336,6 @@ get_winnr(tabpage_T *tp, typval_T *argvar)
|
||||
}
|
||||
return nr;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* "tabpagewinnr()" function
|
||||
@@ -12281,7 +12344,6 @@ get_winnr(tabpage_T *tp, typval_T *argvar)
|
||||
f_tabpagewinnr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
int nr = 1;
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp;
|
||||
|
||||
tp = find_tabpage((int)get_tv_number(&argvars[0]));
|
||||
@@ -12289,7 +12351,6 @@ f_tabpagewinnr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
nr = 0;
|
||||
else
|
||||
nr = get_winnr(tp, &argvars[1]);
|
||||
#endif
|
||||
rettv->vval.v_number = nr;
|
||||
}
|
||||
|
||||
@@ -12438,6 +12499,23 @@ f_test_autochdir(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* "test_feedinput()"
|
||||
*/
|
||||
static void
|
||||
f_test_feedinput(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
{
|
||||
#ifdef USE_INPUT_BUF
|
||||
char_u *val = get_tv_string_chk(&argvars[0]);
|
||||
|
||||
if (val != NULL)
|
||||
{
|
||||
trash_input_buf();
|
||||
add_to_input_buf_csi(val, (int)STRLEN(val));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* "test_disable({name}, {val})" function
|
||||
*/
|
||||
@@ -13091,9 +13169,7 @@ f_winnr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
int nr = 1;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
nr = get_winnr(curtab, &argvars[0]);
|
||||
#endif
|
||||
rettv->vval.v_number = nr;
|
||||
}
|
||||
|
||||
@@ -13103,7 +13179,6 @@ f_winnr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
static void
|
||||
f_winrestcmd(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
int winnr = 1;
|
||||
garray_T ga;
|
||||
@@ -13121,9 +13196,6 @@ f_winrestcmd(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
ga_append(&ga, NUL);
|
||||
|
||||
rettv->vval.v_string = ga.ga_data;
|
||||
#else
|
||||
rettv->vval.v_string = NULL;
|
||||
#endif
|
||||
rettv->v_type = VAR_STRING;
|
||||
}
|
||||
|
||||
@@ -13167,9 +13239,7 @@ f_winrestview(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
|
||||
check_cursor();
|
||||
win_new_height(curwin, curwin->w_height);
|
||||
# ifdef FEAT_WINDOWS
|
||||
win_new_width(curwin, W_WIDTH(curwin));
|
||||
# endif
|
||||
changed_window_setting();
|
||||
|
||||
if (curwin->w_topline <= 0)
|
||||
@@ -13222,11 +13292,7 @@ f_winwidth(typval_T *argvars, typval_T *rettv)
|
||||
if (wp == NULL)
|
||||
rettv->vval.v_number = -1;
|
||||
else
|
||||
#ifdef FEAT_WINDOWS
|
||||
rettv->vval.v_number = wp->w_width;
|
||||
#else
|
||||
rettv->vval.v_number = Columns;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -25,12 +25,12 @@ static const unsigned short cmdidxs1[26] =
|
||||
/* r */ 351,
|
||||
/* s */ 370,
|
||||
/* t */ 437,
|
||||
/* u */ 473,
|
||||
/* v */ 484,
|
||||
/* w */ 502,
|
||||
/* x */ 517,
|
||||
/* y */ 526,
|
||||
/* z */ 527
|
||||
/* u */ 477,
|
||||
/* v */ 488,
|
||||
/* w */ 506,
|
||||
/* x */ 521,
|
||||
/* y */ 530,
|
||||
/* z */ 531
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -60,7 +60,7 @@ static const unsigned char cmdidxs2[26][26] =
|
||||
/* q */ { 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
/* r */ { 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 18, 0, 0, 0, 0 },
|
||||
/* s */ { 2, 6, 15, 0, 18, 22, 0, 24, 25, 0, 0, 28, 30, 34, 38, 40, 0, 48, 0, 49, 0, 61, 62, 0, 63, 0 },
|
||||
/* t */ { 2, 0, 19, 0, 22, 24, 0, 25, 0, 26, 0, 27, 28, 29, 30, 31, 0, 32, 34, 0, 35, 0, 0, 0, 0, 0 },
|
||||
/* t */ { 2, 0, 19, 0, 22, 24, 0, 25, 0, 26, 0, 27, 28, 31, 33, 34, 0, 35, 37, 0, 38, 0, 0, 0, 0, 0 },
|
||||
/* u */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
/* v */ { 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 9, 12, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 0, 0 },
|
||||
/* w */ { 2, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 8, 0, 9, 10, 0, 12, 0, 13, 14, 0, 0, 0, 0 },
|
||||
@@ -69,4 +69,4 @@ static const unsigned char cmdidxs2[26][26] =
|
||||
/* z */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const int command_count = 540;
|
||||
static const int command_count = 544;
|
||||
|
||||
@@ -2098,11 +2098,16 @@ viminfo_filename(char_u *file)
|
||||
else if ((file = find_viminfo_parameter('n')) == NULL || *file == NUL)
|
||||
{
|
||||
#ifdef VIMINFO_FILE2
|
||||
/* don't use $HOME when not defined (turned into "c:/"!). */
|
||||
# ifdef VMS
|
||||
if (mch_getenv((char_u *)"SYS$LOGIN") == NULL)
|
||||
# else
|
||||
# ifdef MSWIN
|
||||
/* Use $VIM only if $HOME is the default "C:/". */
|
||||
if (STRCMP(vim_getenv((char_u *)"HOME", NULL), "C:/") == 0
|
||||
&& mch_getenv((char_u *)"HOME") == NULL)
|
||||
# else
|
||||
if (mch_getenv((char_u *)"HOME") == NULL)
|
||||
# endif
|
||||
# endif
|
||||
{
|
||||
/* don't use $VIM when not available. */
|
||||
@@ -3220,9 +3225,7 @@ do_write(exarg_T *eap)
|
||||
if (retval == OK)
|
||||
{
|
||||
curbuf->b_p_ro = FALSE;
|
||||
#ifdef FEAT_WINDOWS
|
||||
redraw_tabline = TRUE;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3561,7 +3564,7 @@ getfile(
|
||||
|
||||
if (other)
|
||||
++no_wait_return; /* don't wait for autowrite message */
|
||||
if (other && !forceit && curbuf->b_nwindows == 1 && !P_HID(curbuf)
|
||||
if (other && !forceit && curbuf->b_nwindows == 1 && !buf_hide(curbuf)
|
||||
&& curbufIsChanged() && autowrite(curbuf, forceit) == FAIL)
|
||||
{
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
@@ -3572,7 +3575,7 @@ getfile(
|
||||
{
|
||||
if (other)
|
||||
--no_wait_return;
|
||||
EMSG(_(e_nowrtmsg));
|
||||
no_write_message();
|
||||
retval = GETFILE_NOT_WRITTEN; /* file has been changed */
|
||||
goto theend;
|
||||
}
|
||||
@@ -3590,7 +3593,7 @@ getfile(
|
||||
retval = GETFILE_SAME_FILE; /* it's in the same file */
|
||||
}
|
||||
else if (do_ecmd(fnum, ffname, sfname, NULL, lnum,
|
||||
(P_HID(curbuf) ? ECMD_HIDE : 0) + (forceit ? ECMD_FORCEIT : 0),
|
||||
(buf_hide(curbuf) ? ECMD_HIDE : 0) + (forceit ? ECMD_FORCEIT : 0),
|
||||
curwin) == OK)
|
||||
retval = GETFILE_OPEN_OTHER; /* opened another file */
|
||||
else
|
||||
@@ -4148,7 +4151,6 @@ do_ecmd(
|
||||
#ifdef FEAT_FOLDING
|
||||
/* It's possible that all lines in the buffer changed. Need to update
|
||||
* automatic folding for all windows where it's used. */
|
||||
# ifdef FEAT_WINDOWS
|
||||
{
|
||||
win_T *win;
|
||||
tabpage_T *tp;
|
||||
@@ -4157,9 +4159,6 @@ do_ecmd(
|
||||
if (win->w_buffer == curbuf)
|
||||
foldUpdateAll(win);
|
||||
}
|
||||
# else
|
||||
foldUpdateAll(curwin);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Change directories when the 'acd' option is set. */
|
||||
@@ -4279,10 +4278,8 @@ do_ecmd(
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Check if cursors in other windows on the same buffer are still valid */
|
||||
check_lnums(FALSE);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Did not read the file, need to show some info about the file.
|
||||
@@ -4578,10 +4575,8 @@ ex_z(exarg_T *eap)
|
||||
* 'scroll' */
|
||||
if (eap->forceit)
|
||||
bigness = curwin->w_height;
|
||||
#ifdef FEAT_WINDOWS
|
||||
else if (!ONE_WINDOW)
|
||||
bigness = curwin->w_height - 3;
|
||||
#endif
|
||||
else
|
||||
bigness = curwin->w_p_scr * 2;
|
||||
if (bigness < 1)
|
||||
@@ -6147,7 +6142,7 @@ free_old_sub(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)) || defined(PROTO)
|
||||
#if defined(FEAT_QUICKFIX) || defined(PROTO)
|
||||
/*
|
||||
* Set up for a tagpreview.
|
||||
* Return TRUE when it was created.
|
||||
@@ -6210,9 +6205,7 @@ ex_help(exarg_T *eap)
|
||||
FILE *helpfd; /* file descriptor of help file */
|
||||
int n;
|
||||
int i;
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
#endif
|
||||
int num_matches;
|
||||
char_u **matches;
|
||||
char_u *p;
|
||||
@@ -6314,13 +6307,8 @@ ex_help(exarg_T *eap)
|
||||
* Re-use an existing help window or open a new one.
|
||||
* Always open a new one for ":tab help".
|
||||
*/
|
||||
if (!bt_help(curwin->w_buffer)
|
||||
#ifdef FEAT_WINDOWS
|
||||
|| cmdmod.tab != 0
|
||||
#endif
|
||||
)
|
||||
if (!bt_help(curwin->w_buffer) || cmdmod.tab != 0)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (cmdmod.tab != 0)
|
||||
wp = NULL;
|
||||
else
|
||||
@@ -6330,7 +6318,6 @@ ex_help(exarg_T *eap)
|
||||
if (wp != NULL && wp->w_buffer->b_nwindows > 0)
|
||||
win_enter(wp, TRUE);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/*
|
||||
* There is no help window yet.
|
||||
@@ -6343,7 +6330,6 @@ ex_help(exarg_T *eap)
|
||||
}
|
||||
fclose(helpfd);
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Split off help window; put it at far top if no position
|
||||
* specified, the current window is vertically split and
|
||||
* narrow. */
|
||||
@@ -6353,16 +6339,9 @@ ex_help(exarg_T *eap)
|
||||
n |= WSP_TOP;
|
||||
if (win_split(0, n) == FAIL)
|
||||
goto erret;
|
||||
#else
|
||||
/* use current window */
|
||||
if (!can_abandon(curbuf, FALSE))
|
||||
goto erret;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (curwin->w_height < p_hh)
|
||||
win_setheight((int)p_hh);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Open help file (do_ecmd() will set b_help flag, readfile() will
|
||||
@@ -6372,12 +6351,7 @@ ex_help(exarg_T *eap)
|
||||
alt_fnum = curbuf->b_fnum;
|
||||
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_LASTL,
|
||||
ECMD_HIDE + ECMD_SET_HELP,
|
||||
#ifdef FEAT_WINDOWS
|
||||
NULL /* buffer is still open, don't store info */
|
||||
#else
|
||||
curwin
|
||||
#endif
|
||||
);
|
||||
NULL); /* buffer is still open, don't store info */
|
||||
if (!cmdmod.keepalt)
|
||||
curwin->w_alt_fnum = alt_fnum;
|
||||
empty_fnum = curbuf->b_fnum;
|
||||
@@ -6420,7 +6394,6 @@ erret:
|
||||
void
|
||||
ex_helpclose(exarg_T *eap UNUSED)
|
||||
{
|
||||
#if defined(FEAT_WINDOWS)
|
||||
win_T *win;
|
||||
|
||||
FOR_ALL_WINDOWS(win)
|
||||
@@ -6431,7 +6404,6 @@ ex_helpclose(exarg_T *eap UNUSED)
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(FEAT_MULTI_LANG) || defined(PROTO)
|
||||
@@ -8345,9 +8317,7 @@ ex_drop(exarg_T *eap)
|
||||
int split = FALSE;
|
||||
win_T *wp;
|
||||
buf_T *buf;
|
||||
# ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp;
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Check if the first argument is already being edited in a window. If
|
||||
@@ -8367,7 +8337,6 @@ ex_drop(exarg_T *eap)
|
||||
if (ARGCOUNT == 0)
|
||||
return;
|
||||
|
||||
# ifdef FEAT_WINDOWS
|
||||
if (cmdmod.tab)
|
||||
{
|
||||
/* ":tab drop file ...": open a tab for each argument that isn't
|
||||
@@ -8376,7 +8345,6 @@ ex_drop(exarg_T *eap)
|
||||
ex_all(eap);
|
||||
}
|
||||
else
|
||||
# endif
|
||||
{
|
||||
/* ":drop file ...": Edit the first argument. Jump to an existing
|
||||
* window if possible, edit in current window if the current buffer
|
||||
@@ -8387,9 +8355,7 @@ ex_drop(exarg_T *eap)
|
||||
{
|
||||
if (wp->w_buffer == buf)
|
||||
{
|
||||
# ifdef FEAT_WINDOWS
|
||||
goto_tabpage_win(tp, wp);
|
||||
# endif
|
||||
curwin->w_arg_idx = 0;
|
||||
return;
|
||||
}
|
||||
@@ -8401,18 +8367,11 @@ ex_drop(exarg_T *eap)
|
||||
* Skip the check if the 'hidden' option is set, as in this case the
|
||||
* buffer won't be lost.
|
||||
*/
|
||||
if (!P_HID(curbuf))
|
||||
if (!buf_hide(curbuf))
|
||||
{
|
||||
# ifdef FEAT_WINDOWS
|
||||
++emsg_off;
|
||||
# endif
|
||||
split = check_changed(curbuf, CCGD_AW | CCGD_EXCMD);
|
||||
# ifdef FEAT_WINDOWS
|
||||
--emsg_off;
|
||||
# else
|
||||
if (split)
|
||||
return;
|
||||
# endif
|
||||
}
|
||||
|
||||
/* Fake a ":sfirst" or ":first" command edit the first argument. */
|
||||
|
||||
@@ -1484,8 +1484,8 @@ EX(CMD_tearoff, "tearoff", ex_tearoff,
|
||||
NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN,
|
||||
ADDR_LINES),
|
||||
EX(CMD_terminal, "terminal", ex_terminal,
|
||||
RANGE|NOTADR|FILES|TRLBAR|CMDWIN,
|
||||
ADDR_OTHER),
|
||||
RANGE|BANG|FILES|CMDWIN,
|
||||
ADDR_LINES),
|
||||
EX(CMD_tfirst, "tfirst", ex_tag,
|
||||
RANGE|NOTADR|BANG|TRLBAR|ZEROR,
|
||||
ADDR_LINES),
|
||||
@@ -1501,9 +1501,18 @@ EX(CMD_tlast, "tlast", ex_tag,
|
||||
EX(CMD_tmenu, "tmenu", ex_menu,
|
||||
RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
|
||||
ADDR_LINES),
|
||||
EX(CMD_tmap, "tmap", ex_map,
|
||||
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
|
||||
ADDR_LINES),
|
||||
EX(CMD_tmapclear, "tmapclear", ex_mapclear,
|
||||
EXTRA|TRLBAR|CMDWIN,
|
||||
ADDR_LINES),
|
||||
EX(CMD_tnext, "tnext", ex_tag,
|
||||
RANGE|NOTADR|BANG|TRLBAR|ZEROR,
|
||||
ADDR_LINES),
|
||||
EX(CMD_tnoremap, "tnoremap", ex_map,
|
||||
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
|
||||
ADDR_LINES),
|
||||
EX(CMD_topleft, "topleft", ex_wrongmodifier,
|
||||
NEEDARG|EXTRA|NOTRLCOM,
|
||||
ADDR_LINES),
|
||||
@@ -1522,6 +1531,9 @@ EX(CMD_tselect, "tselect", ex_tag,
|
||||
EX(CMD_tunmenu, "tunmenu", ex_menu,
|
||||
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
|
||||
ADDR_LINES),
|
||||
EX(CMD_tunmap, "tunmap", ex_unmap,
|
||||
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
|
||||
ADDR_LINES),
|
||||
EX(CMD_undo, "undo", ex_undo,
|
||||
RANGE|NOTADR|COUNT|ZEROR|TRLBAR|CMDWIN,
|
||||
ADDR_LINES),
|
||||
|
||||
187
src/ex_cmds2.c
187
src/ex_cmds2.c
@@ -1090,15 +1090,24 @@ profile_zero(proftime_T *tm)
|
||||
static timer_T *first_timer = NULL;
|
||||
static long last_timer_id = 0;
|
||||
|
||||
# ifdef WIN3264
|
||||
# define GET_TIMEDIFF(timer, now) \
|
||||
(long)(((double)(timer->tr_due.QuadPart - now.QuadPart) \
|
||||
/ (double)fr.QuadPart) * 1000)
|
||||
# else
|
||||
# define GET_TIMEDIFF(timer, now) \
|
||||
(timer->tr_due.tv_sec - now.tv_sec) * 1000 \
|
||||
+ (timer->tr_due.tv_usec - now.tv_usec) / 1000
|
||||
# endif
|
||||
static long
|
||||
timer_time_left(timer_T *timer, proftime_T *now)
|
||||
{
|
||||
# ifdef WIN3264
|
||||
LARGE_INTEGER fr;
|
||||
|
||||
if (now->QuadPart > timer->tr_due.QuadPart)
|
||||
return 0;
|
||||
QueryPerformanceFrequency(&fr);
|
||||
return (long)(((double)(timer->tr_due.QuadPart - now->QuadPart)
|
||||
/ (double)fr.QuadPart) * 1000);
|
||||
# else
|
||||
if (now->tv_sec > timer->tr_due.tv_sec)
|
||||
return 0;
|
||||
return (timer->tr_due.tv_sec - now->tv_sec) * 1000
|
||||
+ (timer->tr_due.tv_usec - now->tv_usec) / 1000;
|
||||
# endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Insert a timer in the list of timers.
|
||||
@@ -1194,18 +1203,13 @@ check_due_timer(void)
|
||||
long next_due = -1;
|
||||
proftime_T now;
|
||||
int did_one = FALSE;
|
||||
int need_update_screen = FALSE;
|
||||
long current_id = last_timer_id;
|
||||
# ifdef WIN3264
|
||||
LARGE_INTEGER fr;
|
||||
# endif
|
||||
|
||||
/* Don't run any timers while exiting or dealing with an error. */
|
||||
if (exiting || aborting())
|
||||
return next_due;
|
||||
|
||||
# ifdef WIN3264
|
||||
QueryPerformanceFrequency(&fr);
|
||||
# endif
|
||||
profile_start(&now);
|
||||
for (timer = first_timer; timer != NULL && !got_int; timer = timer_next)
|
||||
{
|
||||
@@ -1213,33 +1217,51 @@ check_due_timer(void)
|
||||
|
||||
if (timer->tr_id == -1 || timer->tr_firing || timer->tr_paused)
|
||||
continue;
|
||||
this_due = GET_TIMEDIFF(timer, now);
|
||||
this_due = timer_time_left(timer, &now);
|
||||
if (this_due <= 1)
|
||||
{
|
||||
int save_timer_busy = timer_busy;
|
||||
int save_vgetc_busy = vgetc_busy;
|
||||
int did_emsg_save = did_emsg;
|
||||
int called_emsg_save = called_emsg;
|
||||
int did_throw_save = did_throw;
|
||||
int save_did_emsg = did_emsg;
|
||||
int save_called_emsg = called_emsg;
|
||||
int save_must_redraw = must_redraw;
|
||||
int save_trylevel = trylevel;
|
||||
int save_did_throw = did_throw;
|
||||
int save_ex_pressedreturn = get_pressedreturn();
|
||||
except_T *save_current_exception = current_exception;
|
||||
|
||||
/* Create a scope for running the timer callback, ignoring most of
|
||||
* the current scope, such as being inside a try/catch. */
|
||||
timer_busy = timer_busy > 0 || vgetc_busy > 0;
|
||||
vgetc_busy = 0;
|
||||
called_emsg = FALSE;
|
||||
did_emsg = FALSE;
|
||||
did_uncaught_emsg = FALSE;
|
||||
must_redraw = 0;
|
||||
trylevel = 0;
|
||||
did_throw = FALSE;
|
||||
current_exception = NULL;
|
||||
|
||||
timer->tr_firing = TRUE;
|
||||
timer_callback(timer);
|
||||
timer->tr_firing = FALSE;
|
||||
|
||||
timer_next = timer->tr_next;
|
||||
did_one = TRUE;
|
||||
timer_busy = save_timer_busy;
|
||||
vgetc_busy = save_vgetc_busy;
|
||||
if (called_emsg)
|
||||
{
|
||||
if (did_uncaught_emsg)
|
||||
++timer->tr_emsg_count;
|
||||
if (!did_throw_save && did_throw && current_exception != NULL)
|
||||
discard_current_exception();
|
||||
}
|
||||
did_emsg = did_emsg_save;
|
||||
called_emsg = called_emsg_save;
|
||||
did_emsg = save_did_emsg;
|
||||
called_emsg = save_called_emsg;
|
||||
trylevel = save_trylevel;
|
||||
did_throw = save_did_throw;
|
||||
current_exception = save_current_exception;
|
||||
if (must_redraw != 0)
|
||||
need_update_screen = TRUE;
|
||||
must_redraw = must_redraw > save_must_redraw
|
||||
? must_redraw : save_must_redraw;
|
||||
set_pressedreturn(save_ex_pressedreturn);
|
||||
|
||||
/* Only fire the timer again if it repeats and stop_timer() wasn't
|
||||
* called while inside the callback (tr_id == -1). */
|
||||
@@ -1247,7 +1269,7 @@ check_due_timer(void)
|
||||
&& timer->tr_emsg_count < 3)
|
||||
{
|
||||
profile_setlimit(timer->tr_interval, &timer->tr_due);
|
||||
this_due = GET_TIMEDIFF(timer, now);
|
||||
this_due = timer_time_left(timer, &now);
|
||||
if (this_due < 1)
|
||||
this_due = 1;
|
||||
if (timer->tr_repeat > 0)
|
||||
@@ -1265,7 +1287,7 @@ check_due_timer(void)
|
||||
}
|
||||
|
||||
if (did_one)
|
||||
redraw_after_callback();
|
||||
redraw_after_callback(need_update_screen);
|
||||
|
||||
return current_id != last_timer_id ? 1 : next_due;
|
||||
}
|
||||
@@ -1325,9 +1347,6 @@ add_timer_info(typval_T *rettv, timer_T *timer)
|
||||
dictitem_T *di;
|
||||
long remaining;
|
||||
proftime_T now;
|
||||
# ifdef WIN3264
|
||||
LARGE_INTEGER fr;
|
||||
#endif
|
||||
|
||||
if (dict == NULL)
|
||||
return;
|
||||
@@ -1337,10 +1356,7 @@ add_timer_info(typval_T *rettv, timer_T *timer)
|
||||
dict_add_nr_str(dict, "time", (long)timer->tr_interval, NULL);
|
||||
|
||||
profile_start(&now);
|
||||
# ifdef WIN3264
|
||||
QueryPerformanceFrequency(&fr);
|
||||
# endif
|
||||
remaining = GET_TIMEDIFF(timer, now);
|
||||
remaining = timer_time_left(timer, &now);
|
||||
dict_add_nr_str(dict, "remaining", (long)remaining, NULL);
|
||||
|
||||
dict_add_nr_str(dict, "repeat",
|
||||
@@ -1934,9 +1950,9 @@ check_changed(buf_T *buf, int flags)
|
||||
}
|
||||
#endif
|
||||
if (flags & CCGD_EXCMD)
|
||||
EMSG(_(e_nowrtmsg));
|
||||
no_write_message();
|
||||
else
|
||||
EMSG(_(e_nowrtmsg_nobang));
|
||||
no_write_message_nobang();
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
@@ -1981,9 +1997,7 @@ dialog_changed(
|
||||
buf_T *buf2;
|
||||
exarg_T ea;
|
||||
|
||||
dialog_msg(buff, _("Save changes to \"%s\"?"),
|
||||
(buf->b_fname != NULL) ?
|
||||
buf->b_fname : (char_u *)_("Untitled"));
|
||||
dialog_msg(buff, _("Save changes to \"%s\"?"), buf->b_fname);
|
||||
if (checkall)
|
||||
ret = vim_dialog_yesnoallcancel(VIM_QUESTION, NULL, buff, 1);
|
||||
else
|
||||
@@ -2064,7 +2078,7 @@ dialog_changed(
|
||||
int
|
||||
can_abandon(buf_T *buf, int forceit)
|
||||
{
|
||||
return ( P_HID(buf)
|
||||
return ( buf_hide(buf)
|
||||
|| !bufIsChanged(buf)
|
||||
|| buf->b_nwindows > 1
|
||||
|| autowrite(buf, forceit) == OK
|
||||
@@ -2106,10 +2120,8 @@ check_changed_any(
|
||||
int bufnum = 0;
|
||||
int bufcount = 0;
|
||||
int *bufnrs;
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp;
|
||||
win_T *wp;
|
||||
#endif
|
||||
|
||||
FOR_ALL_BUFFERS(buf)
|
||||
++bufcount;
|
||||
@@ -2123,7 +2135,6 @@ check_changed_any(
|
||||
|
||||
/* curbuf */
|
||||
bufnrs[bufnum++] = curbuf->b_fnum;
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* buf in curtab */
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
if (wp->w_buffer != curbuf)
|
||||
@@ -2134,7 +2145,6 @@ check_changed_any(
|
||||
if (tp != curtab)
|
||||
for (wp = tp->tp_firstwin; wp != NULL; wp = wp->w_next)
|
||||
add_bufnum(bufnrs, &bufnum, wp->w_buffer->b_fnum);
|
||||
#endif
|
||||
/* any other buf */
|
||||
FOR_ALL_BUFFERS(buf)
|
||||
add_bufnum(bufnrs, &bufnum, buf->b_fnum);
|
||||
@@ -2180,7 +2190,14 @@ check_changed_any(
|
||||
msg_col = 0;
|
||||
msg_didout = FALSE;
|
||||
}
|
||||
if (EMSG2(_("E162: No write since last change for buffer \"%s\""),
|
||||
if (
|
||||
#ifdef FEAT_TERMINAL
|
||||
term_job_running(buf->b_term)
|
||||
? EMSG2(_("E947: Job still running in buffer \"%s\""),
|
||||
buf->b_fname)
|
||||
:
|
||||
#endif
|
||||
EMSG2(_("E162: No write since last change for buffer \"%s\""),
|
||||
buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname))
|
||||
{
|
||||
save = no_wait_return;
|
||||
@@ -2190,29 +2207,27 @@ check_changed_any(
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Try to find a window that contains the buffer. */
|
||||
if (buf != curbuf)
|
||||
FOR_ALL_TAB_WINDOWS(tp, wp)
|
||||
if (wp->w_buffer == buf)
|
||||
{
|
||||
# ifdef FEAT_AUTOCMD
|
||||
#ifdef FEAT_AUTOCMD
|
||||
bufref_T bufref;
|
||||
|
||||
set_bufref(&bufref, buf);
|
||||
# endif
|
||||
#endif
|
||||
goto_tabpage_win(tp, wp);
|
||||
# ifdef FEAT_AUTOCMD
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* Paranoia: did autocms wipe out the buffer with changes? */
|
||||
if (!bufref_valid(&bufref))
|
||||
{
|
||||
goto theend;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
goto buf_found;
|
||||
}
|
||||
buf_found:
|
||||
#endif
|
||||
|
||||
/* Open the changed buffer in the current window. */
|
||||
if (buf != curbuf)
|
||||
@@ -2320,8 +2335,8 @@ do_one_arg(char_u *str)
|
||||
* Separate the arguments in "str" and return a list of pointers in the
|
||||
* growarray "gap".
|
||||
*/
|
||||
int
|
||||
get_arglist(garray_T *gap, char_u *str)
|
||||
static int
|
||||
get_arglist(garray_T *gap, char_u *str, int escaped)
|
||||
{
|
||||
ga_init2(gap, (int)sizeof(char_u *), 20);
|
||||
while (*str != NUL)
|
||||
@@ -2333,6 +2348,10 @@ get_arglist(garray_T *gap, char_u *str)
|
||||
}
|
||||
((char_u **)gap->ga_data)[gap->ga_len++] = str;
|
||||
|
||||
/* If str is escaped, don't handle backslashes or spaces */
|
||||
if (!escaped)
|
||||
return OK;
|
||||
|
||||
/* Isolate one argument, change it in-place, put a NUL after it. */
|
||||
str = do_one_arg(str);
|
||||
}
|
||||
@@ -2355,7 +2374,7 @@ get_arglist_exp(
|
||||
garray_T ga;
|
||||
int i;
|
||||
|
||||
if (get_arglist(&ga, str) == FAIL)
|
||||
if (get_arglist(&ga, str, TRUE) == FAIL)
|
||||
return FAIL;
|
||||
if (wig == TRUE)
|
||||
i = expand_wildcards(ga.ga_len, (char_u **)ga.ga_data,
|
||||
@@ -2401,6 +2420,7 @@ do_arglist(
|
||||
char_u *p;
|
||||
int match;
|
||||
#endif
|
||||
int arg_escaped = TRUE;
|
||||
|
||||
/*
|
||||
* Set default argument for ":argadd" command.
|
||||
@@ -2410,12 +2430,13 @@ do_arglist(
|
||||
if (curbuf->b_ffname == NULL)
|
||||
return FAIL;
|
||||
str = curbuf->b_fname;
|
||||
arg_escaped = FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Collect all file name arguments in "new_ga".
|
||||
*/
|
||||
if (get_arglist(&new_ga, str) == FAIL)
|
||||
if (get_arglist(&new_ga, str, arg_escaped) == FAIL)
|
||||
return FAIL;
|
||||
|
||||
#ifdef FEAT_LISTCMDS
|
||||
@@ -2498,16 +2519,12 @@ do_arglist(
|
||||
static void
|
||||
alist_check_arg_idx(void)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *win;
|
||||
tabpage_T *tp;
|
||||
|
||||
FOR_ALL_TAB_WINDOWS(tp, win)
|
||||
if (win->w_alist == curwin->w_alist)
|
||||
check_arg_idx(win);
|
||||
#else
|
||||
check_arg_idx(curwin);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2539,9 +2556,7 @@ check_arg_idx(win_T *win)
|
||||
win->w_arg_idx_invalid = TRUE;
|
||||
if (win->w_arg_idx != WARGCOUNT(win) - 1
|
||||
&& arg_had_last == FALSE
|
||||
#ifdef FEAT_WINDOWS
|
||||
&& ALIST(win) == &global_alist
|
||||
#endif
|
||||
&& GARGCOUNT > 0
|
||||
&& win->w_arg_idx < GARGCOUNT
|
||||
&& (win->w_buffer->b_fnum == GARGLIST[GARGCOUNT - 1].ae_fnum
|
||||
@@ -2556,10 +2571,7 @@ check_arg_idx(win_T *win)
|
||||
* Set "arg_had_last" if it's also the last one */
|
||||
win->w_arg_idx_invalid = FALSE;
|
||||
if (win->w_arg_idx == WARGCOUNT(win) - 1
|
||||
#ifdef FEAT_WINDOWS
|
||||
&& win->w_alist == &global_alist
|
||||
#endif
|
||||
)
|
||||
&& win->w_alist == &global_alist)
|
||||
arg_had_last = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -2574,7 +2586,7 @@ ex_args(exarg_T *eap)
|
||||
|
||||
if (eap->cmdidx != CMD_args)
|
||||
{
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_LISTCMDS)
|
||||
#if defined(FEAT_LISTCMDS)
|
||||
alist_unlink(ALIST(curwin));
|
||||
if (eap->cmdidx == CMD_argglobal)
|
||||
ALIST(curwin) = &global_alist;
|
||||
@@ -2595,7 +2607,7 @@ ex_args(exarg_T *eap)
|
||||
ex_next(eap);
|
||||
}
|
||||
else
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_LISTCMDS)
|
||||
#if defined(FEAT_LISTCMDS)
|
||||
if (eap->cmdidx == CMD_args)
|
||||
#endif
|
||||
{
|
||||
@@ -2618,7 +2630,7 @@ ex_args(exarg_T *eap)
|
||||
}
|
||||
}
|
||||
}
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_LISTCMDS)
|
||||
#if defined(FEAT_LISTCMDS)
|
||||
else if (eap->cmdidx == CMD_arglocal)
|
||||
{
|
||||
garray_T *gap = &curwin->w_alist->al_ga;
|
||||
@@ -2712,7 +2724,6 @@ do_argfile(exarg_T *eap, int argn)
|
||||
need_mouse_correct = TRUE;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* split window or create new tab page first */
|
||||
if (*eap->cmd == 's' || cmdmod.tab != 0)
|
||||
{
|
||||
@@ -2721,20 +2732,19 @@ do_argfile(exarg_T *eap, int argn)
|
||||
RESET_BINDING(curwin);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/*
|
||||
* if 'hidden' set, only check for changed file when re-editing
|
||||
* the same buffer
|
||||
*/
|
||||
other = TRUE;
|
||||
if (P_HID(curbuf))
|
||||
if (buf_hide(curbuf))
|
||||
{
|
||||
p = fix_fname(alist_name(&ARGLIST[argn]));
|
||||
other = otherfile(p);
|
||||
vim_free(p);
|
||||
}
|
||||
if ((!P_HID(curbuf) || !other)
|
||||
if ((!buf_hide(curbuf) || !other)
|
||||
&& check_changed(curbuf, CCGD_AW
|
||||
| (other ? 0 : CCGD_MULTWIN)
|
||||
| (eap->forceit ? CCGD_FORCEIT : 0)
|
||||
@@ -2743,11 +2753,7 @@ do_argfile(exarg_T *eap, int argn)
|
||||
}
|
||||
|
||||
curwin->w_arg_idx = argn;
|
||||
if (argn == ARGCOUNT - 1
|
||||
#ifdef FEAT_WINDOWS
|
||||
&& curwin->w_alist == &global_alist
|
||||
#endif
|
||||
)
|
||||
if (argn == ARGCOUNT - 1 && curwin->w_alist == &global_alist)
|
||||
arg_had_last = TRUE;
|
||||
|
||||
/* Edit the file; always use the last known line number.
|
||||
@@ -2755,7 +2761,7 @@ do_argfile(exarg_T *eap, int argn)
|
||||
* argument index. */
|
||||
if (do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL,
|
||||
eap, ECMD_LAST,
|
||||
(P_HID(curwin->w_buffer) ? ECMD_HIDE : 0)
|
||||
(buf_hide(curwin->w_buffer) ? ECMD_HIDE : 0)
|
||||
+ (eap->forceit ? ECMD_FORCEIT : 0), curwin) == FAIL)
|
||||
curwin->w_arg_idx = old_arg_idx;
|
||||
/* like Vi: set the mark where the cursor is in the file. */
|
||||
@@ -2776,7 +2782,7 @@ ex_next(exarg_T *eap)
|
||||
* check for changed buffer now, if this fails the argument list is not
|
||||
* redefined.
|
||||
*/
|
||||
if ( P_HID(curbuf)
|
||||
if ( buf_hide(curbuf)
|
||||
|| eap->cmdidx == CMD_snext
|
||||
|| !check_changed(curbuf, CCGD_AW
|
||||
| (eap->forceit ? CCGD_FORCEIT : 0)
|
||||
@@ -2887,10 +2893,8 @@ ex_argdelete(exarg_T *eap)
|
||||
ex_listdo(exarg_T *eap)
|
||||
{
|
||||
int i;
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
tabpage_T *tp;
|
||||
#endif
|
||||
buf_T *buf = curbuf;
|
||||
int next_fnum = 0;
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
|
||||
@@ -2902,14 +2906,6 @@ ex_listdo(exarg_T *eap)
|
||||
int qf_idx;
|
||||
#endif
|
||||
|
||||
#ifndef FEAT_WINDOWS
|
||||
if (eap->cmdidx == CMD_windo)
|
||||
{
|
||||
ex_ni(eap);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FEAT_QUICKFIX
|
||||
if (eap->cmdidx == CMD_cdo || eap->cmdidx == CMD_ldo ||
|
||||
eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo)
|
||||
@@ -2931,20 +2927,17 @@ ex_listdo(exarg_T *eap)
|
||||
|
||||
if (eap->cmdidx == CMD_windo
|
||||
|| eap->cmdidx == CMD_tabdo
|
||||
|| P_HID(curbuf)
|
||||
|| buf_hide(curbuf)
|
||||
|| !check_changed(curbuf, CCGD_AW
|
||||
| (eap->forceit ? CCGD_FORCEIT : 0)
|
||||
| CCGD_EXCMD))
|
||||
{
|
||||
i = 0;
|
||||
/* start at the eap->line1 argument/window/buffer */
|
||||
#ifdef FEAT_WINDOWS
|
||||
wp = firstwin;
|
||||
tp = first_tabpage;
|
||||
#endif
|
||||
switch (eap->cmdidx)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
case CMD_windo:
|
||||
for ( ; wp != NULL && i + 1 < eap->line1; wp = wp->w_next)
|
||||
i++;
|
||||
@@ -2953,7 +2946,6 @@ ex_listdo(exarg_T *eap)
|
||||
for( ; tp != NULL && i + 1 < eap->line1; tp = tp->tp_next)
|
||||
i++;
|
||||
break;
|
||||
#endif
|
||||
case CMD_argdo:
|
||||
i = eap->line1 - 1;
|
||||
break;
|
||||
@@ -3019,7 +3011,6 @@ ex_listdo(exarg_T *eap)
|
||||
if (curwin->w_arg_idx != i)
|
||||
break;
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
else if (eap->cmdidx == CMD_windo)
|
||||
{
|
||||
/* go to window "wp" */
|
||||
@@ -3038,7 +3029,6 @@ ex_listdo(exarg_T *eap)
|
||||
goto_tabpage_tp(tp, TRUE, TRUE);
|
||||
tp = tp->tp_next;
|
||||
}
|
||||
#endif
|
||||
else if (eap->cmdidx == CMD_bufdo)
|
||||
{
|
||||
/* Remember the number of the next listed buffer, in case
|
||||
@@ -3110,11 +3100,9 @@ ex_listdo(exarg_T *eap)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (eap->cmdidx == CMD_windo || eap->cmdidx == CMD_tabdo)
|
||||
if (i+1 > eap->line2)
|
||||
break;
|
||||
#endif
|
||||
if (eap->cmdidx == CMD_argdo && i >= eap->line2)
|
||||
break;
|
||||
}
|
||||
@@ -3736,6 +3724,7 @@ ex_packadd(exarg_T *eap)
|
||||
ex_options(
|
||||
exarg_T *eap UNUSED)
|
||||
{
|
||||
vim_setenv((char_u *)"OPTWIN_CMD", (char_u *)(cmdmod.tab ? "tab" : ""));
|
||||
cmd_source((char_u *)SYS_OPTWIN_FILE, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
346
src/ex_docmd.c
346
src/ex_docmd.c
@@ -108,7 +108,7 @@ static void ex_blast(exarg_T *eap);
|
||||
# define buflist_list ex_ni
|
||||
# define ex_checktime ex_ni
|
||||
#endif
|
||||
#if !defined(FEAT_LISTCMDS) || !defined(FEAT_WINDOWS)
|
||||
#if !defined(FEAT_LISTCMDS)
|
||||
# define ex_buffer_all ex_ni
|
||||
#endif
|
||||
static char_u *getargcmd(char_u **);
|
||||
@@ -126,7 +126,7 @@ static int getargopt(exarg_T *eap);
|
||||
# define ex_helpgrep ex_ni
|
||||
# define ex_vimgrep ex_ni
|
||||
#endif
|
||||
#if !defined(FEAT_QUICKFIX) || !defined(FEAT_WINDOWS)
|
||||
#if !defined(FEAT_QUICKFIX)
|
||||
# define ex_cclose ex_ni
|
||||
# define ex_copen ex_ni
|
||||
# define ex_cwindow ex_ni
|
||||
@@ -159,7 +159,6 @@ static void ex_colorscheme(exarg_T *eap);
|
||||
static void ex_quit(exarg_T *eap);
|
||||
static void ex_cquit(exarg_T *eap);
|
||||
static void ex_quit_all(exarg_T *eap);
|
||||
#ifdef FEAT_WINDOWS
|
||||
static void ex_close(exarg_T *eap);
|
||||
static void ex_win_close(int forceit, win_T *win, tabpage_T *tp);
|
||||
static void ex_only(exarg_T *eap);
|
||||
@@ -170,20 +169,7 @@ static void ex_tabonly(exarg_T *eap);
|
||||
static void ex_tabnext(exarg_T *eap);
|
||||
static void ex_tabmove(exarg_T *eap);
|
||||
static void ex_tabs(exarg_T *eap);
|
||||
#else
|
||||
# define ex_close ex_ni
|
||||
# define ex_only ex_ni
|
||||
# define ex_all ex_ni
|
||||
# define ex_resize ex_ni
|
||||
# define ex_splitview ex_ni
|
||||
# define ex_stag ex_ni
|
||||
# define ex_tabnext ex_ni
|
||||
# define ex_tabmove ex_ni
|
||||
# define ex_tabs ex_ni
|
||||
# define ex_tabclose ex_ni
|
||||
# define ex_tabonly ex_ni
|
||||
#endif
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
|
||||
#if defined(FEAT_QUICKFIX)
|
||||
static void ex_pclose(exarg_T *eap);
|
||||
static void ex_ptag(exarg_T *eap);
|
||||
static void ex_pedit(exarg_T *eap);
|
||||
@@ -314,11 +300,7 @@ static void ex_equal(exarg_T *eap);
|
||||
static void ex_sleep(exarg_T *eap);
|
||||
static void do_exmap(exarg_T *eap, int isabbrev);
|
||||
static void ex_winsize(exarg_T *eap);
|
||||
#ifdef FEAT_WINDOWS
|
||||
static void ex_wincmd(exarg_T *eap);
|
||||
#else
|
||||
# define ex_wincmd ex_ni
|
||||
#endif
|
||||
#if defined(FEAT_GUI) || defined(UNIX) || defined(VMS) || defined(MSWIN)
|
||||
static void ex_winpos(exarg_T *eap);
|
||||
#else
|
||||
@@ -356,7 +338,7 @@ static void ex_findpat(exarg_T *eap);
|
||||
# define ex_findpat ex_ni
|
||||
# define ex_checkpath ex_ni
|
||||
#endif
|
||||
#if defined(FEAT_FIND_ID) && defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
|
||||
#if defined(FEAT_FIND_ID) && defined(FEAT_QUICKFIX)
|
||||
static void ex_psearch(exarg_T *eap);
|
||||
#else
|
||||
# define ex_psearch ex_ni
|
||||
@@ -1675,7 +1657,6 @@ compute_buffer_local_count(int addr_type, int lnum, int offset)
|
||||
return buf->b_fnum;
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
static int current_win_nr(win_T *win);
|
||||
static int current_tab_nr(tabpage_T *tab);
|
||||
|
||||
@@ -1713,13 +1694,6 @@ current_tab_nr(tabpage_T *tab)
|
||||
# define LAST_WIN_NR current_win_nr(NULL)
|
||||
# define CURRENT_TAB_NR current_tab_nr(curtab)
|
||||
# define LAST_TAB_NR current_tab_nr(NULL)
|
||||
#else
|
||||
# define CURRENT_WIN_NR 1
|
||||
# define LAST_WIN_NR 1
|
||||
# define CURRENT_TAB_NR 1
|
||||
# define LAST_TAB_NR 1
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Execute one Ex command.
|
||||
@@ -1843,16 +1817,12 @@ do_one_cmd(
|
||||
/* When adding an entry, also modify cmd_exists(). */
|
||||
case 'a': if (!checkforcmd(&ea.cmd, "aboveleft", 3))
|
||||
break;
|
||||
#ifdef FEAT_WINDOWS
|
||||
cmdmod.split |= WSP_ABOVE;
|
||||
#endif
|
||||
continue;
|
||||
|
||||
case 'b': if (checkforcmd(&ea.cmd, "belowright", 3))
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
cmdmod.split |= WSP_BELOW;
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
if (checkforcmd(&ea.cmd, "browse", 3))
|
||||
@@ -1864,9 +1834,7 @@ do_one_cmd(
|
||||
}
|
||||
if (!checkforcmd(&ea.cmd, "botright", 2))
|
||||
break;
|
||||
#ifdef FEAT_WINDOWS
|
||||
cmdmod.split |= WSP_BOT;
|
||||
#endif
|
||||
continue;
|
||||
|
||||
case 'c': if (!checkforcmd(&ea.cmd, "confirm", 4))
|
||||
@@ -1937,9 +1905,7 @@ do_one_cmd(
|
||||
|
||||
if (!checkforcmd(&ea.cmd, "leftabove", 5))
|
||||
break;
|
||||
#ifdef FEAT_WINDOWS
|
||||
cmdmod.split |= WSP_ABOVE;
|
||||
#endif
|
||||
continue;
|
||||
|
||||
case 'n': if (checkforcmd(&ea.cmd, "noautocmd", 3))
|
||||
@@ -1963,9 +1929,7 @@ do_one_cmd(
|
||||
|
||||
case 'r': if (!checkforcmd(&ea.cmd, "rightbelow", 6))
|
||||
break;
|
||||
#ifdef FEAT_WINDOWS
|
||||
cmdmod.split |= WSP_BELOW;
|
||||
#endif
|
||||
continue;
|
||||
|
||||
case 's': if (checkforcmd(&ea.cmd, "sandbox", 3))
|
||||
@@ -1993,7 +1957,6 @@ do_one_cmd(
|
||||
|
||||
case 't': if (checkforcmd(&p, "tab", 3))
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
long tabnr = get_address(&ea, &ea.cmd, ADDR_TABS,
|
||||
ea.skip, FALSE, 1);
|
||||
if (tabnr == MAXLNUM)
|
||||
@@ -2008,14 +1971,11 @@ do_one_cmd(
|
||||
cmdmod.tab = tabnr + 1;
|
||||
}
|
||||
ea.cmd = p;
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
if (!checkforcmd(&ea.cmd, "topleft", 2))
|
||||
break;
|
||||
#ifdef FEAT_WINDOWS
|
||||
cmdmod.split |= WSP_TOP;
|
||||
#endif
|
||||
continue;
|
||||
|
||||
case 'u': if (!checkforcmd(&ea.cmd, "unsilent", 3))
|
||||
@@ -2027,9 +1987,7 @@ do_one_cmd(
|
||||
|
||||
case 'v': if (checkforcmd(&ea.cmd, "vertical", 4))
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
cmdmod.split |= WSP_VERT;
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
if (!checkforcmd(&p, "verbose", 4))
|
||||
@@ -2112,11 +2070,9 @@ do_one_cmd(
|
||||
else
|
||||
ea.addr_type = ADDR_LINES;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* :wincmd range depends on the argument. */
|
||||
if (ea.cmdidx == CMD_wincmd && p != NULL)
|
||||
get_wincmd_addr_type(skipwhite(p), &ea);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* repeat for all ',' or ';' separated addresses */
|
||||
@@ -4209,6 +4165,7 @@ set_one_cmd_context(
|
||||
case CMD_cmap: case CMD_cnoremap:
|
||||
case CMD_lmap: case CMD_lnoremap:
|
||||
case CMD_smap: case CMD_snoremap:
|
||||
case CMD_tmap: case CMD_tnoremap:
|
||||
case CMD_xmap: case CMD_xnoremap:
|
||||
return set_context_in_map_cmd(xp, cmd, arg, forceit,
|
||||
FALSE, FALSE, ea.cmdidx);
|
||||
@@ -4220,9 +4177,24 @@ set_one_cmd_context(
|
||||
case CMD_cunmap:
|
||||
case CMD_lunmap:
|
||||
case CMD_sunmap:
|
||||
case CMD_tunmap:
|
||||
case CMD_xunmap:
|
||||
return set_context_in_map_cmd(xp, cmd, arg, forceit,
|
||||
FALSE, TRUE, ea.cmdidx);
|
||||
case CMD_mapclear:
|
||||
case CMD_nmapclear:
|
||||
case CMD_vmapclear:
|
||||
case CMD_omapclear:
|
||||
case CMD_imapclear:
|
||||
case CMD_cmapclear:
|
||||
case CMD_lmapclear:
|
||||
case CMD_smapclear:
|
||||
case CMD_tmapclear:
|
||||
case CMD_xmapclear:
|
||||
xp->xp_context = EXPAND_MAPCLEAR;
|
||||
xp->xp_pattern = arg;
|
||||
break;
|
||||
|
||||
case CMD_abbreviate: case CMD_noreabbrev:
|
||||
case CMD_cabbrev: case CMD_cnoreabbrev:
|
||||
case CMD_iabbrev: case CMD_inoreabbrev:
|
||||
@@ -5964,6 +5936,7 @@ static struct
|
||||
&& (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
|
||||
{EXPAND_LOCALES, "locale"},
|
||||
#endif
|
||||
{EXPAND_MAPCLEAR, "mapclear"},
|
||||
{EXPAND_MAPPINGS, "mapping"},
|
||||
{EXPAND_MENUS, "menu"},
|
||||
{EXPAND_MESSAGES, "messages"},
|
||||
@@ -6317,7 +6290,8 @@ ex_command(exarg_T *eap)
|
||||
{
|
||||
++p;
|
||||
end = skiptowhite(p);
|
||||
if (uc_scan_attr(p, end - p, &argt, &def, &flags, &compl, &compl_arg, &addr_type_arg)
|
||||
if (uc_scan_attr(p, end - p, &argt, &def, &flags, &compl,
|
||||
&compl_arg, &addr_type_arg)
|
||||
== FAIL)
|
||||
return;
|
||||
p = skipwhite(end);
|
||||
@@ -6358,7 +6332,7 @@ ex_command(exarg_T *eap)
|
||||
}
|
||||
else
|
||||
uc_add_command(name, end - name, p, argt, def, flags, compl, compl_arg,
|
||||
addr_type_arg, eap->forceit);
|
||||
addr_type_arg, eap->forceit);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -6578,8 +6552,18 @@ uc_check_code(
|
||||
char_u *p = code + 1;
|
||||
size_t l = len - 2;
|
||||
int quote = 0;
|
||||
enum { ct_ARGS, ct_BANG, ct_COUNT, ct_LINE1, ct_LINE2, ct_MODS,
|
||||
ct_REGISTER, ct_LT, ct_NONE } type = ct_NONE;
|
||||
enum {
|
||||
ct_ARGS,
|
||||
ct_BANG,
|
||||
ct_COUNT,
|
||||
ct_LINE1,
|
||||
ct_LINE2,
|
||||
ct_RANGE,
|
||||
ct_MODS,
|
||||
ct_REGISTER,
|
||||
ct_LT,
|
||||
ct_NONE
|
||||
} type = ct_NONE;
|
||||
|
||||
if ((vim_strchr((char_u *)"qQfF", *p) != NULL) && p[1] == '-')
|
||||
{
|
||||
@@ -6601,6 +6585,8 @@ uc_check_code(
|
||||
type = ct_LINE1;
|
||||
else if (STRNICMP(p, "line2>", l) == 0)
|
||||
type = ct_LINE2;
|
||||
else if (STRNICMP(p, "range>", l) == 0)
|
||||
type = ct_RANGE;
|
||||
else if (STRNICMP(p, "lt>", l) == 0)
|
||||
type = ct_LT;
|
||||
else if (STRNICMP(p, "reg>", l) == 0 || STRNICMP(p, "register>", l) == 0)
|
||||
@@ -6702,11 +6688,13 @@ uc_check_code(
|
||||
|
||||
case ct_LINE1:
|
||||
case ct_LINE2:
|
||||
case ct_RANGE:
|
||||
case ct_COUNT:
|
||||
{
|
||||
char num_buf[20];
|
||||
long num = (type == ct_LINE1) ? eap->line1 :
|
||||
(type == ct_LINE2) ? eap->line2 :
|
||||
(type == ct_RANGE) ? eap->addr_count :
|
||||
(eap->addr_count > 0) ? eap->line2 : cmd->uc_def;
|
||||
size_t num_len;
|
||||
|
||||
@@ -6763,7 +6751,6 @@ uc_check_code(
|
||||
*buf = '\0';
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* :aboveleft and :leftabove */
|
||||
if (cmdmod.split & WSP_ABOVE)
|
||||
result += add_cmd_modifier(buf, "aboveleft", &multi_mods);
|
||||
@@ -6773,7 +6760,6 @@ uc_check_code(
|
||||
/* :botright */
|
||||
if (cmdmod.split & WSP_BOT)
|
||||
result += add_cmd_modifier(buf, "botright", &multi_mods);
|
||||
#endif
|
||||
|
||||
/* the modifiers that are simple flags */
|
||||
for (i = 0; mod_entries[i].varp != NULL; ++i)
|
||||
@@ -6789,23 +6775,19 @@ uc_check_code(
|
||||
if (msg_silent > 0)
|
||||
result += add_cmd_modifier(buf,
|
||||
emsg_silent > 0 ? "silent!" : "silent", &multi_mods);
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* :tab */
|
||||
if (cmdmod.tab > 0)
|
||||
result += add_cmd_modifier(buf, "tab", &multi_mods);
|
||||
/* :topleft */
|
||||
if (cmdmod.split & WSP_TOP)
|
||||
result += add_cmd_modifier(buf, "topleft", &multi_mods);
|
||||
#endif
|
||||
/* TODO: How to support :unsilent?*/
|
||||
/* :verbose */
|
||||
if (p_verbose > 0)
|
||||
result += add_cmd_modifier(buf, "verbose", &multi_mods);
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* :vertical */
|
||||
if (cmdmod.split & WSP_VERT)
|
||||
result += add_cmd_modifier(buf, "vertical", &multi_mods);
|
||||
#endif
|
||||
if (quote && buf != NULL)
|
||||
{
|
||||
buf += result - 2;
|
||||
@@ -7238,9 +7220,7 @@ not_exiting(void)
|
||||
static void
|
||||
ex_quit(exarg_T *eap)
|
||||
{
|
||||
#if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD)
|
||||
win_T *wp;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
@@ -7255,7 +7235,6 @@ ex_quit(exarg_T *eap)
|
||||
text_locked_msg();
|
||||
return;
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (eap->addr_count > 0)
|
||||
{
|
||||
int wnr = eap->line2;
|
||||
@@ -7265,19 +7244,13 @@ ex_quit(exarg_T *eap)
|
||||
break;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD)
|
||||
wp = curwin;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf);
|
||||
/* Refuse to quit when locked or when the buffer in the last window is
|
||||
* being closed (can only happen in autocommands). */
|
||||
if (curbuf_locked()
|
||||
# ifdef FEAT_WINDOWS
|
||||
|| !win_valid(wp)
|
||||
# endif
|
||||
if (curbuf_locked() || !win_valid(wp)
|
||||
|| (wp->w_buffer->b_nwindows == 1 && wp->w_buffer->b_locked > 0))
|
||||
return;
|
||||
#endif
|
||||
@@ -7291,7 +7264,7 @@ ex_quit(exarg_T *eap)
|
||||
*/
|
||||
if (check_more(FALSE, eap->forceit) == OK && only_one_window())
|
||||
exiting = TRUE;
|
||||
if ((!P_HID(curbuf)
|
||||
if ((!buf_hide(curbuf)
|
||||
&& check_changed(curbuf, (p_awa ? CCGD_AW : 0)
|
||||
| (eap->forceit ? CCGD_FORCEIT : 0)
|
||||
| CCGD_EXCMD))
|
||||
@@ -7302,7 +7275,6 @@ ex_quit(exarg_T *eap)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* quit last window
|
||||
* Note: only_one_window() returns true, even so a help window is
|
||||
* still open. In that case only quit, if no address has been
|
||||
@@ -7311,15 +7283,12 @@ ex_quit(exarg_T *eap)
|
||||
* :h|wincmd w|q - quit
|
||||
*/
|
||||
if (only_one_window() && (ONE_WINDOW || eap->addr_count == 0))
|
||||
#endif
|
||||
getout(0);
|
||||
#ifdef FEAT_WINDOWS
|
||||
# ifdef FEAT_GUI
|
||||
#ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
/* close window; may free buffer */
|
||||
win_close(wp, !P_HID(wp->w_buffer) || eap->forceit);
|
||||
#endif
|
||||
/* close window; may free buffer */
|
||||
win_close(wp, !buf_hide(wp->w_buffer) || eap->forceit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7370,7 +7339,6 @@ ex_quit_all(exarg_T *eap)
|
||||
not_exiting();
|
||||
}
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
/*
|
||||
* ":close": close current window, unless it is the last one
|
||||
*/
|
||||
@@ -7379,11 +7347,11 @@ ex_close(exarg_T *eap)
|
||||
{
|
||||
win_T *win;
|
||||
int winnr = 0;
|
||||
# ifdef FEAT_CMDWIN
|
||||
#ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
cmdwin_result = Ctrl_C;
|
||||
else
|
||||
# endif
|
||||
#endif
|
||||
if (!text_locked()
|
||||
#ifdef FEAT_AUTOCMD
|
||||
&& !curbuf_locked()
|
||||
@@ -7406,7 +7374,7 @@ ex_close(exarg_T *eap)
|
||||
}
|
||||
}
|
||||
|
||||
# ifdef FEAT_QUICKFIX
|
||||
#ifdef FEAT_QUICKFIX
|
||||
/*
|
||||
* ":pclose": Close any preview window.
|
||||
*/
|
||||
@@ -7422,7 +7390,7 @@ ex_pclose(exarg_T *eap)
|
||||
break;
|
||||
}
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Close window "win" and take care of handling closing the last window for a
|
||||
@@ -7438,9 +7406,9 @@ ex_win_close(
|
||||
buf_T *buf = win->w_buffer;
|
||||
|
||||
need_hide = (bufIsChanged(buf) && buf->b_nwindows <= 1);
|
||||
if (need_hide && !P_HID(buf) && !forceit)
|
||||
if (need_hide && !buf_hide(buf) && !forceit)
|
||||
{
|
||||
# if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
if ((p_confirm || cmdmod.confirm) && p_write)
|
||||
{
|
||||
bufref_T bufref;
|
||||
@@ -7452,22 +7420,22 @@ ex_win_close(
|
||||
need_hide = FALSE;
|
||||
}
|
||||
else
|
||||
# endif
|
||||
#endif
|
||||
{
|
||||
EMSG(_(e_nowrtmsg));
|
||||
no_write_message();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
# ifdef FEAT_GUI
|
||||
#ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* free buffer when not hiding it or when it's a scratch buffer */
|
||||
if (tp == NULL)
|
||||
win_close(win, !need_hide && !P_HID(buf));
|
||||
win_close(win, !need_hide && !buf_hide(buf));
|
||||
else
|
||||
win_close_othertab(win, !need_hide && !P_HID(buf), tp);
|
||||
win_close_othertab(win, !need_hide && !buf_hide(buf), tp);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -7747,18 +7715,16 @@ ex_all(exarg_T *eap)
|
||||
eap->line2 = 9999;
|
||||
do_arg_all((int)eap->line2, eap->forceit, eap->cmdidx == CMD_drop);
|
||||
}
|
||||
#endif /* FEAT_WINDOWS */
|
||||
|
||||
static void
|
||||
ex_hide(exarg_T *eap UNUSED)
|
||||
{
|
||||
/* ":hide" or ":hide | cmd": hide current window */
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (!eap->skip)
|
||||
{
|
||||
# ifdef FEAT_GUI
|
||||
#ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
#endif
|
||||
if (eap->addr_count == 0)
|
||||
win_close(curwin, FALSE); /* don't free buffer */
|
||||
else
|
||||
@@ -7777,7 +7743,6 @@ ex_hide(exarg_T *eap UNUSED)
|
||||
win_close(win, FALSE);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -7855,17 +7820,13 @@ ex_exit(exarg_T *eap)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (only_one_window()) /* quit last window, exit Vim */
|
||||
#endif
|
||||
getout(0);
|
||||
#ifdef FEAT_WINDOWS
|
||||
# ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
/* Quit current window, may free the buffer. */
|
||||
win_close(curwin, !P_HID(curwin->w_buffer));
|
||||
#endif
|
||||
win_close(curwin, !buf_hide(curwin->w_buffer));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7915,7 +7876,7 @@ ex_shell(exarg_T *eap UNUSED)
|
||||
do_shell(NULL, 0);
|
||||
}
|
||||
|
||||
#if (defined(FEAT_WINDOWS) && defined(HAVE_DROP_FILE)) \
|
||||
#if defined(HAVE_DROP_FILE) \
|
||||
|| (defined(FEAT_GUI_GTK) && defined(FEAT_DND)) \
|
||||
|| defined(FEAT_GUI_MSWIN) \
|
||||
|| defined(FEAT_GUI_MAC) \
|
||||
@@ -7960,7 +7921,7 @@ handle_drop(
|
||||
* We don't need to check if the 'hidden' option is set, as in this
|
||||
* case the buffer won't be lost.
|
||||
*/
|
||||
if (!P_HID(curbuf) && !split)
|
||||
if (!buf_hide(curbuf) && !split)
|
||||
{
|
||||
++emsg_off;
|
||||
split = check_changed(curbuf, CCGD_AW);
|
||||
@@ -7968,7 +7929,6 @@ handle_drop(
|
||||
}
|
||||
if (split)
|
||||
{
|
||||
# ifdef FEAT_WINDOWS
|
||||
if (win_split(0, 0) == FAIL)
|
||||
return;
|
||||
RESET_BINDING(curwin);
|
||||
@@ -7977,9 +7937,6 @@ handle_drop(
|
||||
* existing one is overwritten. */
|
||||
alist_unlink(curwin->w_alist);
|
||||
alist_new();
|
||||
# else
|
||||
return; /* can't split, always fail */
|
||||
# endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8026,8 +7983,6 @@ alist_init(alist_T *al)
|
||||
ga_init2(&al->al_ga, (int)sizeof(aentry_T), 5);
|
||||
}
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
|
||||
/*
|
||||
* Remove a reference from an argument list.
|
||||
* Ignored when the argument list is the global one.
|
||||
@@ -8043,7 +7998,7 @@ alist_unlink(alist_T *al)
|
||||
}
|
||||
}
|
||||
|
||||
# if defined(FEAT_LISTCMDS) || defined(HAVE_DROP_FILE) || defined(PROTO)
|
||||
#if defined(FEAT_LISTCMDS) || defined(HAVE_DROP_FILE) || defined(PROTO)
|
||||
/*
|
||||
* Create a new argument list and use it for the current window.
|
||||
*/
|
||||
@@ -8063,7 +8018,6 @@ alist_new(void)
|
||||
alist_init(curwin->w_alist);
|
||||
}
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(UNIX) || defined(PROTO)
|
||||
@@ -8147,9 +8101,7 @@ alist_set(
|
||||
}
|
||||
else
|
||||
FreeWild(count, files);
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (al == &global_alist)
|
||||
#endif
|
||||
arg_had_last = FALSE;
|
||||
}
|
||||
|
||||
@@ -8183,21 +8135,17 @@ alist_add(
|
||||
alist_slash_adjust(void)
|
||||
{
|
||||
int i;
|
||||
# ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
tabpage_T *tp;
|
||||
# endif
|
||||
|
||||
for (i = 0; i < GARGCOUNT; ++i)
|
||||
if (GARGLIST[i].ae_fname != NULL)
|
||||
slash_adjust(GARGLIST[i].ae_fname);
|
||||
# ifdef FEAT_WINDOWS
|
||||
FOR_ALL_TAB_WINDOWS(tp, wp)
|
||||
if (wp->w_alist != &global_alist)
|
||||
for (i = 0; i < WARGCOUNT(wp); ++i)
|
||||
if (WARGLIST(wp)[i].ae_fname != NULL)
|
||||
slash_adjust(WARGLIST(wp)[i].ae_fname);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -8239,7 +8187,6 @@ ex_wrongmodifier(exarg_T *eap)
|
||||
eap->errmsg = e_invcmd;
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* :sview [+command] file split window with new file, read-only
|
||||
* :split [[+command] file] split window with current or new file
|
||||
@@ -8257,18 +8204,18 @@ ex_wrongmodifier(exarg_T *eap)
|
||||
ex_splitview(exarg_T *eap)
|
||||
{
|
||||
win_T *old_curwin = curwin;
|
||||
# if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
|
||||
#if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
|
||||
char_u *fname = NULL;
|
||||
# endif
|
||||
# ifdef FEAT_BROWSE
|
||||
#endif
|
||||
#ifdef FEAT_BROWSE
|
||||
int browse_flag = cmdmod.browse;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# ifdef FEAT_GUI
|
||||
#ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# ifdef FEAT_QUICKFIX
|
||||
#ifdef FEAT_QUICKFIX
|
||||
/* A ":split" in the quickfix window works like ":new". Don't want two
|
||||
* quickfix windows. But it's OK when doing ":tab split". */
|
||||
if (bt_quickfix(curbuf) && cmdmod.tab == 0)
|
||||
@@ -8278,9 +8225,9 @@ ex_splitview(exarg_T *eap)
|
||||
if (eap->cmdidx == CMD_vsplit)
|
||||
eap->cmdidx = CMD_vnew;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# ifdef FEAT_SEARCHPATH
|
||||
#ifdef FEAT_SEARCHPATH
|
||||
if (eap->cmdidx == CMD_sfind || eap->cmdidx == CMD_tabfind)
|
||||
{
|
||||
fname = find_file_in_path(eap->arg, (int)STRLEN(eap->arg),
|
||||
@@ -8289,11 +8236,11 @@ ex_splitview(exarg_T *eap)
|
||||
goto theend;
|
||||
eap->arg = fname;
|
||||
}
|
||||
# ifdef FEAT_BROWSE
|
||||
else
|
||||
# endif
|
||||
# endif
|
||||
# ifdef FEAT_BROWSE
|
||||
else
|
||||
# endif
|
||||
#endif
|
||||
#ifdef FEAT_BROWSE
|
||||
if (cmdmod.browse
|
||||
&& eap->cmdidx != CMD_vnew
|
||||
&& eap->cmdidx != CMD_new)
|
||||
@@ -8321,7 +8268,7 @@ ex_splitview(exarg_T *eap)
|
||||
}
|
||||
}
|
||||
cmdmod.browse = FALSE; /* Don't browse again in do_ecmd(). */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Either open new tab page or split the window.
|
||||
@@ -8502,8 +8449,6 @@ ex_tabs(exarg_T *eap UNUSED)
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* FEAT_WINDOWS */
|
||||
|
||||
/*
|
||||
* ":mode": Set screen mode.
|
||||
* If no argument given, just get the screen size and redraw.
|
||||
@@ -8517,7 +8462,6 @@ ex_mode(exarg_T *eap)
|
||||
mch_screenmode(eap->arg);
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* ":resize".
|
||||
* set, increment or decrement current window height
|
||||
@@ -8556,7 +8500,6 @@ ex_resize(exarg_T *eap)
|
||||
win_setheight_win((int)n, wp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ":find [+command] <file>" command.
|
||||
@@ -8649,9 +8592,7 @@ do_exedit(
|
||||
win_T *old_curwin) /* curwin before doing a split or NULL */
|
||||
{
|
||||
int n;
|
||||
#ifdef FEAT_WINDOWS
|
||||
int need_hide;
|
||||
#endif
|
||||
int exmode_was = exmode_active;
|
||||
|
||||
/*
|
||||
@@ -8706,10 +8647,7 @@ do_exedit(
|
||||
if ((eap->cmdidx == CMD_new
|
||||
|| eap->cmdidx == CMD_tabnew
|
||||
|| eap->cmdidx == CMD_tabedit
|
||||
#ifdef FEAT_WINDOWS
|
||||
|| eap->cmdidx == CMD_vnew
|
||||
#endif
|
||||
) && *eap->arg == NUL)
|
||||
|| eap->cmdidx == CMD_vnew) && *eap->arg == NUL)
|
||||
{
|
||||
/* ":new" or ":tabnew" without argument: edit an new empty buffer */
|
||||
setpcmark();
|
||||
@@ -8717,11 +8655,7 @@ do_exedit(
|
||||
ECMD_HIDE + (eap->forceit ? ECMD_FORCEIT : 0),
|
||||
old_curwin == NULL ? curwin : NULL);
|
||||
}
|
||||
else if ((eap->cmdidx != CMD_split
|
||||
#ifdef FEAT_WINDOWS
|
||||
&& eap->cmdidx != CMD_vsplit
|
||||
#endif
|
||||
)
|
||||
else if ((eap->cmdidx != CMD_split && eap->cmdidx != CMD_vsplit)
|
||||
|| *eap->arg != NUL
|
||||
#ifdef FEAT_BROWSE
|
||||
|| cmdmod.browse
|
||||
@@ -8747,7 +8681,7 @@ do_exedit(
|
||||
(*eap->arg == NUL && eap->do_ecmd_lnum == 0
|
||||
&& vim_strchr(p_cpo, CPO_GOTO1) != NULL)
|
||||
? ECMD_ONE : eap->do_ecmd_lnum,
|
||||
(P_HID(curbuf) ? ECMD_HIDE : 0)
|
||||
(buf_hide(curbuf) ? ECMD_HIDE : 0)
|
||||
+ (eap->forceit ? ECMD_FORCEIT : 0)
|
||||
/* after a split we can use an existing buffer */
|
||||
+ (old_curwin != NULL ? ECMD_OLDBUF : 0)
|
||||
@@ -8757,33 +8691,31 @@ do_exedit(
|
||||
, old_curwin == NULL ? curwin : NULL) == FAIL)
|
||||
{
|
||||
/* Editing the file failed. If the window was split, close it. */
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (old_curwin != NULL)
|
||||
{
|
||||
need_hide = (curbufIsChanged() && curbuf->b_nwindows <= 1);
|
||||
if (!need_hide || P_HID(curbuf))
|
||||
if (!need_hide || buf_hide(curbuf))
|
||||
{
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
cleanup_T cs;
|
||||
|
||||
/* Reset the error/interrupt/exception state here so that
|
||||
* aborting() returns FALSE when closing a window. */
|
||||
enter_cleanup(&cs);
|
||||
# endif
|
||||
# ifdef FEAT_GUI
|
||||
#endif
|
||||
#ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
win_close(curwin, !need_hide && !P_HID(curbuf));
|
||||
#endif
|
||||
win_close(curwin, !need_hide && !buf_hide(curbuf));
|
||||
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
/* Restore the error/interrupt/exception state if not
|
||||
* discarded by a new aborting error, interrupt, or
|
||||
* uncaught exception. */
|
||||
leave_cleanup(&cs);
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (readonlymode && curbuf->b_nwindows == 1)
|
||||
{
|
||||
@@ -8809,7 +8741,6 @@ do_exedit(
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* if ":split file" worked, set alternate file name in old window to new
|
||||
* file
|
||||
@@ -8821,7 +8752,6 @@ do_exedit(
|
||||
&& old_curwin->w_buffer != curbuf
|
||||
&& !cmdmod.keepalt)
|
||||
old_curwin->w_alt_fnum = curbuf->b_fnum;
|
||||
#endif
|
||||
|
||||
ex_no_reprint = TRUE;
|
||||
}
|
||||
@@ -8920,9 +8850,7 @@ ex_syncbind(exarg_T *eap UNUSED)
|
||||
curwin->w_scbind_pos = topline;
|
||||
redraw_later(VALID);
|
||||
cursor_correct();
|
||||
#ifdef FEAT_WINDOWS
|
||||
curwin->w_redr_status = TRUE;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
curwin = save_curwin;
|
||||
@@ -9277,7 +9205,6 @@ ex_winsize(exarg_T *eap)
|
||||
EMSG(_("E465: :winsize requires two number arguments"));
|
||||
}
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
static void
|
||||
ex_wincmd(exarg_T *eap)
|
||||
{
|
||||
@@ -9312,7 +9239,6 @@ ex_wincmd(exarg_T *eap)
|
||||
postponed_split_tab = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_GUI) || defined(UNIX) || defined(VMS) || defined(MSWIN)
|
||||
/*
|
||||
@@ -9833,7 +9759,6 @@ ex_redraw(exarg_T *eap)
|
||||
static void
|
||||
ex_redrawstatus(exarg_T *eap UNUSED)
|
||||
{
|
||||
#if defined(FEAT_WINDOWS)
|
||||
int r = RedrawingDisabled;
|
||||
int p = p_lz;
|
||||
|
||||
@@ -9847,7 +9772,6 @@ ex_redrawstatus(exarg_T *eap UNUSED)
|
||||
RedrawingDisabled = r;
|
||||
p_lz = p;
|
||||
out_flush();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -10425,7 +10349,7 @@ ex_checkpath(exarg_T *eap)
|
||||
(linenr_T)1, (linenr_T)MAXLNUM);
|
||||
}
|
||||
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
|
||||
#if defined(FEAT_QUICKFIX)
|
||||
/*
|
||||
* ":psearch"
|
||||
*/
|
||||
@@ -10496,9 +10420,8 @@ ex_findpat(exarg_T *eap)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
|
||||
# ifdef FEAT_QUICKFIX
|
||||
#ifdef FEAT_QUICKFIX
|
||||
/*
|
||||
* ":ptag", ":ptselect", ":ptjump", ":ptnext", etc.
|
||||
*/
|
||||
@@ -10531,7 +10454,7 @@ ex_pedit(exarg_T *eap)
|
||||
}
|
||||
g_do_tagpreview = 0;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ":stag", ":stselect" and ":stjump".
|
||||
@@ -10546,7 +10469,6 @@ ex_stag(exarg_T *eap)
|
||||
postponed_split_flags = 0;
|
||||
postponed_split_tab = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ":tag", ":tselect", ":tjump", ":tnext", etc.
|
||||
@@ -10621,31 +10543,33 @@ find_cmdline_var(char_u *src, int *usedlen)
|
||||
"%",
|
||||
#define SPEC_PERC 0
|
||||
"#",
|
||||
#define SPEC_HASH 1
|
||||
#define SPEC_HASH (SPEC_PERC + 1)
|
||||
"<cword>", /* cursor word */
|
||||
#define SPEC_CWORD 2
|
||||
#define SPEC_CWORD (SPEC_HASH + 1)
|
||||
"<cWORD>", /* cursor WORD */
|
||||
#define SPEC_CCWORD 3
|
||||
#define SPEC_CCWORD (SPEC_CWORD + 1)
|
||||
"<cexpr>", /* expr under cursor */
|
||||
#define SPEC_CEXPR (SPEC_CCWORD + 1)
|
||||
"<cfile>", /* cursor path name */
|
||||
#define SPEC_CFILE 4
|
||||
#define SPEC_CFILE (SPEC_CEXPR + 1)
|
||||
"<sfile>", /* ":so" file name */
|
||||
#define SPEC_SFILE 5
|
||||
#define SPEC_SFILE (SPEC_CFILE + 1)
|
||||
"<slnum>", /* ":so" file line number */
|
||||
#define SPEC_SLNUM 6
|
||||
#define SPEC_SLNUM (SPEC_SFILE + 1)
|
||||
#ifdef FEAT_AUTOCMD
|
||||
"<afile>", /* autocommand file name */
|
||||
# define SPEC_AFILE 7
|
||||
# define SPEC_AFILE (SPEC_SLNUM + 1)
|
||||
"<abuf>", /* autocommand buffer number */
|
||||
# define SPEC_ABUF 8
|
||||
# define SPEC_ABUF (SPEC_AFILE + 1)
|
||||
"<amatch>", /* autocommand match name */
|
||||
# define SPEC_AMATCH 9
|
||||
# define SPEC_AMATCH (SPEC_ABUF + 1)
|
||||
#endif
|
||||
#ifdef FEAT_CLIENTSERVER
|
||||
"<client>"
|
||||
# ifdef FEAT_AUTOCMD
|
||||
# define SPEC_CLIENT 10
|
||||
# define SPEC_CLIENT (SPEC_AMATCH + 1)
|
||||
# else
|
||||
# define SPEC_CLIENT 7
|
||||
# define SPEC_CLIENT (SPEC_SLNUM + 1)
|
||||
# endif
|
||||
#endif
|
||||
};
|
||||
@@ -10733,10 +10657,13 @@ eval_vars(
|
||||
/*
|
||||
* word or WORD under cursor
|
||||
*/
|
||||
if (spec_idx == SPEC_CWORD || spec_idx == SPEC_CCWORD)
|
||||
if (spec_idx == SPEC_CWORD || spec_idx == SPEC_CCWORD
|
||||
|| spec_idx == SPEC_CEXPR)
|
||||
{
|
||||
resultlen = find_ident_under_cursor(&result, spec_idx == SPEC_CWORD ?
|
||||
(FIND_IDENT|FIND_STRING) : FIND_STRING);
|
||||
resultlen = find_ident_under_cursor(&result,
|
||||
spec_idx == SPEC_CWORD ? (FIND_IDENT | FIND_STRING)
|
||||
: spec_idx == SPEC_CEXPR ? (FIND_IDENT | FIND_STRING | FIND_EVAL)
|
||||
: FIND_STRING);
|
||||
if (resultlen == 0)
|
||||
{
|
||||
*errormsg = (char_u *)"";
|
||||
@@ -11085,7 +11012,7 @@ static int ses_do_frame(frame_T *fr);
|
||||
static int ses_do_win(win_T *wp);
|
||||
static int ses_arglist(FILE *fd, char *cmd, garray_T *gap, int fullname, unsigned *flagp);
|
||||
static int ses_put_fname(FILE *fd, char_u *name, unsigned *flagp);
|
||||
static int ses_fname(FILE *fd, buf_T *buf, unsigned *flagp);
|
||||
static int ses_fname(FILE *fd, buf_T *buf, unsigned *flagp, int add_eol);
|
||||
|
||||
/*
|
||||
* Write openfile commands for the current buffers to an .exrc file.
|
||||
@@ -11181,7 +11108,7 @@ makeopens(
|
||||
{
|
||||
if (fprintf(fd, "badd +%ld ", buf->b_wininfo == NULL ? 1L
|
||||
: buf->b_wininfo->wi_fpos.lnum) < 0
|
||||
|| ses_fname(fd, buf, &ssop_flags) == FAIL)
|
||||
|| ses_fname(fd, buf, &ssop_flags, TRUE) == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
@@ -11275,7 +11202,8 @@ makeopens(
|
||||
)
|
||||
{
|
||||
if (fputs(need_tabnew ? "tabedit " : "edit ", fd) < 0
|
||||
|| ses_fname(fd, wp->w_buffer, &ssop_flags) == FAIL)
|
||||
|| ses_fname(fd, wp->w_buffer, &ssop_flags, TRUE)
|
||||
== FAIL)
|
||||
return FAIL;
|
||||
need_tabnew = FALSE;
|
||||
if (!wp->w_arg_idx_invalid)
|
||||
@@ -11622,9 +11550,20 @@ put_view(
|
||||
/*
|
||||
* Editing a file in this buffer: use ":edit file".
|
||||
* This may have side effects! (e.g., compressed or network file).
|
||||
*
|
||||
* Note, if a buffer for that file already exists, use :badd to
|
||||
* edit that buffer, to not lose folding information (:edit resets
|
||||
* folds in other buffers)
|
||||
*/
|
||||
if (fputs("edit ", fd) < 0
|
||||
|| ses_fname(fd, wp->w_buffer, flagp) == FAIL)
|
||||
if (fputs("if bufexists('", fd) < 0
|
||||
|| ses_fname(fd, wp->w_buffer, flagp, FALSE) == FAIL
|
||||
|| fputs("') | buffer ", fd) < 0
|
||||
|| ses_fname(fd, wp->w_buffer, flagp, FALSE) == FAIL
|
||||
|| fputs(" | else | edit ", fd) < 0
|
||||
|| ses_fname(fd, wp->w_buffer, flagp, FALSE) == FAIL
|
||||
|| fputs(" | endif", fd) < 0
|
||||
||
|
||||
put_eol(fd) == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
else
|
||||
@@ -11637,7 +11576,7 @@ put_view(
|
||||
{
|
||||
/* The buffer does have a name, but it's not a file name. */
|
||||
if (fputs("file ", fd) < 0
|
||||
|| ses_fname(fd, wp->w_buffer, flagp) == FAIL)
|
||||
|| ses_fname(fd, wp->w_buffer, flagp, TRUE) == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
#endif
|
||||
@@ -11809,11 +11748,11 @@ ses_arglist(
|
||||
|
||||
/*
|
||||
* Write a buffer name to the session file.
|
||||
* Also ends the line.
|
||||
* Also ends the line, if "add_eol" is TRUE.
|
||||
* Returns FAIL if writing fails.
|
||||
*/
|
||||
static int
|
||||
ses_fname(FILE *fd, buf_T *buf, unsigned *flagp)
|
||||
ses_fname(FILE *fd, buf_T *buf, unsigned *flagp, int add_eol)
|
||||
{
|
||||
char_u *name;
|
||||
|
||||
@@ -11832,7 +11771,8 @@ ses_fname(FILE *fd, buf_T *buf, unsigned *flagp)
|
||||
name = buf->b_sfname;
|
||||
else
|
||||
name = buf->b_ffname;
|
||||
if (ses_put_fname(fd, name, flagp) == FAIL || put_eol(fd) == FAIL)
|
||||
if (ses_put_fname(fd, name, flagp) == FAIL
|
||||
|| (add_eol && put_eol(fd) == FAIL))
|
||||
return FAIL;
|
||||
return OK;
|
||||
}
|
||||
@@ -12083,6 +12023,14 @@ get_messages_arg(expand_T *xp UNUSED, int idx)
|
||||
}
|
||||
#endif
|
||||
|
||||
char_u *
|
||||
get_mapclear_arg(expand_T *xp UNUSED, int idx)
|
||||
{
|
||||
if (idx == 0)
|
||||
return (char_u *)"<buffer>";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
static int filetype_detect = FALSE;
|
||||
static int filetype_plugin = FALSE;
|
||||
@@ -12360,3 +12308,17 @@ ex_folddo(exarg_T *eap)
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
# if defined(FEAT_TIMERS) || defined(PROTO)
|
||||
int
|
||||
get_pressedreturn(void)
|
||||
{
|
||||
return ex_pressedreturn;
|
||||
}
|
||||
|
||||
void
|
||||
set_pressedreturn(int val)
|
||||
{
|
||||
ex_pressedreturn = val;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1125,7 +1125,7 @@ getcmdline(
|
||||
#ifdef CURSOR_SHAPE
|
||||
ui_cursor_shape(); /* may show different cursor shape */
|
||||
#endif
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP)
|
||||
#if defined(FEAT_KEYMAP)
|
||||
/* Show/unshow value of 'keymap' in status lines later. */
|
||||
status_redraw_curbuf();
|
||||
#endif
|
||||
@@ -1966,11 +1966,9 @@ cmdline_changed:
|
||||
end_pos = curwin->w_cursor; /* shutup gcc 4 */
|
||||
|
||||
validate_cursor();
|
||||
# ifdef FEAT_WINDOWS
|
||||
/* May redraw the status line to show the cursor position. */
|
||||
if (p_ru && curwin->w_status_height > 0)
|
||||
curwin->w_redr_status = TRUE;
|
||||
# endif
|
||||
|
||||
save_cmdline(&save_ccline);
|
||||
update_screen(SOME_VALID);
|
||||
@@ -3468,7 +3466,8 @@ cursorcmd(void)
|
||||
|
||||
windgoto(msg_row, msg_col);
|
||||
#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
|
||||
redrawcmd_preedit();
|
||||
if (p_imst == IM_ON_THE_SPOT)
|
||||
redrawcmd_preedit();
|
||||
#endif
|
||||
#ifdef MCH_CURSOR_SHAPE
|
||||
mch_update_cursor();
|
||||
@@ -4879,6 +4878,7 @@ ExpandFromContext(
|
||||
{
|
||||
{EXPAND_COMMANDS, get_command_name, FALSE, TRUE},
|
||||
{EXPAND_BEHAVE, get_behave_arg, TRUE, TRUE},
|
||||
{EXPAND_MAPCLEAR, get_mapclear_arg, TRUE, TRUE},
|
||||
{EXPAND_MESSAGES, get_messages_arg, TRUE, TRUE},
|
||||
#ifdef FEAT_CMDHIST
|
||||
{EXPAND_HISTORY, get_history_arg, TRUE, TRUE},
|
||||
|
||||
@@ -94,13 +94,11 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* These features used to be optional but are now always enabled.
|
||||
* +windows Multiple windows. Without this there is no help
|
||||
* window and no status lines.
|
||||
* +vertsplit Vertically split windows.
|
||||
*/
|
||||
#ifdef FEAT_SMALL
|
||||
# define FEAT_WINDOWS
|
||||
#endif
|
||||
|
||||
/*
|
||||
* +listcmds Vim commands for the buffer list and the argument
|
||||
@@ -134,8 +132,8 @@
|
||||
# define FEAT_JUMPLIST
|
||||
#endif
|
||||
|
||||
/* the cmdline-window requires FEAT_WINDOWS and FEAT_CMDHIST */
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_CMDHIST)
|
||||
/* the cmdline-window requires FEAT_CMDHIST */
|
||||
#if defined(FEAT_CMDHIST)
|
||||
# define FEAT_CMDWIN
|
||||
#endif
|
||||
|
||||
@@ -452,7 +450,7 @@
|
||||
* +diff Displaying diffs in a nice way.
|
||||
* Requires +windows and +autocmd.
|
||||
*/
|
||||
#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS) && defined(FEAT_AUTOCMD)
|
||||
#if defined(FEAT_NORMAL) && defined(FEAT_AUTOCMD)
|
||||
# define FEAT_DIFF
|
||||
#endif
|
||||
|
||||
@@ -490,7 +488,7 @@
|
||||
/*
|
||||
* +wildmenu 'wildmenu' option
|
||||
*/
|
||||
#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
|
||||
#if defined(FEAT_NORMAL)
|
||||
# define FEAT_WILDMENU
|
||||
#endif
|
||||
|
||||
@@ -595,7 +593,7 @@
|
||||
* +mksession ":mksession" command.
|
||||
* Requires +windows and +vertsplit.
|
||||
*/
|
||||
#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
|
||||
#if defined(FEAT_NORMAL)
|
||||
# define FEAT_SESSION
|
||||
#endif
|
||||
|
||||
@@ -706,14 +704,14 @@
|
||||
/*
|
||||
* +scrollbind synchronization of split windows
|
||||
*/
|
||||
#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
|
||||
#if defined(FEAT_NORMAL)
|
||||
# define FEAT_SCROLLBIND
|
||||
#endif
|
||||
|
||||
/*
|
||||
* +cursorbind synchronization of split windows
|
||||
*/
|
||||
#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
|
||||
#if defined(FEAT_NORMAL)
|
||||
# define FEAT_CURSORBIND
|
||||
#endif
|
||||
|
||||
@@ -754,7 +752,7 @@
|
||||
/*
|
||||
* GUI tabline
|
||||
*/
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_NORMAL) \
|
||||
#if defined(FEAT_NORMAL) \
|
||||
&& (defined(FEAT_GUI_GTK) \
|
||||
|| (defined(FEAT_GUI_MOTIF) && defined(HAVE_XM_NOTEBOOK_H)) \
|
||||
|| defined(FEAT_GUI_MAC) \
|
||||
@@ -1269,10 +1267,15 @@
|
||||
|
||||
/*
|
||||
* +terminal ":terminal" command. Runs a terminal in a window.
|
||||
* requires +channel and +multibyte
|
||||
*/
|
||||
#if !defined(FEAT_JOB_CHANNEL) && defined(FEAT_TERMINAL)
|
||||
#if defined(FEAT_TERMINAL) && \
|
||||
!(defined(FEAT_JOB_CHANNEL) && defined(FEAT_MBYTE))
|
||||
# undef FEAT_TERMINAL
|
||||
#endif
|
||||
#if defined(FEAT_TERMINAL) && !defined(CURSOR_SHAPE)
|
||||
# define CURSOR_SHAPE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* +signs Allow signs to be displayed to the left of text lines.
|
||||
|
||||
36
src/fileio.c
36
src/fileio.c
@@ -1370,7 +1370,8 @@ retry:
|
||||
* Decrypt the read bytes. This is done before checking for
|
||||
* EOF because the crypt layer may be buffering.
|
||||
*/
|
||||
if (cryptkey != NULL && size > 0)
|
||||
if (cryptkey != NULL && curbuf->b_cryptstate != NULL
|
||||
&& size > 0)
|
||||
{
|
||||
if (crypt_works_inplace(curbuf->b_cryptstate))
|
||||
{
|
||||
@@ -4173,9 +4174,7 @@ buf_write(
|
||||
#ifdef FEAT_TITLE
|
||||
need_maketitle = TRUE; /* set window title later */
|
||||
#endif
|
||||
#ifdef FEAT_WINDOWS
|
||||
status_redraw_all(); /* redraw status lines later */
|
||||
#endif
|
||||
}
|
||||
|
||||
if (end > buf->b_ml.ml_line_count)
|
||||
@@ -6196,10 +6195,8 @@ shorten_fnames(int force)
|
||||
* also have a swap file. */
|
||||
mf_fullname(buf->b_ml.ml_mfp);
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
status_redraw_all();
|
||||
redraw_tabline = TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (defined(FEAT_DND) && defined(FEAT_GUI_GTK)) \
|
||||
@@ -6889,6 +6886,9 @@ buf_check_timestamp(
|
||||
#endif
|
||||
#ifdef FEAT_NETBEANS_INTG
|
||||
|| isNetbeansBuffer(buf)
|
||||
#endif
|
||||
#ifdef FEAT_TERMINAL
|
||||
|| buf->b_term != NULL
|
||||
#endif
|
||||
)
|
||||
return 0;
|
||||
@@ -8959,9 +8959,7 @@ aucmd_prepbuf(
|
||||
buf_T *buf) /* new curbuf */
|
||||
{
|
||||
win_T *win;
|
||||
#ifdef FEAT_WINDOWS
|
||||
int save_ea;
|
||||
#endif
|
||||
#ifdef FEAT_AUTOCHDIR
|
||||
int save_acd;
|
||||
#endif
|
||||
@@ -8970,13 +8968,9 @@ aucmd_prepbuf(
|
||||
if (buf == curbuf) /* be quick when buf is curbuf */
|
||||
win = curwin;
|
||||
else
|
||||
#ifdef FEAT_WINDOWS
|
||||
FOR_ALL_WINDOWS(win)
|
||||
if (win->w_buffer == buf)
|
||||
break;
|
||||
#else
|
||||
win = NULL;
|
||||
#endif
|
||||
|
||||
/* Allocate "aucmd_win" when needed. If this fails (out of memory) fall
|
||||
* back to using the current window. */
|
||||
@@ -9022,7 +9016,6 @@ aucmd_prepbuf(
|
||||
globaldir = NULL;
|
||||
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Split the current window, put the aucmd_win in the upper half.
|
||||
* We don't want the BufEnter or WinEnter autocommands. */
|
||||
block_autocmds();
|
||||
@@ -9030,20 +9023,19 @@ aucmd_prepbuf(
|
||||
save_ea = p_ea;
|
||||
p_ea = FALSE;
|
||||
|
||||
# ifdef FEAT_AUTOCHDIR
|
||||
#ifdef FEAT_AUTOCHDIR
|
||||
/* Prevent chdir() call in win_enter_ext(), through do_autochdir(). */
|
||||
save_acd = p_acd;
|
||||
p_acd = FALSE;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
(void)win_split_ins(0, WSP_TOP, aucmd_win, 0);
|
||||
(void)win_comp_pos(); /* recompute window positions */
|
||||
p_ea = save_ea;
|
||||
# ifdef FEAT_AUTOCHDIR
|
||||
#ifdef FEAT_AUTOCHDIR
|
||||
p_acd = save_acd;
|
||||
# endif
|
||||
unblock_autocmds();
|
||||
#endif
|
||||
unblock_autocmds();
|
||||
curwin = aucmd_win;
|
||||
}
|
||||
curbuf = buf;
|
||||
@@ -9060,14 +9052,11 @@ aucmd_prepbuf(
|
||||
aucmd_restbuf(
|
||||
aco_save_T *aco) /* structure holding saved values */
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
int dummy;
|
||||
#endif
|
||||
|
||||
if (aco->use_aucmd_win)
|
||||
{
|
||||
--curbuf->b_nwindows;
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Find "aucmd_win", it can't be closed, but it may be in another tab
|
||||
* page. Do not trigger autocommands here. */
|
||||
block_autocmds();
|
||||
@@ -9108,12 +9097,9 @@ win_found:
|
||||
else
|
||||
/* Hmm, original window disappeared. Just use the first one. */
|
||||
curwin = firstwin;
|
||||
# ifdef FEAT_EVAL
|
||||
#ifdef FEAT_EVAL
|
||||
vars_clear(&aucmd_win->w_vars->dv_hashtab); /* free all w: variables */
|
||||
hash_init(&aucmd_win->w_vars->dv_hashtab); /* re-use the hashtab */
|
||||
# endif
|
||||
#else
|
||||
curwin = aco->save_curwin;
|
||||
#endif
|
||||
curbuf = curwin->w_buffer;
|
||||
|
||||
@@ -9139,9 +9125,7 @@ win_found:
|
||||
else
|
||||
{
|
||||
/* restore curwin */
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (win_valid(aco->save_curwin))
|
||||
#endif
|
||||
{
|
||||
/* Restore the buffer which was previously edited by curwin, if
|
||||
* it was changed, we are still the same window and the buffer is
|
||||
|
||||
@@ -95,7 +95,7 @@ static int foldendmarkerlen;
|
||||
|
||||
/* Exported folding functions. {{{1 */
|
||||
/* copyFoldingState() {{{2 */
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
|
||||
/*
|
||||
* Copy that folding state from window "wp_from" to window "wp_to".
|
||||
*/
|
||||
@@ -106,7 +106,6 @@ copyFoldingState(win_T *wp_from, win_T *wp_to)
|
||||
wp_to->w_foldinvalid = wp_from->w_foldinvalid;
|
||||
cloneFoldGrowArray(&wp_from->w_folds, &wp_to->w_folds);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* hasAnyFolding() {{{2 */
|
||||
/*
|
||||
|
||||
@@ -59,7 +59,7 @@ static int block_redo = FALSE;
|
||||
* Returns a value between 0 and 255, index in maphash.
|
||||
* Put Normal/Visual mode mappings mostly separately from Insert/Cmdline mode.
|
||||
*/
|
||||
#define MAP_HASH(mode, c1) (((mode) & (NORMAL + VISUAL + SELECTMODE + OP_PENDING)) ? (c1) : ((c1) ^ 0x80))
|
||||
#define MAP_HASH(mode, c1) (((mode) & (NORMAL + VISUAL + SELECTMODE + OP_PENDING + TERMINAL)) ? (c1) : ((c1) ^ 0x80))
|
||||
|
||||
/*
|
||||
* Each mapping is put in one of the 256 hash lists, to speed up finding it.
|
||||
@@ -125,7 +125,7 @@ static int vgetorpeek(int);
|
||||
static void map_free(mapblock_T **);
|
||||
static void validate_maphash(void);
|
||||
static void showmap(mapblock_T *mp, int local);
|
||||
static int inchar(char_u *buf, int maxlen, long wait_time, int tb_change_cnt);
|
||||
static int inchar(char_u *buf, int maxlen, long wait_time);
|
||||
#ifdef FEAT_EVAL
|
||||
static char_u *eval_map_expr(char_u *str, int c);
|
||||
#endif
|
||||
@@ -462,8 +462,7 @@ flush_buffers(int flush_typeahead)
|
||||
* of an escape sequence.
|
||||
* In an xterm we get one char at a time and we have to get them all.
|
||||
*/
|
||||
while (inchar(typebuf.tb_buf, typebuf.tb_buflen - 1, 10L,
|
||||
typebuf.tb_change_cnt) != 0)
|
||||
while (inchar(typebuf.tb_buf, typebuf.tb_buflen - 1, 10L) != 0)
|
||||
;
|
||||
typebuf.tb_off = MAXMAPLEN;
|
||||
typebuf.tb_len = 0;
|
||||
@@ -1599,8 +1598,13 @@ vgetc(void)
|
||||
{
|
||||
int did_inc = FALSE;
|
||||
|
||||
if (mod_mask) /* no mapping after modifier has been read */
|
||||
if (mod_mask
|
||||
#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
|
||||
|| im_is_preediting()
|
||||
#endif
|
||||
)
|
||||
{
|
||||
/* no mapping after modifier has been read */
|
||||
++no_mapping;
|
||||
++allow_keys;
|
||||
did_inc = TRUE; /* mod_mask may change value */
|
||||
@@ -2046,8 +2050,7 @@ vgetorpeek(int advance)
|
||||
if (got_int)
|
||||
{
|
||||
/* flush all input */
|
||||
c = inchar(typebuf.tb_buf, typebuf.tb_buflen - 1, 0L,
|
||||
typebuf.tb_change_cnt);
|
||||
c = inchar(typebuf.tb_buf, typebuf.tb_buflen - 1, 0L);
|
||||
/*
|
||||
* If inchar() returns TRUE (script file was active) or we
|
||||
* are inside a mapping, get out of insert mode.
|
||||
@@ -2287,10 +2290,8 @@ vgetorpeek(int advance)
|
||||
msg_row = Rows - 1;
|
||||
msg_clr_eos(); /* clear ruler */
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
status_redraw_all();
|
||||
redraw_statuslines();
|
||||
#endif
|
||||
showmode();
|
||||
setcursor();
|
||||
continue;
|
||||
@@ -2610,8 +2611,7 @@ vgetorpeek(int advance)
|
||||
&& (p_timeout
|
||||
|| (keylen == KEYLEN_PART_KEY && p_ttimeout))
|
||||
&& (c = inchar(typebuf.tb_buf + typebuf.tb_off
|
||||
+ typebuf.tb_len, 3, 25L,
|
||||
typebuf.tb_change_cnt)) == 0)
|
||||
+ typebuf.tb_len, 3, 25L)) == 0)
|
||||
{
|
||||
colnr_T col = 0, vcol;
|
||||
char_u *ptr;
|
||||
@@ -2848,7 +2848,7 @@ vgetorpeek(int advance)
|
||||
? -1L
|
||||
: ((keylen == KEYLEN_PART_KEY && p_ttm >= 0)
|
||||
? p_ttm
|
||||
: p_tm)), typebuf.tb_change_cnt);
|
||||
: p_tm)));
|
||||
|
||||
#ifdef FEAT_CMDL_INFO
|
||||
if (i != 0)
|
||||
@@ -2954,12 +2954,12 @@ vgetorpeek(int advance)
|
||||
inchar(
|
||||
char_u *buf,
|
||||
int maxlen,
|
||||
long wait_time, /* milli seconds */
|
||||
int tb_change_cnt)
|
||||
long wait_time) /* milli seconds */
|
||||
{
|
||||
int len = 0; /* init for GCC */
|
||||
int retesc = FALSE; /* return ESC with gotint */
|
||||
int script_char;
|
||||
int tb_change_cnt = typebuf.tb_change_cnt;
|
||||
|
||||
if (wait_time == -1L || wait_time > 100L) /* flush output before waiting */
|
||||
{
|
||||
@@ -3065,9 +3065,17 @@ inchar(
|
||||
len = ui_inchar(buf, maxlen / 3, wait_time, tb_change_cnt);
|
||||
}
|
||||
|
||||
/* If the typebuf was changed further down, it is like nothing was added by
|
||||
* this call. */
|
||||
if (typebuf_changed(tb_change_cnt))
|
||||
return 0;
|
||||
|
||||
/* Note the change in the typeahead buffer, this matters for when
|
||||
* vgetorpeek() is called recursively, e.g. using getchar(1) in a timer
|
||||
* function. */
|
||||
if (len > 0 && ++typebuf.tb_change_cnt == 0)
|
||||
typebuf.tb_change_cnt = 1;
|
||||
|
||||
return fix_input_buffer(buf, len);
|
||||
}
|
||||
|
||||
@@ -3178,6 +3186,7 @@ input_available(void)
|
||||
* for :xmap mode is VISUAL
|
||||
* for :smap mode is SELECTMODE
|
||||
* for :omap mode is OP_PENDING
|
||||
* for :tmap mode is TERMINAL
|
||||
*
|
||||
* for :abbr mode is INSERT + CMDLINE
|
||||
* for :iabbr mode is INSERT
|
||||
@@ -3822,6 +3831,8 @@ get_map_mode(char_u **cmdp, int forceit)
|
||||
mode = SELECTMODE; /* :smap */
|
||||
else if (modec == 'o')
|
||||
mode = OP_PENDING; /* :omap */
|
||||
else if (modec == 't')
|
||||
mode = TERMINAL; /* :tmap */
|
||||
else
|
||||
{
|
||||
--p;
|
||||
@@ -4882,6 +4893,9 @@ makemap(
|
||||
case LANGMAP:
|
||||
c1 = 'l';
|
||||
break;
|
||||
case TERMINAL:
|
||||
c1 = 't';
|
||||
break;
|
||||
default:
|
||||
IEMSG(_("E228: makemap: Illegal mode"));
|
||||
return FAIL;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user