Compare commits
206 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b3bd1d39e6 | ||
|
|
a6feb163f0 | ||
|
|
6b1a99dfe3 | ||
|
|
9a846fbaa5 | ||
|
|
b34689010a | ||
|
|
cbadefe25a | ||
|
|
1f4a3457a3 | ||
|
|
0f7a5e758c | ||
|
|
3a846e6bca | ||
|
|
0699b040e6 | ||
|
|
74409f6279 | ||
|
|
56200eed62 | ||
|
|
e70cec9760 | ||
|
|
460ae5dfca | ||
|
|
b37a65e4bf | ||
|
|
b79ee0c299 | ||
|
|
654b729c4c | ||
|
|
096ca73dac | ||
|
|
d0819d11ec | ||
|
|
436b5adc97 | ||
|
|
f1474d801b | ||
|
|
6d0570117a | ||
|
|
ef089f50f9 | ||
|
|
1a9922243a | ||
|
|
4b1478093e | ||
|
|
eb822a280c | ||
|
|
9a015111a5 | ||
|
|
6ad84ab3e4 | ||
|
|
1fa3de1ce8 | ||
|
|
04fb916684 | ||
|
|
d293981d2b | ||
|
|
94f3192b03 | ||
|
|
4c13e5e676 | ||
|
|
cfe3af284a | ||
|
|
f38aad85cf | ||
|
|
1c67f3a977 | ||
|
|
13789bf103 | ||
|
|
5d2e007ccb | ||
|
|
491669701c | ||
|
|
8e7cc6b920 | ||
|
|
ab16ad33ba | ||
|
|
94fb8274ca | ||
|
|
5a664fe57f | ||
|
|
ba26367fea | ||
|
|
edc6f10390 | ||
|
|
ccc1644f95 | ||
|
|
5d20fbf2e7 | ||
|
|
5ea5f37372 | ||
|
|
3d0abad5bf | ||
|
|
264d3ddac0 | ||
|
|
febb78fa17 | ||
|
|
c97f9a55bd | ||
|
|
10c75c4a09 | ||
|
|
11ceb7d949 | ||
|
|
8c697e3698 | ||
|
|
92f246e4f9 | ||
|
|
06f6095623 | ||
|
|
7473a84cf9 | ||
|
|
4bf1006cae | ||
|
|
8bb3fe4d4d | ||
|
|
d9da86e94e | ||
|
|
90c317f224 | ||
|
|
8b6256f6ec | ||
|
|
be4e223ead | ||
|
|
a4d131d110 | ||
|
|
1cae5a0a03 | ||
|
|
8dac2acd6a | ||
|
|
4b28ba3245 | ||
|
|
af4a61a85d | ||
|
|
5da36052a4 | ||
|
|
bf7ff61af4 | ||
|
|
ef8f04b1d1 | ||
|
|
23018f2d4b | ||
|
|
bbdd3fb804 | ||
|
|
27708e6c7b | ||
|
|
c553a21e18 | ||
|
|
1f318c6eac | ||
|
|
c88ac94a0b | ||
|
|
7319981f21 | ||
|
|
71c41255f6 | ||
|
|
9c23f9bb5f | ||
|
|
71eb3ad579 | ||
|
|
8bb65f230d | ||
|
|
ec86520f94 | ||
|
|
fb9dcb080b | ||
|
|
1802405d71 | ||
|
|
db8e5c21b9 | ||
|
|
ae1068afde | ||
|
|
223d0a6bc8 | ||
|
|
5cd647935d | ||
|
|
35cfd793aa | ||
|
|
7f4a628efe | ||
|
|
d787e40fdb | ||
|
|
e7f4abd38b | ||
|
|
73a024209c | ||
|
|
806da5176e | ||
|
|
b6db146762 | ||
|
|
679140c56b | ||
|
|
6f98371532 | ||
|
|
5937c7505f | ||
|
|
fa3b72348d | ||
|
|
d3f00f54bf | ||
|
|
6073f13f55 | ||
|
|
70a120b72b | ||
|
|
51e64b2789 | ||
|
|
310091d20f | ||
|
|
28fbbeac70 | ||
|
|
f2f0bddf30 | ||
|
|
b4168fd917 | ||
|
|
a80aad7174 | ||
|
|
82b3b4c6cf | ||
|
|
080182216e | ||
|
|
f973eeb491 | ||
|
|
1aeccdb464 | ||
|
|
fa46ead31a | ||
|
|
1b5f7a6202 | ||
|
|
d92813a598 | ||
|
|
59618fed4c | ||
|
|
0d807107b6 | ||
|
|
6f79e614b2 | ||
|
|
8d95d7091d | ||
|
|
dab17a0689 | ||
|
|
39713d3acb | ||
|
|
dc7c366f3a | ||
|
|
a99fb23842 | ||
|
|
003312b1d2 | ||
|
|
2f9f4ccfc8 | ||
|
|
fea43e44c0 | ||
|
|
bc404bfb32 | ||
|
|
86b3ab4fa0 | ||
|
|
700e6b1662 | ||
|
|
f47c5a8e2d | ||
|
|
265f811f5a | ||
|
|
2de5371a75 | ||
|
|
389b72196e | ||
|
|
0ccb5842f5 | ||
|
|
605ec91e5a | ||
|
|
60618c8f1a | ||
|
|
0dc4d8eaec | ||
|
|
44a8977de4 | ||
|
|
647ab4cede | ||
|
|
422085f1c8 | ||
|
|
71b7685092 | ||
|
|
ddc80aff57 | ||
|
|
354b23a9f8 | ||
|
|
db1a410b61 | ||
|
|
d2ff705af3 | ||
|
|
02929a372e | ||
|
|
259f443a93 | ||
|
|
deda6441e4 | ||
|
|
c3f91c0648 | ||
|
|
994a0a298b | ||
|
|
23e72369ff | ||
|
|
e124204c4f | ||
|
|
94c785d235 | ||
|
|
8103527da7 | ||
|
|
f79cbf6512 | ||
|
|
b15cf44c1d | ||
|
|
52797bae17 | ||
|
|
0e6adf8a29 | ||
|
|
6df0f2759d | ||
|
|
6ecf58b0d7 | ||
|
|
2d877599ee | ||
|
|
19569ca6d8 | ||
|
|
8ee6028de3 | ||
|
|
427f065a88 | ||
|
|
c479ce032f | ||
|
|
f87dac04c3 | ||
|
|
1821d1498c | ||
|
|
ce7eada12e | ||
|
|
cfabad9bcf | ||
|
|
a5d78d1f11 | ||
|
|
57bc2333b1 | ||
|
|
7c0fb80030 | ||
|
|
b334137acf | ||
|
|
7509ad8b0f | ||
|
|
919c12c19a | ||
|
|
f8a79fc346 | ||
|
|
c2958585f6 | ||
|
|
8176be1598 | ||
|
|
6206877c51 | ||
|
|
829c8e87e2 | ||
|
|
0407d27034 | ||
|
|
3194e5bf87 | ||
|
|
6840a0ffe8 | ||
|
|
80d60910ff | ||
|
|
3b309f11db | ||
|
|
1e78deb077 | ||
|
|
851f86b951 | ||
|
|
739f13a55b | ||
|
|
33b968dc60 | ||
|
|
ef082e12df | ||
|
|
04ef1fb13d | ||
|
|
d2439e0443 | ||
|
|
3bb79dc191 | ||
|
|
fa9a8e0fd1 | ||
|
|
6ae8fae869 | ||
|
|
6e371ecb27 | ||
|
|
9a4ec5a626 | ||
|
|
4e30b5c3bc | ||
|
|
4f16e9de98 | ||
|
|
48c0196378 | ||
|
|
7b1463bca3 | ||
|
|
2ef9156b42 | ||
|
|
052ff291d7 | ||
|
|
a416861c64 |
3
.github/CODEOWNERS
vendored
3
.github/CODEOWNERS
vendored
@@ -89,6 +89,7 @@ runtime/ftplugin/gitsendemail.vim @tpope
|
||||
runtime/ftplugin/gprof.vim @dpelle
|
||||
runtime/ftplugin/haml.vim @tpope
|
||||
runtime/ftplugin/hgcommit.vim @k-takata
|
||||
runtime/ftplugin/i3config.vim @hiqua
|
||||
runtime/ftplugin/indent.vim @dkearns
|
||||
runtime/ftplugin/javascript.vim @dkearns
|
||||
runtime/ftplugin/javascriptreact.vim @dkearns
|
||||
@@ -114,6 +115,7 @@ runtime/ftplugin/routeros.vim @zainin
|
||||
runtime/ftplugin/ruby.vim @tpope @dkearns
|
||||
runtime/ftplugin/sass.vim @tpope
|
||||
runtime/ftplugin/scss.vim @tpope
|
||||
runtime/ftplugin/solution.vim @dkearns
|
||||
runtime/ftplugin/spec.vim @ignatenkobrain
|
||||
runtime/ftplugin/systemverilog.vim @Kocha
|
||||
runtime/ftplugin/tcsh.vim @dkearns
|
||||
@@ -208,6 +210,7 @@ runtime/syntax/groff.vim @jmarshall
|
||||
runtime/syntax/haml.vim @tpope
|
||||
runtime/syntax/haskell.vim @coot
|
||||
runtime/syntax/hgcommit.vim @k-takata
|
||||
runtime/syntax/i3config.vim @hiqua
|
||||
runtime/syntax/indent.vim @dkearns
|
||||
runtime/syntax/kconfig.vim @chrisbra
|
||||
runtime/syntax/less.vim @genoma
|
||||
|
||||
26
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
26
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -8,6 +8,11 @@ body:
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for reporting issues of Vim!
|
||||
|
||||
If you want to report a security issue, instead of reporting it here
|
||||
you can alternatively disclose it on
|
||||
[huntr.dev](https://huntr.dev/bounties/disclose/?utm_campaign=vim%2Fvim&utm_medium=social&utm_source=github&target=https%3A%2F%2Fgithub.com%2Fvim%2Fvim).
|
||||
They have rewards in the form of money, swag and CVEs.
|
||||
|
||||
To make it easier for us to help you please enter detailed information below.
|
||||
- type: textarea
|
||||
@@ -26,18 +31,23 @@ body:
|
||||
placeholder: A clear and concise description of what you expected to happen.
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Operating system
|
||||
description: >
|
||||
Your operating system name, version and desktop environment.
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Version of Vim
|
||||
description: >
|
||||
The name of your development environment, version. [e.g. GNOME Terminal (v0.0.0000)]
|
||||
Including patch level, use ":version" to see it [e.g. 8.2.1234]
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Environment
|
||||
description: >
|
||||
OS [e.g. Ubuntu 21.10], terminal [e.g. GNOME Terminal 3.38.1], value of $TERM, shell [e.g. bash 5.1.8]; anything that might matter
|
||||
placeholder: |
|
||||
Operating system:
|
||||
Terminal:
|
||||
Value of $TERM:
|
||||
Shell:
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
|
||||
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
@@ -5,6 +5,13 @@ on:
|
||||
branches: ['**']
|
||||
pull_request:
|
||||
|
||||
# Cancels all previous workflow runs for pull requests that have not completed.
|
||||
concurrency:
|
||||
# The concurrency group contains the workflow name and the branch name for
|
||||
# pull requests or the commit hash for any other events.
|
||||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
runs-on: ubuntu-18.04
|
||||
@@ -234,7 +241,7 @@ jobs:
|
||||
if: contains(matrix.extra, 'asan') && !cancelled()
|
||||
run: |
|
||||
for f in $(grep -lR '#[[:digit:]]* *0x[[:digit:]a-fA-F]*' "${LOG_DIR}"); do
|
||||
asan_symbolize-11 -l "$f"
|
||||
asan_symbolize-13 -l "$f"
|
||||
false # in order to fail a job
|
||||
done
|
||||
|
||||
@@ -255,7 +262,7 @@ jobs:
|
||||
runs-on: macos-latest
|
||||
|
||||
env:
|
||||
CC: ${{ matrix.compiler }}
|
||||
CC: clang
|
||||
TEST: test
|
||||
SRCDIR: ./src
|
||||
LEAK_CFLAGS: -DEXITFREE
|
||||
@@ -264,8 +271,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
features: [tiny, huge]
|
||||
compiler: [clang, gcc]
|
||||
features: [tiny, normal, huge]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -286,6 +292,8 @@ jobs:
|
||||
echo "TEST=testtiny"
|
||||
echo "CONFOPT=--disable-gui"
|
||||
;;
|
||||
normal)
|
||||
;;
|
||||
huge)
|
||||
echo "CONFOPT=--enable-perlinterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
|
||||
;;
|
||||
|
||||
7
.github/workflows/codeql-analysis.yml
vendored
7
.github/workflows/codeql-analysis.yml
vendored
@@ -14,6 +14,13 @@ on:
|
||||
schedule:
|
||||
- cron: '0 18 * * 1'
|
||||
|
||||
# Cancels all previous workflow runs for pull requests that have not completed.
|
||||
concurrency:
|
||||
# The concurrency group contains the workflow name and the branch name for
|
||||
# pull requests or the commit hash for any other events.
|
||||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
|
||||
7
Filelist
7
Filelist
@@ -8,6 +8,7 @@ SRC_ALL = \
|
||||
.gitattributes \
|
||||
.github/CODEOWNERS \
|
||||
.github/ISSUE_TEMPLATE/bug_report.yml \
|
||||
.github/ISSUE_TEMPLATE/feature_request.md \
|
||||
.github/workflows/ci.yml \
|
||||
.github/workflows/codeql-analysis.yml \
|
||||
.github/workflows/coverity.yml \
|
||||
@@ -159,8 +160,11 @@ SRC_ALL = \
|
||||
src/version.h \
|
||||
src/vim.h \
|
||||
src/vim9.h \
|
||||
src/vim9cmds.c \
|
||||
src/vim9compile.c \
|
||||
src/vim9execute.c \
|
||||
src/vim9expr.c \
|
||||
src/vim9instr.c \
|
||||
src/vim9script.c \
|
||||
src/vim9type.c \
|
||||
src/viminfo.c \
|
||||
@@ -318,8 +322,11 @@ SRC_ALL = \
|
||||
src/proto/usercmd.pro \
|
||||
src/proto/userfunc.pro \
|
||||
src/proto/version.pro \
|
||||
src/proto/vim9cmds.pro \
|
||||
src/proto/vim9compile.pro \
|
||||
src/proto/vim9execute.pro \
|
||||
src/proto/vim9expr.pro \
|
||||
src/proto/vim9instr.pro \
|
||||
src/proto/vim9script.pro \
|
||||
src/proto/vim9type.pro \
|
||||
src/proto/viminfo.pro \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[](https://www.vim.org)
|
||||
|
||||
[](https://github.com/vim/vim/actions?query=workflow%3A%22GitHub+CI%22) [](https://travis-ci.com/github/vim/vim) [](https://ci.appveyor.com/project/chrisbra/vim) [](https://cirrus-ci.com/github/vim/vim) [](https://codecov.io/gh/vim/vim?branch=master) [](https://scan.coverity.com/projects/vim) [](https://lgtm.com/projects/g/vim/vim/context:cpp) [](https://buildd.debian.org/vim) [](https://repology.org/metapackage/vim) [](https://fossies.org/linux/test/vim-master.tar.gz/codespell.html) [](https://huntr.dev/bounties/disclose/?utm_campaign=vim%2Fvim&utm_medium=social&utm_source=github&target=https%3A%2F%2Fgithub.com%2Fvim%2Fvim)
|
||||
[](https://github.com/vim/vim/actions?query=workflow%3A%22GitHub+CI%22) [](https://travis-ci.com/github/vim/vim) [](https://ci.appveyor.com/project/chrisbra/vim) [](https://cirrus-ci.com/github/vim/vim) [](https://codecov.io/gh/vim/vim?branch=master) [](https://scan.coverity.com/projects/vim) [](https://lgtm.com/projects/g/vim/vim/context:cpp) [](https://buildd.debian.org/vim) [](https://repology.org/metapackage/vim) [](https://fossies.org/linux/test/vim-master.tar.gz/codespell.html)
|
||||
|
||||
<sub>For translations of this README see the end.</sub>
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# Clang 12 (or Apple clang 13) and later makes a warning '-Wcompound-token-split-by-macro' enable by default.
|
||||
/^PERL_CFLAGS[[:blank:]]*=/s/$/ -Wno-error=compound-token-split-by-macro/
|
||||
/^RUBY_CFLAGS[[:blank:]]*=/s/$/ -Wno-error=compound-token-split-by-macro/
|
||||
/^PERL_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=compound-token-split-by-macro/
|
||||
/^RUBY_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=compound-token-split-by-macro/
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
/^CFLAGS[[:blank:]]*=/s/$/ -Wno-error=missing-field-initializers/
|
||||
/^RUBY_CFLAGS[[:blank:]]*=/s/$/ -Wno-error=unknown-attributes -Wno-error=ignored-attributes/
|
||||
/^RUBY_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=unknown-attributes -Wno-error=ignored-attributes/
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
/^CFLAGS[[:blank:]]*=/s/$/ -Wall -Wextra -Wshadow -Werror/
|
||||
/^PERL_CFLAGS[[:blank:]]*=/s/$/ -Wno-error=unused-function/
|
||||
/^PERL_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=unused-function/
|
||||
/^RUBY_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=unused-parameter/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
19
runtime/autoload/dist/ft.vim
vendored
19
runtime/autoload/dist/ft.vim
vendored
@@ -1,7 +1,7 @@
|
||||
" Vim functions for file type detection
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 Nov 27
|
||||
" Last Change: 2021 Dec 17
|
||||
|
||||
" These functions are moved here from runtime/filetype.vim to make startup
|
||||
" faster.
|
||||
@@ -811,6 +811,23 @@ func dist#ft#Redif()
|
||||
endwhile
|
||||
endfunc
|
||||
|
||||
" This function is called for all files under */debian/patches/*, make sure not
|
||||
" to non-dep3patch files, such as README and other text files.
|
||||
func dist#ft#Dep3patch()
|
||||
if expand('%:t') ==# 'series'
|
||||
return
|
||||
endif
|
||||
|
||||
for ln in getline(1, 100)
|
||||
if ln =~# '^\%(Description\|Subject\|Origin\|Bug\|Forwarded\|Author\|From\|Reviewed-by\|Acked-by\|Last-Updated\|Applied-Upstream\):'
|
||||
setf dep3patch
|
||||
return
|
||||
elseif ln =~# '^---'
|
||||
" end of headers found. stop processing
|
||||
return
|
||||
endif
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
" Restore 'cpoptions'
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
@@ -16,6 +16,7 @@ include ../../src/auto/config.mk
|
||||
DOCS = \
|
||||
arabic.txt \
|
||||
autocmd.txt \
|
||||
builtin.txt \
|
||||
change.txt \
|
||||
channel.txt \
|
||||
cmdline.txt \
|
||||
@@ -161,6 +162,7 @@ DOCS = \
|
||||
HTMLS = \
|
||||
arabic.html \
|
||||
autocmd.html \
|
||||
builtin.html \
|
||||
change.html \
|
||||
channel.html \
|
||||
cmdline.html \
|
||||
|
||||
@@ -1279,8 +1279,8 @@ VimResume When the Vim instance is resumed after being
|
||||
:autocmd VimResume * checktime
|
||||
< *VimSuspend*
|
||||
VimSuspend When the Vim instance is suspended. Only when
|
||||
CTRL-Z was typed inside Vim, not when the
|
||||
SIGSTOP or SIGTSTP signal was sent to Vim.
|
||||
CTRL-Z was typed inside Vim, or when the SIGTSTP
|
||||
signal was sent to Vim, but not for SIGSTOP.
|
||||
*WinClosed*
|
||||
WinClosed After closing a window. The pattern is
|
||||
matched against the |window-ID|. Both
|
||||
|
||||
10132
runtime/doc/builtin.txt
Normal file
10132
runtime/doc/builtin.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 8.2. Last change: 2021 Jun 23
|
||||
*change.txt* For Vim version 8.2. Last change: 2021 Dec 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -259,6 +259,9 @@ Or use "caw" (see |aw|).
|
||||
line.
|
||||
Adding [!] toggles 'autoindent' for the time this
|
||||
command is executed.
|
||||
This command is not supported in |Vim9| script,
|
||||
because it is too easily confused with a variable
|
||||
name.
|
||||
|
||||
==============================================================================
|
||||
3. Simple changes *simple-change*
|
||||
@@ -1374,6 +1377,9 @@ The next three commands always work on whole lines.
|
||||
|
||||
*:t*
|
||||
:t Synonym for copy.
|
||||
This command is not supported in |Vim9| script,
|
||||
because it is too easily confused with a variable
|
||||
name.
|
||||
|
||||
:[range]m[ove] {address} *:m* *:mo* *:move* *E134*
|
||||
Move the lines given by [range] to below the line
|
||||
@@ -1671,7 +1677,8 @@ r Automatically insert the current comment leader after hitting
|
||||
<Enter> in Insert mode.
|
||||
*fo-o*
|
||||
o Automatically insert the current comment leader after hitting 'o' or
|
||||
'O' in Normal mode.
|
||||
'O' in Normal mode. In case comment is unwanted in a specific place
|
||||
use CTRL-U to quickly delete it. |i_CTRL-U|
|
||||
*fo-q*
|
||||
q Allow formatting of comments with "gq".
|
||||
Note that formatting will not change blank lines or lines containing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*cmdline.txt* For Vim version 8.2. Last change: 2021 Dec 04
|
||||
*cmdline.txt* For Vim version 8.2. Last change: 2021 Dec 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -705,6 +705,15 @@ Some Ex commands accept a line range in front of them. This is noted as
|
||||
|
||||
The basics are explained in section |10.3| of the user manual.
|
||||
|
||||
In |Vim9| script a range needs to be prefixed with a colon to avoid ambiguity
|
||||
with continuation lines. For example, "+" can be used for a range but is also
|
||||
a continuation of an expression: >
|
||||
var result = start
|
||||
+ print
|
||||
If the "+" is a range then it must be prefixed with a colon: >
|
||||
var result = start
|
||||
:+ print
|
||||
<
|
||||
*:,* *:;*
|
||||
When separated with ';' the cursor position will be set to that line
|
||||
before interpreting the next line specifier. This doesn't happen for ','.
|
||||
|
||||
@@ -398,6 +398,11 @@ mode, so that a CTRL-Z doesn't end the text on DOS.
|
||||
The `redraw!` command may not be needed, depending on whether executing a
|
||||
shell command shows something on the display or not.
|
||||
|
||||
If the 'diffexpr' expression starts with s: or |<SID>|, then it is replaced
|
||||
with the script ID (|local-function|). Example: >
|
||||
set diffexpr=s:MyDiffExpr()
|
||||
set diffexpr=<SID>SomeDiffExpr()
|
||||
<
|
||||
*E810* *E97*
|
||||
Vim will do a test if the diff output looks alright. If it doesn't, you will
|
||||
get an error message. Possible causes:
|
||||
@@ -449,4 +454,9 @@ evaluating 'patchexpr'. This hopefully avoids that files in the current
|
||||
directory are accidentally patched. Vim will also delete files starting with
|
||||
v:fname_in and ending in ".rej" and ".orig".
|
||||
|
||||
If the 'patchexpr' expression starts with s: or |<SID>|, then it is replaced
|
||||
with the script ID (|local-function|). Example: >
|
||||
set patchexpr=s:MyPatchExpr()
|
||||
set patchexpr=<SID>SomePatchExpr()
|
||||
<
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 8.2. Last change: 2021 Oct 16
|
||||
*editing.txt* For Vim version 8.2. Last change: 2021 Dec 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -650,12 +650,19 @@ list of the current window.
|
||||
And after the last one:
|
||||
:+2argadd y a b c x y
|
||||
There is no check for duplicates, it is possible to
|
||||
add a file to the argument list twice.
|
||||
The currently edited file is not changed.
|
||||
add a file to the argument list twice. You can use
|
||||
|:argdedupe| to fix it afterwards: >
|
||||
:argadd *.txt | argdedupe
|
||||
< The currently edited file is not changed.
|
||||
Note: you can also use this method: >
|
||||
:args ## x
|
||||
< This will add the "x" item and sort the new list.
|
||||
|
||||
:argded[upe] *:argded* *:argdedupe*
|
||||
Remove duplicate filenames from the argument list.
|
||||
If your current file is a duplicate, your current file
|
||||
will change to the original file index.
|
||||
|
||||
:argd[elete] {pattern} .. *:argd* *:argdelete* *E480* *E610*
|
||||
Delete files from the argument list that match the
|
||||
{pattern}s. {pattern} is used like a file pattern,
|
||||
@@ -1140,6 +1147,9 @@ The names can be in upper- or lowercase.
|
||||
made.
|
||||
When 'hidden' is set and there are more windows, the
|
||||
current buffer becomes hidden, after writing the file.
|
||||
This command is not supported in |Vim9| script,
|
||||
because it is too easily confused with a variable
|
||||
name.
|
||||
|
||||
*:exi* *:exit*
|
||||
:[range]exi[t][!] [++opt] [file]
|
||||
|
||||
10389
runtime/doc/eval.txt
10389
runtime/doc/eval.txt
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
*filetype.txt* For Vim version 8.2. Last change: 2021 Sep 22
|
||||
*filetype.txt* For Vim version 8.2. Last change: 2021 Dec 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -358,12 +358,12 @@ define yourself. There are a few ways to avoid this:
|
||||
You need to define your own mapping before the plugin is loaded (before
|
||||
editing a file of that type). The plugin will then skip installing the
|
||||
default mapping.
|
||||
*no_mail_maps*
|
||||
*no_mail_maps* *g:no_mail_maps*
|
||||
3. Disable defining mappings for a specific filetype by setting a variable,
|
||||
which contains the name of the filetype. For the "mail" filetype this
|
||||
would be: >
|
||||
:let no_mail_maps = 1
|
||||
< *no_plugin_maps*
|
||||
< *no_plugin_maps* *g:no_plugin_maps*
|
||||
4. Disable defining mappings for all filetypes by setting a variable: >
|
||||
:let no_plugin_maps = 1
|
||||
<
|
||||
|
||||
@@ -121,6 +121,11 @@ method can be very slow!
|
||||
Try to avoid the "=", "a" and "s" return values, since Vim often has to search
|
||||
backwards for a line for which the fold level is defined. This can be slow.
|
||||
|
||||
If the 'foldexpr' expression starts with s: or |<SID>|, then it is replaced
|
||||
with the script ID (|local-function|). Examples: >
|
||||
set foldexpr=s:MyFoldExpr()
|
||||
set foldexpr=<SID>SomeFoldExpr()
|
||||
<
|
||||
An example of using "a1" and "s1": For a multi-line C comment, a line
|
||||
containing "/*" would return "a1" to start a fold, and a line containing "*/"
|
||||
would return "s1" to end the fold after that line: >
|
||||
@@ -524,6 +529,11 @@ The resulting line is truncated to fit in the window, it never wraps.
|
||||
When there is room after the text, it is filled with the character specified
|
||||
by 'fillchars'.
|
||||
|
||||
If the 'foldtext' expression starts with s: or |<SID>|, then it is replaced
|
||||
with the script ID (|local-function|). Examples: >
|
||||
set foldtext=s:MyFoldText()
|
||||
set foldtext=<SID>SomeFoldText()
|
||||
<
|
||||
Note that backslashes need to be used for characters that the ":set" command
|
||||
handles differently: Space, backslash and double-quote. |option-backslash|
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*help.txt* For Vim version 8.2. Last change: 2020 Aug 15
|
||||
*help.txt* For Vim version 8.2. Last change: 2021 Dec 27
|
||||
|
||||
VIM - main help file
|
||||
k
|
||||
@@ -136,6 +136,7 @@ Advanced editing ~
|
||||
|diff.txt| working with two to eight versions of the same file
|
||||
|autocmd.txt| automatically executing commands on an event
|
||||
|eval.txt| expression evaluation, conditional commands
|
||||
|builtin.txt| builtin functions
|
||||
|channel.txt| Jobs, Channels, inter-process communication
|
||||
|fold.txt| hide (fold) ranges of lines
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*helphelp.txt* For Vim version 8.2. Last change: 2021 Nov 18
|
||||
*helphelp.txt* For Vim version 8.2. Last change: 2021 Dec 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -163,7 +163,7 @@ If you would like to open the help in the current window, see this tip:
|
||||
|
||||
The initial height of the help window can be set with the 'helpheight' option
|
||||
(default 20).
|
||||
|
||||
*help-buffer-options*
|
||||
When the help buffer is created, several local options are set to make sure
|
||||
the help text is displayed as it was intended:
|
||||
'iskeyword' nearly all ASCII chars except ' ', '*', '"' and '|'
|
||||
|
||||
@@ -1166,6 +1166,7 @@ tag command action ~
|
||||
be remapped
|
||||
|:args| :ar[gs] print the argument list
|
||||
|:argadd| :arga[dd] add items to the argument list
|
||||
:argdedupe :argdedupe remove duplicates from the argument list
|
||||
|:argdelete| :argd[elete] delete items from the argument list
|
||||
|:argedit| :arge[dit] add item to the argument list and edit it
|
||||
|:argdo| :argdo do a command on all items in the argument list
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*insert.txt* For Vim version 8.2. Last change: 2021 Oct 24
|
||||
*insert.txt* For Vim version 8.2. Last change: 2021 Dec 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -84,6 +84,8 @@ CTRL-U Delete all entered characters before the cursor in the current
|
||||
line. If there are no newly entered characters and
|
||||
'backspace' is not empty, delete all characters before the
|
||||
cursor in the current line.
|
||||
If C-indenting is enabled the indent will be adjusted if the
|
||||
line becomes blank.
|
||||
See |i_backspacing| about joining lines.
|
||||
*i_CTRL-I* *i_<Tab>* *i_Tab*
|
||||
<Tab> or CTRL-I Insert a tab. If the 'expandtab' option is on, the
|
||||
@@ -1945,6 +1947,9 @@ When 'autoindent' is on, the indent for a new line is obtained from the
|
||||
previous line. When 'smartindent' or 'cindent' is on, the indent for a line
|
||||
is automatically adjusted for C programs.
|
||||
|
||||
'formatoptions' can be set to copy the comment leader when opening a new
|
||||
line.
|
||||
|
||||
'textwidth' can be set to the maximum width for a line. When a line becomes
|
||||
too long when appending characters a line break is automatically inserted.
|
||||
|
||||
@@ -1958,6 +1963,9 @@ too long when appending characters a line break is automatically inserted.
|
||||
inserted after the current line.
|
||||
Adding [!] toggles 'autoindent' for the time this
|
||||
command is executed.
|
||||
This command is not supported in |Vim9| script,
|
||||
because it is too easily confused with a variable
|
||||
name.
|
||||
|
||||
*:i* *:in* *:insert*
|
||||
:{range}i[nsert][!] Insert several lines of text above the specified
|
||||
@@ -1965,6 +1973,9 @@ too long when appending characters a line break is automatically inserted.
|
||||
inserted before the current line.
|
||||
Adding [!] toggles 'autoindent' for the time this
|
||||
command is executed.
|
||||
This command is not supported in |Vim9| script,
|
||||
because it is too easily confused with a variable
|
||||
name.
|
||||
|
||||
These two commands will keep on asking for lines, until you type a line
|
||||
containing only a ".". Watch out for lines starting with a backslash, see
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 8.2. Last change: 2021 Nov 20
|
||||
*map.txt* For Vim version 8.2. Last change: 2021 Dec 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -173,7 +173,7 @@ type "a", then "bar" will get inserted.
|
||||
"<unique>" can be used in any order. They must appear right after the
|
||||
command, before any other arguments.
|
||||
|
||||
*:map-local* *:map-<buffer>* *E224* *E225*
|
||||
*:map-local* *:map-<buffer>* *:map-buffer* *E224* *E225*
|
||||
If the first argument to one of these commands is "<buffer>" the mapping will
|
||||
be effective in the current buffer only. Example: >
|
||||
:map <buffer> ,w /[.,;]<CR>
|
||||
@@ -232,7 +232,7 @@ Note: ":map <script>" and ":noremap <script>" do the same thing. The
|
||||
"<script>" overrules the command name. Using ":noremap <script>" is
|
||||
preferred, because it's clearer that remapping is (mostly) disabled.
|
||||
|
||||
*:map-<unique>* *E226* *E227*
|
||||
*:map-<unique>* *:map-unique* *E226* *E227*
|
||||
If the first argument to one of these commands is "<unique>" and it is used to
|
||||
define a new mapping or abbreviation, the command will fail if the mapping or
|
||||
abbreviation already exists. Example: >
|
||||
@@ -356,7 +356,7 @@ Note:
|
||||
- In Select mode, |:map| and |:vmap| command mappings are executed in
|
||||
Visual mode. Use |:smap| to handle Select mode differently.
|
||||
|
||||
*E1135* *E1136*
|
||||
*E1255* *E1136*
|
||||
<Cmd> commands must terminate, that is, they must be followed by <CR> in the
|
||||
{rhs} of the mapping definition. |Command-line| mode is never entered.
|
||||
|
||||
@@ -962,8 +962,7 @@ g@{motion} Call the function set by the 'operatorfunc' option.
|
||||
"line" {motion} was |linewise|
|
||||
"char" {motion} was |characterwise|
|
||||
"block" {motion} was |blockwise-visual|
|
||||
Although "block" would rarely appear, since it can
|
||||
only result from Visual mode where "g@" is not useful.
|
||||
The type can be forced, see |forced-motion|.
|
||||
{not available when compiled without the |+eval|
|
||||
feature}
|
||||
|
||||
@@ -974,28 +973,56 @@ Here is an example that counts the number of spaces with <F4>: >
|
||||
" doubling <F4> works on a line
|
||||
nnoremap <expr> <F4><F4> CountSpaces() .. '_'
|
||||
|
||||
function CountSpaces(type = '') abort
|
||||
function CountSpaces(context = {}, type = '') abort
|
||||
if a:type == ''
|
||||
set opfunc=CountSpaces
|
||||
let context = #{
|
||||
\ dot_command: v:false,
|
||||
\ extend_block: '',
|
||||
\ virtualedit: [&l:virtualedit, &g:virtualedit],
|
||||
\ }
|
||||
let &operatorfunc = function('CountSpaces', [context])
|
||||
set virtualedit=block
|
||||
return 'g@'
|
||||
endif
|
||||
endif
|
||||
|
||||
let sel_save = &selection
|
||||
let reg_save = getreginfo('"')
|
||||
let cb_save = &clipboard
|
||||
let visual_marks_save = [getpos("'<"), getpos("'>")]
|
||||
let save = #{
|
||||
\ clipboard: &clipboard,
|
||||
\ selection: &selection,
|
||||
\ virtualedit: [&l:virtualedit, &g:virtualedit],
|
||||
\ register: getreginfo('"'),
|
||||
\ visual_marks: [getpos("'<"), getpos("'>")],
|
||||
\ }
|
||||
|
||||
try
|
||||
set clipboard= selection=inclusive
|
||||
let commands = #{line: "'[V']y", char: "`[v`]y", block: "`[\<c-v>`]y"}
|
||||
silent exe 'noautocmd keepjumps normal! ' .. get(commands, a:type, '')
|
||||
echom getreg('"')->count(' ')
|
||||
set clipboard= selection=inclusive virtualedit=
|
||||
let commands = #{
|
||||
\ line: "'[V']",
|
||||
\ char: "`[v`]",
|
||||
\ block: "`[\<C-V>`]",
|
||||
\ }[a:type]
|
||||
let [_, _, col, off] = getpos("']")
|
||||
if off != 0
|
||||
let vcol = getline("'[")->strpart(0, col + off)->strdisplaywidth()
|
||||
if vcol >= [line("'["), '$']->virtcol() - 1
|
||||
let a:context.extend_block = '$'
|
||||
else
|
||||
let a:context.extend_block = vcol .. '|'
|
||||
endif
|
||||
endif
|
||||
if a:context.extend_block != ''
|
||||
let commands ..= 'oO' .. a:context.extend_block
|
||||
endif
|
||||
let commands ..= 'y'
|
||||
execute 'silent noautocmd keepjumps normal! ' .. commands
|
||||
echomsg getreg('"')->count(' ')
|
||||
finally
|
||||
call setreg('"', reg_save)
|
||||
call setpos("'<", visual_marks_save[0])
|
||||
call setpos("'>", visual_marks_save[1])
|
||||
let &clipboard = cb_save
|
||||
let &selection = sel_save
|
||||
call setreg('"', save.register)
|
||||
call setpos("'<", save.visual_marks[0])
|
||||
call setpos("'>", save.visual_marks[1])
|
||||
let &clipboard = save.clipboard
|
||||
let &selection = save.selection
|
||||
let [&l:virtualedit, &g:virtualedit] = get(a:context.dot_command ? save : a:context, 'virtualedit')
|
||||
let a:context.dot_command = v:true
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*message.txt* For Vim version 8.2. Last change: 2021 Jul 31
|
||||
*message.txt* For Vim version 8.2. Last change: 2021 Dec 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -29,8 +29,7 @@ depends on the 'shortmess' option.
|
||||
Clear messages, keeping only the {count} most
|
||||
recent ones.
|
||||
|
||||
The number of remembered messages is fixed at 20 for the tiny version and 200
|
||||
for other versions.
|
||||
The number of remembered messages is fixed at 200.
|
||||
|
||||
*g<*
|
||||
The "g<" command can be used to see the last page of previous command output.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*motion.txt* For Vim version 8.2. Last change: 2021 Dec 04
|
||||
*motion.txt* For Vim version 8.2. Last change: 2021 Dec 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -788,6 +788,9 @@ m< or m> Set the |'<| or |'>| mark. Useful to change what the
|
||||
*:k*
|
||||
:[range]k{a-zA-Z'} Same as :mark, but the space before the mark name can
|
||||
be omitted.
|
||||
This command is not supported in |Vim9| script,
|
||||
because it is too easily confused with a variable
|
||||
name.
|
||||
|
||||
*'* *'a* *`* *`a*
|
||||
'{a-z} `{a-z} Jump to the mark {a-z} in the current buffer.
|
||||
@@ -1038,12 +1041,10 @@ commands that start editing a new file.
|
||||
*CTRL-O*
|
||||
CTRL-O Go to [count] Older cursor position in jump list
|
||||
(not a motion command).
|
||||
{not available without the |+jumplist| feature}
|
||||
|
||||
<Tab> or *CTRL-I* *<Tab>*
|
||||
CTRL-I Go to [count] newer cursor position in jump list
|
||||
(not a motion command).
|
||||
{not available without the |+jumplist| feature}
|
||||
|
||||
NOTE: In the GUI and in a terminal supporting
|
||||
|modifyOtherKeys|, CTRL-I can be mapped separately
|
||||
@@ -1053,18 +1054,15 @@ CTRL-I Go to [count] newer cursor position in jump list
|
||||
|
||||
*:ju* *:jumps*
|
||||
:ju[mps] Print the jump list (not a motion command).
|
||||
{not available without the |+jumplist| feature}
|
||||
|
||||
*:cle* *:clearjumps*
|
||||
:cle[arjumps] Clear the jump list of the current window.
|
||||
{not available without the |+jumplist| feature}
|
||||
|
||||
*jumplist*
|
||||
Jumps are remembered in a jump list. With the CTRL-O and CTRL-I command you
|
||||
can go to cursor positions before older jumps, and back again. Thus you can
|
||||
move up and down the list. There is a separate jump list for each window.
|
||||
The maximum number of entries is fixed at 100.
|
||||
{not available without the |+jumplist| feature}
|
||||
|
||||
For example, after three jump commands you have this jump list:
|
||||
|
||||
@@ -1141,13 +1139,11 @@ g; Go to [count] older position in change list.
|
||||
positions go to the oldest change.
|
||||
If there is no older change an error message is given.
|
||||
(not a motion command)
|
||||
{not available without the |+jumplist| feature}
|
||||
|
||||
*g,* *E663*
|
||||
g, Go to [count] newer cursor position in change list.
|
||||
Just like |g;| but in the opposite direction.
|
||||
(not a motion command)
|
||||
{not available without the |+jumplist| feature}
|
||||
|
||||
When using a count you jump as far back or forward as possible. Thus you can
|
||||
use "999g;" to go to the first change for which the position is still
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.2. Last change: 2021 Dec 03
|
||||
*options.txt* For Vim version 8.2. Last change: 2021 Dec 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -385,13 +385,17 @@ lambda it will be converted to the name, e.g. "<lambda>123". Examples:
|
||||
set opfunc={a\ ->\ MyOpFunc(a)}
|
||||
" set using a funcref variable
|
||||
let Fn = function('MyTagFunc')
|
||||
let &tagfunc = string(Fn)
|
||||
let &tagfunc = Fn
|
||||
" set using a lambda expression
|
||||
let &tagfunc = {t -> MyTagFunc(t)}
|
||||
" set using a variable with lambda expression
|
||||
let L = {a, b, c -> MyTagFunc(a, b , c)}
|
||||
let &tagfunc = L
|
||||
<
|
||||
|
||||
In Vim9 script, in a compiled function, you can use a lambda, but a
|
||||
closured does not work, because the function will be called without the
|
||||
context of where it was defined.
|
||||
|
||||
|
||||
Setting the filetype
|
||||
|
||||
@@ -1221,6 +1225,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Vim does not try to send a message to an external debugger (Netbeans
|
||||
or Sun Workshop).
|
||||
|
||||
If the expression starts with s: or |<SID>|, then it is replaced with
|
||||
the script ID (|local-function|). Example: >
|
||||
set bexpr=s:MyBalloonExpr()
|
||||
set bexpr=<SID>SomeBalloonExpr()
|
||||
<
|
||||
The expression will be evaluated in the |sandbox| when set from a
|
||||
modeline, see |sandbox-option|.
|
||||
This option cannot be set in a modeline when 'modelineexpr' is off.
|
||||
@@ -1489,6 +1498,15 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
case mapping, the current locale is not effective.
|
||||
This probably only matters for Turkish.
|
||||
|
||||
*'cdhome'* *'cdh'*
|
||||
'cdhome' 'cdh' boolean (default: off)
|
||||
global
|
||||
When on, |:cd|, |:tcd| and |:lcd| without an argument changes the
|
||||
current working directory to the |$HOME| directory like in Unix.
|
||||
When off, those commands just print the current directory name.
|
||||
On Unix this option has no effect.
|
||||
NOTE: This option is reset when 'compatible' is set.
|
||||
|
||||
*'cdpath'* *'cd'* *E344* *E346*
|
||||
'cdpath' 'cd' string (default: equivalent to $CDPATH or ",,")
|
||||
global
|
||||
@@ -1830,6 +1848,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'balloonexpr' + "" text to show in evaluation balloon
|
||||
'breakindent' + off don't indent when wrapping lines
|
||||
'cedit' - {unchanged} {set vim default only on resetting 'cp'}
|
||||
'cdhome' + off ":cd" don't chdir to home on non-Unix
|
||||
'cindent' + off no C code indentation
|
||||
'compatible' - {unchanged} {set vim default only on resetting 'cp'}
|
||||
'copyindent' + off don't copy indent structure
|
||||
@@ -2114,8 +2133,18 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Commas can be added for readability.
|
||||
To avoid problems with flags that are added in the future, use the
|
||||
"+=" and "-=" feature of ":set" |add-option-flags|.
|
||||
|
||||
NOTE: This option is set to the Vi default value when 'compatible' is
|
||||
set and to the Vim default value when 'compatible' is reset.
|
||||
|
||||
NOTE: In a |Vim9| script, when `vim9script` is encountered, the value
|
||||
is saved, 'cpoptions' is set to the Vim default, and the saved value
|
||||
is restored at the end of the script. Changes to the value of
|
||||
'cpoptions' will be applied to the saved value, but keep in mind that
|
||||
removing a flag that is not present when 'cpoptions' is changed has no
|
||||
effect. In the |.vimrc| file the value is not restored, thus using
|
||||
`vim9script` in the |.vimrc| file results in using the Vim default.
|
||||
|
||||
NOTE: This option is set to the POSIX default value at startup when
|
||||
the Vi default value would be used and the $VIM_POSIX environment
|
||||
variable exists |posix|. This means Vim tries to behave like the
|
||||
@@ -3582,6 +3611,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
When the expression evaluates to non-zero Vim will fall back to using
|
||||
the internal format mechanism.
|
||||
|
||||
If the expression starts with s: or |<SID>|, then it is replaced with
|
||||
the script ID (|local-function|). Example: >
|
||||
set formatexpr=s:MyFormatExpr()
|
||||
set formatexpr=<SID>SomeFormatExpr()
|
||||
<
|
||||
The expression will be evaluated in the |sandbox| when set from a
|
||||
modeline, see |sandbox-option|. That stops the option from working,
|
||||
since changing the buffer text is not allowed.
|
||||
@@ -4424,6 +4458,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
found. Allows doing "gf" on the name after an 'include' statement.
|
||||
Also used for |<cfile>|.
|
||||
|
||||
If the expression starts with s: or |<SID>|, then it is replaced with
|
||||
the script ID (|local-function|). Example: >
|
||||
set includeexpr=s:MyIncludeExpr(v:fname)
|
||||
set includeexpr=<SID>SomeIncludeExpr(v:fname)
|
||||
<
|
||||
The expression will be evaluated in the |sandbox| when set from a
|
||||
modeline, see |sandbox-option|.
|
||||
This option cannot be set in a modeline when 'modelineexpr' is off.
|
||||
@@ -4497,6 +4536,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The expression is evaluated with |v:lnum| set to the line number for
|
||||
which the indent is to be computed. The cursor is also in this line
|
||||
when the expression is evaluated (but it may be moved around).
|
||||
If the expression starts with s: or |<SID>|, then it is replaced with
|
||||
the script ID (|local-function|). Example: >
|
||||
set indentexpr=s:MyIndentExpr()
|
||||
set indentexpr=<SID>SomeIndentExpr()
|
||||
<
|
||||
The expression must return the number of spaces worth of indent. It
|
||||
can return "-1" to keep the current indent (this means 'autoindent' is
|
||||
used for the indent).
|
||||
@@ -5587,8 +5631,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
number.
|
||||
When a long, wrapped line doesn't start with the first character, '-'
|
||||
characters are put before the number.
|
||||
See |hl-LineNr| and |hl-CursorLineNr| for the highlighting used for
|
||||
the number.
|
||||
For highlighting see |hl-LineNr|, and |hl-CursorLineNr|, and the
|
||||
|:sign-define| "numhl" argument.
|
||||
*number_relativenumber*
|
||||
The 'relativenumber' option changes the displayed number to be
|
||||
relative to the cursor. Together with 'number' there are these
|
||||
@@ -9192,4 +9236,16 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
screen. When non-zero, characters are sent to the terminal one by
|
||||
one. For debugging purposes.
|
||||
|
||||
*'xtermcodes'* *'noxtermcodes'*
|
||||
'xtermcodes' boolean (default on)
|
||||
global
|
||||
When detecting xterm patchlevel 141 or higher with the termresponse
|
||||
mechanism and this option is set, Vim will request the actual terminal
|
||||
key codes and number of colors from the terminal. This takes care of
|
||||
various configuration options of the terminal that cannot be obtained
|
||||
from the termlib/terminfo entry, see |xterm-codes|.
|
||||
A side effect may be that t_Co changes and Vim will redraw the
|
||||
display.
|
||||
|
||||
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
||||
@@ -174,6 +174,11 @@ an error message. In that case Vim will delete the file. In the default
|
||||
value for non-MS-Windows a trick is used: Adding "v:shell_error" will result
|
||||
in a non-zero number when the system() call fails.
|
||||
|
||||
If the expression starts with s: or |<SID>|, then it is replaced with the
|
||||
script ID (|local-function|). Example: >
|
||||
set printexpr=s:MyPrintFile()
|
||||
set printexpr=<SID>SomePrintFile()
|
||||
<
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for security
|
||||
reasons.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickref.txt* For Vim version 8.2. Last change: 2021 Oct 17
|
||||
*quickref.txt* For Vim version 8.2. Last change: 2021 Dec 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1010,6 +1010,7 @@ Short explanation of each option: *option-list*
|
||||
'writeany' 'wa' write to file with no need for "!" override
|
||||
'writebackup' 'wb' make a backup before overwriting a file
|
||||
'writedelay' 'wd' delay this many msec for each char (for debug)
|
||||
'xtermcodes' request terminal codes from an xterm
|
||||
------------------------------------------------------------------------------
|
||||
*Q_ur* Undo/Redo commands
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*remote.txt* For Vim version 8.2. Last change: 2019 May 05
|
||||
*remote.txt* For Vim version 8.2. Last change: 2021 Dec 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -143,7 +143,7 @@ You can not put options there!
|
||||
FUNCTIONS
|
||||
*E240* *E573*
|
||||
There are a number of Vim functions for scripting the command server. See
|
||||
the description in |eval.txt| or use CTRL-] on the function name to jump to
|
||||
the description in |builtin.txt| or use CTRL-] on the function name to jump to
|
||||
the full explanation.
|
||||
|
||||
synopsis explanation ~
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*repeat.txt* For Vim version 8.2. Last change: 2021 Nov 24
|
||||
*repeat.txt* For Vim version 8.2. Last change: 2021 Dec 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -495,6 +495,9 @@ space at the end of a line is hard to see and may be accidentally deleted. >
|
||||
\ "very long regexp"
|
||||
\ keepend
|
||||
|
||||
In |Vim9| script the backslash can often be omitted, but not always.
|
||||
See |vim9-line-continuation|.
|
||||
|
||||
There is a problem with the ":append" and ":insert" commands: >
|
||||
:1append
|
||||
\asdf
|
||||
|
||||
@@ -140,6 +140,11 @@ See |sign_define()| for the equivalent Vim script function.
|
||||
Highlighting group used for the whole line the sign is placed
|
||||
in. Most useful is defining a background color.
|
||||
|
||||
numhl={group}
|
||||
Highlighting group used for the line number on the line where
|
||||
the sign is placed. Overrides |hl-LineNr|, |hl-LineNrAbove|,
|
||||
|hl-LineNrBelow|, and |hl-CursorLineNr|.
|
||||
|
||||
text={text} *E239*
|
||||
Define the text that is displayed when there is no icon or the
|
||||
GUI is not being used. Only printable characters are allowed
|
||||
@@ -396,6 +401,8 @@ sign_define({list})
|
||||
icon full path to the bitmap file for the sign.
|
||||
linehl highlight group used for the whole line the
|
||||
sign is placed in.
|
||||
numhl highlight group used for the line number where
|
||||
the sign is placed.
|
||||
text text that is displayed when there is no icon
|
||||
or the GUI is not being used.
|
||||
texthl highlight group used for the text item
|
||||
@@ -443,6 +450,8 @@ sign_getdefined([{name}]) *sign_getdefined()*
|
||||
linehl highlight group used for the whole line the
|
||||
sign is placed in; not present if not set
|
||||
name name of the sign
|
||||
numhl highlight group used for the line number where
|
||||
the sign is placed; not present if not set
|
||||
text text that is displayed when there is no icon
|
||||
or the GUI is not being used.
|
||||
texthl highlight group used for the text item; not
|
||||
|
||||
@@ -4506,7 +4506,7 @@ it marks the "\(\I\i*\)" sub-expression as external; in the end pattern, it
|
||||
changes the \z1 back-reference into an external reference referring to the
|
||||
first external sub-expression in the start pattern. External references can
|
||||
also be used in skip patterns: >
|
||||
:syn region foo start="start \(\I\i*\)" skip="not end \z1" end="end \z1"
|
||||
:syn region foo start="start \z(\I\i*\)" skip="not end \z1" end="end \z1"
|
||||
|
||||
Note that normal and external sub-expressions are completely orthogonal and
|
||||
indexed separately; for instance, if the pattern "\z(..\)\(..\)" is applied
|
||||
|
||||
1032
runtime/doc/tags
1032
runtime/doc/tags
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
*term.txt* For Vim version 8.2. Last change: 2021 Dec 04
|
||||
*term.txt* For Vim version 8.2. Last change: 2021 Dec 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -150,6 +150,8 @@ terminal that tmux is running in): >
|
||||
" Enable focus event tracking, see :help xterm-focus-event
|
||||
let &t_fe = "\<Esc>[?1004h"
|
||||
let &t_fd = "\<Esc>[?1004l"
|
||||
execute "set <FocusGained>=\<Esc>[I"
|
||||
execute "set <FocusLost>=\<Esc>[O"
|
||||
|
||||
" Enable modified arrow keys, see :help arrow_modifiers
|
||||
execute "silent! set <xUp>=\<Esc>[@;*A"
|
||||
@@ -554,8 +556,15 @@ request the key codes directly from the xterm. The responses are used to
|
||||
adjust the various t_ codes. This avoids the problem that the xterm can
|
||||
produce different codes, depending on the mode it is in (8-bit, VT102,
|
||||
VT220, etc.). The result is that codes like <xF1> are no longer needed.
|
||||
Note: This is only done on startup. If the xterm options are changed after
|
||||
Vim has started, the escape sequences may not be recognized anymore.
|
||||
|
||||
One of the codes that can change is 't_Co', the number of colors. This will
|
||||
trigger a redraw. If this is a problem, reset the 'xtermcodes' option as
|
||||
early as possible: >
|
||||
set noxtermcodes
|
||||
|
||||
Note: Requesting the key codes is only done on startup. If the xterm options
|
||||
are changed after Vim has started, the escape sequences may not be recognized
|
||||
anymore.
|
||||
|
||||
*xterm-true-color*
|
||||
Vim supports using true colors in the terminal (taken from |highlight-guifg|
|
||||
@@ -606,6 +615,8 @@ If your terminal does support this but Vim does not recognize the terminal,
|
||||
you may have to set the options yourself: >
|
||||
let &t_fe = "\<Esc>[?1004h"
|
||||
let &t_fd = "\<Esc>[?1004l"
|
||||
execute "set <FocusGained>=\<Esc>[I"
|
||||
execute "set <FocusLost>=\<Esc>[O"
|
||||
If this causes garbage to show when Vim starts up then it doesn't work.
|
||||
|
||||
*termcap-colors*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*terminal.txt* For Vim version 8.2. Last change: 2021 Nov 13
|
||||
*terminal.txt* For Vim version 8.2. Last change: 2021 Dec 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1428,6 +1428,8 @@ GDB command *termdebug-customizing*
|
||||
To change the name of the gdb command, set the "g:termdebugger" variable before
|
||||
invoking `:Termdebug`: >
|
||||
let g:termdebugger = "mygdb"
|
||||
If the command needs an argument use a List: >
|
||||
let g:termdebugger = ['rr', 'replay', '--']
|
||||
< *gdb-version*
|
||||
Only debuggers fully compatible with gdb will work. Vim uses the GDB/MI
|
||||
interface. The "new-ui" command requires gdb version 7.12 or later. if you
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*testing.txt* For Vim version 8.2. Last change: 2021 Aug 15
|
||||
*testing.txt* For Vim version 8.2. Last change: 2021 Dec 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -65,7 +65,8 @@ test_garbagecollect_now() *test_garbagecollect_now()*
|
||||
Like garbagecollect(), but executed right away. This must
|
||||
only be called directly to avoid any structure to exist
|
||||
internally, and |v:testing| must have been set before calling
|
||||
any function.
|
||||
any function. This will not work when called from a :def
|
||||
function, because variables on the stack will be freed.
|
||||
|
||||
|
||||
test_garbagecollect_soon() *test_garbagecollect_soon()*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.2. Last change: 2021 Dec 05
|
||||
*todo.txt* For Vim version 8.2. Last change: 2021 Dec 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -38,34 +38,14 @@ browser use: https://github.com/vim/vim/issues/1234
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Vim9 - Make everything work:
|
||||
- Check TODO items in vim9compile.c and vim9execute.c
|
||||
- use CheckLegacyAndVim9Success(lines) in many more places
|
||||
- For builtin functions using tv_get_string*() use check_for_string() to be
|
||||
more strict about the argument type (not a bool).
|
||||
done: balloon_()
|
||||
- Check many more builtin function arguments at compile time.
|
||||
map() could check that the return type of the function argument matches
|
||||
the type of the list or dict member. (#8092)
|
||||
Same for other functions, such as searchpair().
|
||||
- Test try/catch and throw better, also nested.
|
||||
Test that return inside try/finally jumps to finally and then returns.
|
||||
- Test that a function defined inside a :def function is local to that
|
||||
function, g: functions can be defined and script-local functions cannot be
|
||||
defined.
|
||||
- Unexpected error message when using "var x: any | x.key = 9", because "x" is
|
||||
given the type number. Can we use VAR_ANY?
|
||||
- Check performance with callgrind and kcachegrind.
|
||||
|
||||
Once Vim9 is stable:
|
||||
- Add the "vim9script" feature, can use has('vim9script')
|
||||
- Change the help to prefer Vim9 syntax where appropriate
|
||||
Remove TODO in vim9.txt
|
||||
- Add all the error numbers in a good place in documentation.
|
||||
- In the generic eval docs, point out the Vim9 syntax where it differs.
|
||||
- Use Vim9 for runtime files.
|
||||
PR #7497 for autoload/ccomplete.vim
|
||||
|
||||
Further Vim9 improvements, possibly after launch:
|
||||
- Check performance with callgrind and kcachegrind.
|
||||
- better implementation for partial and tests for that.
|
||||
- Compile options that are an expression, e.g. "expr:" in 'spellsuggest',
|
||||
'foldexpr', 'foldtext', 'printexpr', 'diffexpr', 'patchexpr', 'charconvert',
|
||||
@@ -75,10 +55,9 @@ Further Vim9 improvements, possibly after launch:
|
||||
evaluation.
|
||||
Use the location where the option was set for deciding whether it's to be
|
||||
evaluated in Vim9 script context.
|
||||
- Handle command that is only a range more efficient than calling ISN_EXEC
|
||||
- implement :type, "import type"
|
||||
- implement enum, "import enum".
|
||||
- implement class and interface: See |vim9-classes|
|
||||
- implement :enum, "import enum".
|
||||
- implement :class and :interface: See |vim9-classes|
|
||||
- For range: make table of first ASCII character with flag to quickly check if
|
||||
it can be a Vim9 command. E.g. "+" can, but "." can't.
|
||||
- Inline call to map() and filter(), better type checking.
|
||||
@@ -89,6 +68,9 @@ Further Vim9 improvements, possibly after launch:
|
||||
has(featureName), len(someString)
|
||||
- Implement as part of an expression: ++expr, --expr, expr++, expr--.
|
||||
|
||||
Update list of features to vote on:
|
||||
- multiple cursors
|
||||
- built-in LSP support
|
||||
|
||||
Popup windows:
|
||||
- Preview popup not properly updated when it overlaps with completion menu.
|
||||
@@ -131,8 +113,6 @@ Text properties:
|
||||
where property fits in.
|
||||
Or Should we let the textprop highlight overrule other (e.g. diff) highlight
|
||||
if the priority is above a certain value? (#7392)
|
||||
- Popup attached to text property stays visible when text is no longer
|
||||
visible. (#7736)
|
||||
- Popup attached to text property stays visible when text is deleted with
|
||||
"cc". (#7737) "C" works OK. "dd" also files in a buffer with a single
|
||||
line.
|
||||
@@ -194,8 +174,6 @@ Terminal emulator window:
|
||||
- GUI: When using ":set go+=!" a system() call causes the hit-enter prompt.
|
||||
(#3327)
|
||||
- Allow for specifying the directory, with ++cwd={dir}.
|
||||
- With a vertical split only one window is updated. (Linwei, 2018 Jun 2,
|
||||
#2977)
|
||||
- When pasting should call vterm_keyboard_start_paste(), e.g. when using
|
||||
K_MIDDLEMOUSE, calling insert_reg().
|
||||
- Users expect parsing the :term argument like a shell does, also support
|
||||
@@ -271,6 +249,8 @@ Was originally written by Felipe Morales.
|
||||
Request to use "." for the cursor column in search pattern \%<.c and \%<.v.
|
||||
(#8179)
|
||||
|
||||
":filter set termcap" only filters terminal codes, not keys. (#9297)
|
||||
|
||||
Remove SPACE_IN_FILENAME ? It is only used for completion.
|
||||
|
||||
When 'term' starts with "foot" then default t_TI and t_TE to the values used
|
||||
@@ -415,8 +395,6 @@ Motif: Build on Ubuntu can't enter any text in dialog text fields.
|
||||
Running test_gui and test_gui_init with Motif sometimes kills the window
|
||||
manager. Problem with Motif?
|
||||
|
||||
Patch to add :argdedupe. (Nir Lichtman, #6235)
|
||||
|
||||
When editing a file with ":edit" the output of :swapname is relative, while
|
||||
editing it with "vim file" it is absolute. (#355)
|
||||
Which one should it be?
|
||||
@@ -846,9 +824,7 @@ window for the buffer.
|
||||
Win32 key codes are messy. Mike Williams tried to fix that, but now old
|
||||
mappings no longer work. Create a new terminal for the better solution?
|
||||
|
||||
Compiler warnings (geeknik, 2017 Oct 26):
|
||||
- signed integer overflow in do_sub() (#2249)
|
||||
- signed integer overflow in get_address() (#2248)
|
||||
Compiler warning (geeknik, 2017 Oct 26):
|
||||
- undefined left shift in get_string_tv() (#2250)
|
||||
|
||||
Add Native language protocol server (LSP) support. (Yegappan Lakshmanan, 2018
|
||||
@@ -3895,7 +3871,7 @@ User Friendlier:
|
||||
$HOME/_vimrc, etc.) and add "edit vimrc" to the File menu.
|
||||
- Add a way to save local settings and mappings into a new plugin file.
|
||||
":mkplugin <file>"?
|
||||
- Add mappings local to a window: ":map <window> ..."?
|
||||
- Add mappings local to a window: ":map <window> ..." #9339
|
||||
9 Add buffer-local menu. Should offer a choice between removing the menu or
|
||||
disabling it. Be careful that tear-offs don't disappear (keep one empty
|
||||
item?).
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 8.2. Last change: 2021 Nov 30
|
||||
*various.txt* For Vim version 8.2. Last change: 2021 Dec 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -391,7 +391,7 @@ m *+hangul_input* Hangul input support |hangul|
|
||||
T *+insert_expand* |insert_expand| Insert mode completion
|
||||
m *+ipv6* Support for IPv6 networking |channel|
|
||||
m *+job* starting and stopping jobs |job|
|
||||
S *+jumplist* |jumplist|
|
||||
T *+jumplist* |jumplist|; Always enabled since 8.2.3795
|
||||
B *+keymap* |'keymap'|
|
||||
N *+lambda* |lambda| and |closure|
|
||||
B *+langmap* |'langmap'|
|
||||
@@ -476,9 +476,10 @@ N *+toolbar* |gui-toolbar|
|
||||
T *+user_commands* User-defined commands. |user-commands|
|
||||
Always enabled since 8.1.1210.
|
||||
B *+vartabs* Variable-width tabstops. |'vartabstop'|
|
||||
N *+viminfo* |'viminfo'|
|
||||
T *+vertsplit* Vertically split windows |:vsplit|; Always enabled
|
||||
since 8.0.1118.
|
||||
T *+vim9script* |Vim9| script
|
||||
N *+viminfo* |'viminfo'|
|
||||
T *+virtualedit* |'virtualedit'| Always enabled since 8.1.826.
|
||||
T *+visual* Visual mode |Visual-mode| Always enabled since 7.4.200.
|
||||
T *+visualextra* extra Visual mode commands |blockwise-operators|
|
||||
@@ -549,14 +550,17 @@ N *+X11* Unix only: can restore window title |X11|
|
||||
name can be omitted.
|
||||
:redi[r] @">> Append messages to the unnamed register.
|
||||
|
||||
:redi[r] => {var} Redirect messages to a variable. If the variable
|
||||
doesn't exist, then it is created. If the variable
|
||||
exists, then it is initialized to an empty string.
|
||||
:redi[r] => {var} Redirect messages to a variable.
|
||||
In legacy script: If the variable doesn't exist, then
|
||||
it is created. If the variable exists, then it is
|
||||
initialized to an empty string. After the redirection
|
||||
starts, if the variable is removed or locked or the
|
||||
variable type is changed, then further command output
|
||||
messages will cause errors.
|
||||
In Vim9 script: the variable must have been declared
|
||||
as a string.
|
||||
The variable will remain empty until redirection ends.
|
||||
Only string variables can be used. After the
|
||||
redirection starts, if the variable is removed or
|
||||
locked or the variable type is changed, then further
|
||||
command output messages will cause errors.
|
||||
Only string variables can be used.
|
||||
To get the output of one command the |execute()|
|
||||
function can be used instead of redirection.
|
||||
|
||||
@@ -598,7 +602,7 @@ N *+X11* Unix only: can restore window title |X11|
|
||||
|:oldfiles| - filter by file name
|
||||
|:registers| - filter by register contents
|
||||
(does not work multi-line)
|
||||
|:set| - filter by variable name
|
||||
|:set| - filter by option name
|
||||
|
||||
Only normal messages are filtered, error messages are
|
||||
not.
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2021 Dec 01
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2021 Dec 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
|
||||
|
||||
Vim9 script commands and expressions. *Vim9* *vim9*
|
||||
|
||||
Most expression help is in |eval.txt|. This file is about the new syntax and
|
||||
features in Vim9 script.
|
||||
|
||||
THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
|
||||
|
||||
|
||||
1. What is Vim9 script? |Vim9-script|
|
||||
@@ -27,8 +24,6 @@ THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
|
||||
|
||||
1. What is Vim9 script? *Vim9-script*
|
||||
|
||||
THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
|
||||
|
||||
Vim script has been growing over time, while preserving backwards
|
||||
compatibility. That means bad choices from the past often can't be changed
|
||||
and compatibility with Vi restricts possible solutions. Execution is quite
|
||||
@@ -76,8 +71,6 @@ rewrite old scripts, they keep working as before. You may want to use a few
|
||||
|
||||
2. Differences from legacy Vim script *vim9-differences*
|
||||
|
||||
THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
|
||||
|
||||
Overview ~
|
||||
|
||||
Brief summary of the differences you will most often encounter when using Vim9
|
||||
@@ -88,7 +81,7 @@ script and `:def` functions; details are below:
|
||||
echo "hello "
|
||||
.. yourName
|
||||
.. ", how are you?"
|
||||
- White space is required in many places.
|
||||
- White space is required in many places to improve readability.
|
||||
- Assign values without `:let`, declare variables with `:var`: >
|
||||
var count = 0
|
||||
count += 3
|
||||
@@ -101,8 +94,8 @@ script and `:def` functions; details are below:
|
||||
def CallMe(count: number, message: string): bool
|
||||
- Call functions without `:call`: >
|
||||
writefile(['done'], 'file.txt')
|
||||
- You cannot use `:xit`, `:t`, `:k`, `:append`, `:change`, `:insert`, `:open`,
|
||||
and `:s` or `:d` with only flags.
|
||||
- You cannot use old Ex commands `:xit`, `:t`, `:k`, `:append`, `:change`,
|
||||
`:insert`, `:open`, and `:s` or `:d` with only flags.
|
||||
- You cannot use curly-braces names.
|
||||
- A range before a command must be prefixed with a colon: >
|
||||
:%s/this/that
|
||||
@@ -169,8 +162,8 @@ created yet. In this case you can call `execute()` to invoke it at runtime. >
|
||||
|
||||
`:def` has no options like `:function` does: "range", "abort", "dict" or
|
||||
"closure". A `:def` function always aborts on an error (unless `:silent!` was
|
||||
used for the command or inside a `:try` block), does not get a range passed
|
||||
cannot be a "dict" function, and can always be a closure.
|
||||
used for the command or the error was caught a `:try` block), does not get a
|
||||
range passed cannot be a "dict" function, and can always be a closure.
|
||||
*vim9-no-dict-function*
|
||||
Later classes will be added, which replaces the "dict function" mechanism.
|
||||
For now you will need to pass the dictionary explicitly: >
|
||||
@@ -354,11 +347,13 @@ And with autocommands: >
|
||||
Although using a :def function probably works better.
|
||||
|
||||
Declaring a variable with a type but without an initializer will initialize to
|
||||
zero, false or empty.
|
||||
false (for bool), empty (for string, list, dict, etc.) or zero (for number,
|
||||
any, etc.). This matters especially when using the "any" type, the value will
|
||||
default to the number zero.
|
||||
|
||||
In Vim9 script `:let` cannot be used. An existing variable is assigned to
|
||||
without any command. The same for global, window, tab, buffer and Vim
|
||||
variables, because they are not really declared. They can also be deleted
|
||||
variables, because they are not really declared. Those can also be deleted
|
||||
with `:unlet`.
|
||||
|
||||
`:lockvar` does not work on local variables. Use `:const` and `:final`
|
||||
@@ -396,8 +391,8 @@ later. Example: >
|
||||
endif
|
||||
enddef
|
||||
|
||||
If you would do it like this you get an error at compile time that
|
||||
"PluginFunc" does not exist, even when "g:loaded_plugin" does not exist: >
|
||||
If you do it like this, you get an error at compile time that "PluginFunc"
|
||||
does not exist, even when "g:loaded_plugin" does not exist: >
|
||||
def CallPluginFunc()
|
||||
if exists('g:loaded_plugin')
|
||||
PluginFunc() # Error - function not found
|
||||
@@ -509,7 +504,7 @@ The function must already have been defined. >
|
||||
|
||||
When using `function()` the resulting type is "func", a function with any
|
||||
number of arguments and any return type (including void). The function can be
|
||||
defined later.
|
||||
defined later if the argument is in quotes.
|
||||
|
||||
|
||||
Lambda using => instead of -> ~
|
||||
@@ -560,7 +555,6 @@ This can be useful for a timer, for example: >
|
||||
echom 'Handler called ' .. count
|
||||
}, {repeat: 3})
|
||||
|
||||
|
||||
The ending "}" must be at the start of a line. It can be followed by other
|
||||
characters, e.g.: >
|
||||
var d = mapnew(dict, (k, v): string => {
|
||||
@@ -568,6 +562,24 @@ characters, e.g.: >
|
||||
})
|
||||
No command can follow the "{", only a comment can be used there.
|
||||
|
||||
*command-block*
|
||||
The block can also be used for defining a user command. Inside the block Vim9
|
||||
syntax will be used.
|
||||
|
||||
If the statements include a dictionary, its closing bracket must not be
|
||||
written at the start of a line. Otherwise, it would be parsed as the end of
|
||||
the block. This does not work: >
|
||||
command NewCommand {
|
||||
g:mydict = {
|
||||
'key': 'value',
|
||||
} # ERROR: will be recognized as the end of the block
|
||||
}
|
||||
Put the '}' after the last item to avoid this: >
|
||||
command NewCommand {
|
||||
g:mydict = {
|
||||
'key': 'value' }
|
||||
}
|
||||
|
||||
Rationale: The "}" cannot be after a command because it would require parsing
|
||||
the commands to find it. For consistency with that no command can follow the
|
||||
"{". Unfortunately this means using "() => { command }" does not work, line
|
||||
@@ -585,7 +597,7 @@ Also when confused with the start of a command block: >
|
||||
|
||||
|
||||
Automatic line continuation ~
|
||||
|
||||
*vim9-line-continuation*
|
||||
In many cases it is obvious that an expression continues on the next line. In
|
||||
those cases there is no need to prefix the line with a backslash (see
|
||||
|line-continuation|). For example, when a list spans multiple lines: >
|
||||
@@ -763,7 +775,7 @@ No curly braces expansion ~
|
||||
|
||||
|
||||
Dictionary literals ~
|
||||
|
||||
*vim9-literal-dict*
|
||||
Traditionally Vim has supported dictionary literals with a {} syntax: >
|
||||
let dict = {'key': value}
|
||||
|
||||
@@ -853,7 +865,7 @@ first if needed.
|
||||
|
||||
|
||||
Conditions and expressions ~
|
||||
|
||||
*vim9-boolean*
|
||||
Conditions and expressions are mostly working like they do in other languages.
|
||||
Some values are different from legacy Vim script:
|
||||
value legacy Vim script Vim9 script ~
|
||||
@@ -905,8 +917,8 @@ always converted to string: >
|
||||
'hello ' .. 123 == 'hello 123'
|
||||
'hello ' .. v:true == 'hello true'
|
||||
|
||||
Simple types are string, float, special and bool. For other types |string()|
|
||||
can be used.
|
||||
Simple types are Number, Float, Special and Bool. For other types |string()|
|
||||
should be used.
|
||||
*false* *true* *null*
|
||||
In Vim9 script one can use "true" for v:true, "false" for v:false and "null"
|
||||
for v:null. When converting a boolean to a string "false" and "true" are
|
||||
@@ -1050,8 +1062,6 @@ Using ++var or --var in an expression is not supported yet.
|
||||
|
||||
3. New style functions *fast-functions*
|
||||
|
||||
THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
|
||||
|
||||
*:def*
|
||||
:def[!] {name}([arguments])[: {return-type}]
|
||||
Define a new function by the name {name}. The body of
|
||||
@@ -1167,8 +1177,6 @@ for each closure call a function to define it: >
|
||||
|
||||
4. Types *vim9-types*
|
||||
|
||||
THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
|
||||
|
||||
The following builtin types are supported:
|
||||
bool
|
||||
number
|
||||
@@ -1349,8 +1357,6 @@ Same for |extend()|, use |extendnew()| instead, and for |flatten()|, use
|
||||
5. Namespace, Import and Export
|
||||
*vim9script* *vim9-export* *vim9-import*
|
||||
|
||||
THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
|
||||
|
||||
A Vim9 script can be written to be imported. This means that everything in
|
||||
the script is local, unless exported. Those exported items, and only those
|
||||
items, can then be imported in another script.
|
||||
@@ -1385,6 +1391,7 @@ One of the effects is that |line-continuation| is always enabled.
|
||||
The original value of 'cpoptions' is restored at the end of the script, while
|
||||
flags added or removed in the script are also added to or removed from the
|
||||
original value to get the same effect. The order of flags may change.
|
||||
In the |vimrc| file sourced on startup this does not happen.
|
||||
|
||||
*vim9-mix*
|
||||
There is one way to use both legacy and Vim9 syntax in one script file: >
|
||||
@@ -1404,9 +1411,6 @@ This can only work in two ways:
|
||||
2. The "if" statement evaluates to true, the commands up to `endif` are
|
||||
executed and `finish` bails out before reaching `vim9script`.
|
||||
|
||||
TODO: The "vim9script" feature does not exist yet, it will only be added once
|
||||
the Vim9 script syntax has been fully implemented.
|
||||
|
||||
|
||||
Export ~
|
||||
*:export* *:exp*
|
||||
@@ -1664,7 +1668,8 @@ Specific items from TypeScript we avoid:
|
||||
- TypeScript can use an expression like "99 || 'yes'" in a condition, but
|
||||
cannot assign the value to a boolean. That is inconsistent and can be
|
||||
annoying. Vim recognizes an expression with && or || and allows using the
|
||||
result as a bool. TODO: to be reconsidered
|
||||
result as a bool. The |falsy-operator| was added for the mechanism to use a
|
||||
default value.
|
||||
- TypeScript considers an empty string as Falsy, but an empty list or dict as
|
||||
Truthy. That is inconsistent. In Vim an empty list and dict are also
|
||||
Falsy.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 Dec 03
|
||||
" Last Change: 2021 Dec 27
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -260,7 +260,7 @@ au BufNewFile,BufRead *.lpc,*.ulpc setf lpc
|
||||
au BufNewFile,BufRead calendar setf calendar
|
||||
|
||||
" C#
|
||||
au BufNewFile,BufRead *.cs setf cs
|
||||
au BufNewFile,BufRead *.cs,*.csx setf cs
|
||||
|
||||
" CSDL
|
||||
au BufNewFile,BufRead *.csdl setf csdl
|
||||
@@ -397,6 +397,7 @@ au BufNewFile,BufRead configure.in,configure.ac setf config
|
||||
au BufNewFile,BufRead *.cu,*.cuh setf cuda
|
||||
|
||||
" Dockerfile; Podman uses the same syntax with name Containerfile
|
||||
" Also see Dockerfile.* below.
|
||||
au BufNewFile,BufRead Containerfile,Dockerfile,*.Dockerfile setf dockerfile
|
||||
|
||||
" WildPackets EtherPeek Decoder
|
||||
@@ -490,6 +491,9 @@ au BufNewFile,BufRead dict.conf,.dictrc setf dictconf
|
||||
" Dictd config
|
||||
au BufNewFile,BufRead dictd*.conf setf dictdconf
|
||||
|
||||
" DEP3 formatted patch files
|
||||
au BufNewFile,BufRead */debian/patches/* call dist#ft#Dep3patch()
|
||||
|
||||
" Diff files
|
||||
au BufNewFile,BufRead *.diff,*.rej setf diff
|
||||
au BufNewFile,BufRead *.patch
|
||||
@@ -790,6 +794,10 @@ au BufNewFile,BufRead *.hb setf hb
|
||||
" Httest
|
||||
au BufNewFile,BufRead *.htt,*.htb setf httest
|
||||
|
||||
" i3 (and sway)
|
||||
au BufNewFile,BufRead */i3/config,*/sway/config setf i3config
|
||||
au BufNewFile,BufRead */.i3/config,*/.sway/config setf i3config
|
||||
|
||||
" Icon
|
||||
au BufNewFile,BufRead *.icn setf icon
|
||||
|
||||
@@ -955,9 +963,9 @@ au BufNewFile,BufRead lilo.conf setf lilo
|
||||
" Lisp (*.el = ELisp, *.cl = Common Lisp)
|
||||
" *.jl was removed, it's also used for Julia, better skip than guess wrong.
|
||||
if has("fname_case")
|
||||
au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.L,.emacs,.sawfishrc setf lisp
|
||||
au BufNewFile,BufRead *.lsp,*.lisp,*.asd,*.el,*.cl,*.L,.emacs,.sawfishrc setf lisp
|
||||
else
|
||||
au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,.emacs,.sawfishrc setf lisp
|
||||
au BufNewFile,BufRead *.lsp,*.lisp,*.asd,*.el,*.cl,.emacs,.sawfishrc setf lisp
|
||||
endif
|
||||
|
||||
" SBCL implementation of Common Lisp
|
||||
@@ -1084,7 +1092,9 @@ au BufNewFile,BufRead *.mmp setf mmp
|
||||
|
||||
" Modsim III (or LambdaProlog)
|
||||
au BufNewFile,BufRead *.mod
|
||||
\ if getline(1) =~ '\<module\>' |
|
||||
\ if expand("<afile>") =~ '\<go.mod$' |
|
||||
\ setf gomod |
|
||||
\ elseif getline(1) =~ '\<module\>' |
|
||||
\ setf lprolog |
|
||||
\ else |
|
||||
\ setf modsim3 |
|
||||
@@ -1659,7 +1669,7 @@ au BufNewFile,BufRead .zshrc,.zshenv,.zlogin,.zlogout,.zcompdump setf zsh
|
||||
au BufNewFile,BufRead *.zsh setf zsh
|
||||
|
||||
" Scheme
|
||||
au BufNewFile,BufRead *.scm,*.ss,*.rkt,*.rktd,*.rktl setf scheme
|
||||
au BufNewFile,BufRead *.scm,*.ss,*.sld,*.rkt,*.rktd,*.rktl setf scheme
|
||||
|
||||
" Screen RC
|
||||
au BufNewFile,BufRead .screenrc,screenrc setf screen
|
||||
@@ -1739,6 +1749,10 @@ au BufNewFile,BufRead *.speedup,*.spdata,*.spd setf spup
|
||||
" Slice
|
||||
au BufNewFile,BufRead *.ice setf slice
|
||||
|
||||
" Microsoft Visual Studio Solution
|
||||
au BufNewFile,BufRead *.sln setf solution
|
||||
au BufNewFile,BufRead *.slnf setf json
|
||||
|
||||
" Spice
|
||||
au BufNewFile,BufRead *.sp,*.spice setf spice
|
||||
|
||||
@@ -2225,6 +2239,9 @@ au BufNewFile,BufRead crontab,crontab.*,*/etc/cron.d/* call s:StarSetf('crontab
|
||||
" dnsmasq(8) configuration
|
||||
au BufNewFile,BufRead */etc/dnsmasq.d/* call s:StarSetf('dnsmasq')
|
||||
|
||||
" Dockerfile
|
||||
au BufNewFile,BufRead Dockerfile.*,Containerfile.* call s:StarSetf('dockerfile')
|
||||
|
||||
" Dracula
|
||||
au BufNewFile,BufRead drac.* call s:StarSetf('dracula')
|
||||
|
||||
|
||||
13
runtime/ftplugin/i3config.vim
Normal file
13
runtime/ftplugin/i3config.vim
Normal file
@@ -0,0 +1,13 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: i3 config file
|
||||
" Original Author: Mohamed Boughaba <mohamed dot bgb at gmail dot com>
|
||||
" Maintainer: Quentin Hibon
|
||||
" Version: 0.4
|
||||
" Last Change: 2021 Dec 14
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = "setlocal cms<"
|
||||
|
||||
setlocal commentstring=#\ %s
|
||||
37
runtime/ftplugin/solution.vim
Normal file
37
runtime/ftplugin/solution.vim
Normal file
@@ -0,0 +1,37 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Microsoft Visual Studio Solution
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 Dec 15
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal comments=:#
|
||||
setlocal commentstring=#\ %s
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms<"
|
||||
|
||||
if exists("loaded_matchit") && !exists("b:match_words")
|
||||
let b:match_words =
|
||||
\ '\<Project\>:\<EndProject\>,' ..
|
||||
\ '\<ProjectSection\>:\<EndProjectSection\>,' ..
|
||||
\ '\<Global\>:\<EndGlobal\>,' ..
|
||||
\ '\<GlobalSection\>:\<EndGlobalSection\>'
|
||||
let b:undo_ftplugin ..= " | unlet! b:match_words"
|
||||
endif
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "Microsoft Visual Studio Solution Files\t*.sln\n" ..
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
let b:undo_ftplugin ..= " | unlet! b:browsefilter"
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet:
|
||||
@@ -18,13 +18,13 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo< "
|
||||
|
||||
if executable('zsh')
|
||||
if executable('zsh') && &shell !~# '/\%(nologin\|false\)$'
|
||||
if !has('gui_running') && executable('less')
|
||||
command! -buffer -nargs=1 RunHelp silent exe '!MANPAGER= zsh -ic "autoload -Uz run-help; run-help <args> 2>/dev/null | LESS= less"' | redraw!
|
||||
command! -buffer -nargs=1 RunHelp silent exe '!MANPAGER= zsh -c "autoload -Uz run-help; run-help <args> 2>/dev/null | LESS= less"' | redraw!
|
||||
elseif has('terminal')
|
||||
command! -buffer -nargs=1 RunHelp silent exe ':term zsh -ic "autoload -Uz run-help; run-help <args>"'
|
||||
command! -buffer -nargs=1 RunHelp silent exe ':term zsh -c "autoload -Uz run-help; run-help <args>"'
|
||||
else
|
||||
command! -buffer -nargs=1 RunHelp echo system('zsh -ic "autoload -Uz run-help; run-help <args> 2>/dev/null"')
|
||||
command! -buffer -nargs=1 RunHelp echo system('zsh -c "autoload -Uz run-help; run-help <args> 2>/dev/null"')
|
||||
endif
|
||||
if !exists('current_compiler')
|
||||
compiler zsh
|
||||
|
||||
@@ -109,7 +109,7 @@ function! GetShIndent()
|
||||
let ind += s:indent_value('continuation-line')
|
||||
endif
|
||||
elseif s:end_block(line) && !s:start_block(line)
|
||||
let ind -= s:indent_value('default')
|
||||
let ind = indent(lnum)
|
||||
elseif pnum != 0 &&
|
||||
\ s:is_continuation_line(pline) &&
|
||||
\ !s:end_block(curline) &&
|
||||
|
||||
@@ -39,6 +39,8 @@ setlocal indentkeys=o,O,*<Return>,<>>,<<>,/,{,},!^F
|
||||
" autoindent: used when the indentexpr returns -1
|
||||
setlocal autoindent
|
||||
|
||||
let b:undo_indent = "setl ai< inde< indk<"
|
||||
|
||||
if !exists('b:xml_indent_open')
|
||||
let b:xml_indent_open = '.\{-}<[:A-Z_a-z]'
|
||||
" pre tag, e.g. <address>
|
||||
@@ -51,6 +53,10 @@ if !exists('b:xml_indent_close')
|
||||
" let b:xml_indent_close = '.\{-}</\(address\)\@!'
|
||||
endif
|
||||
|
||||
if !exists('b:xml_indent_continuation_filetype')
|
||||
let b:xml_indent_continuation_filetype = 'xml'
|
||||
endif
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
@@ -162,7 +168,7 @@ endfun
|
||||
|
||||
func! <SID>IsXMLContinuation(line)
|
||||
" Checks, whether or not the line matches a start-of-tag
|
||||
return a:line !~ '^\s*<' && &ft is# 'xml'
|
||||
return a:line !~ '^\s*<' && &ft =~# b:xml_indent_continuation_filetype
|
||||
endfunc
|
||||
|
||||
func! <SID>HasNoTagEnd(line)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" You can also use this as a start for your own set of menus.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2020 Sep 28
|
||||
" Last Change: 2021 Dec 22
|
||||
|
||||
" Note that ":an" (short for ":anoremenu") is often used to make a menu work
|
||||
" in all modes and avoid side effects from mappings defined by the user.
|
||||
@@ -717,6 +717,11 @@ func s:BMCanAdd(name, num)
|
||||
return 0
|
||||
endif
|
||||
|
||||
" no name with control characters
|
||||
if a:name =~ '[\x01-\x1f]'
|
||||
return 0
|
||||
endif
|
||||
|
||||
" no special buffer, such as terminal or popup
|
||||
let buftype = getbufvar(a:num, '&buftype')
|
||||
if buftype != '' && buftype != 'nofile' && buftype != 'nowrite'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" These commands create the option window.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 Oct 28
|
||||
" Last Change: 2021 Dec 21
|
||||
|
||||
" If there already is an option window, jump to that one.
|
||||
let buf = bufnr('option-window')
|
||||
@@ -260,10 +260,8 @@ call <SID>OptionG("sect", §)
|
||||
call <SID>AddOption("path", gettext("list of directory names used for file searching"))
|
||||
call append("$", "\t" .. s:global_or_local)
|
||||
call <SID>OptionG("pa", &pa)
|
||||
if exists("+cdhome")
|
||||
call <SID>AddOption("cdhome", gettext("change directory to the home directory by :cd"))
|
||||
call <SID>BinOptionG("cdh", &cdh)
|
||||
endif
|
||||
call <SID>AddOption("cdhome", gettext(":cd without argument goes to the home directory"))
|
||||
call <SID>BinOptionG("cdh", &cdh)
|
||||
call <SID>AddOption("cdpath", gettext("list of directory names used for :cd"))
|
||||
call <SID>OptionG("cd", &cd)
|
||||
if exists("+autochdir")
|
||||
@@ -564,14 +562,22 @@ endif
|
||||
call <SID>Header(gettext("terminal"))
|
||||
call <SID>AddOption("term", gettext("name of the used terminal"))
|
||||
call <SID>OptionG("term", &term)
|
||||
|
||||
call <SID>AddOption("ttytype", gettext("alias for 'term'"))
|
||||
call <SID>OptionG("tty", &tty)
|
||||
|
||||
call <SID>AddOption("ttybuiltin", gettext("check built-in termcaps first"))
|
||||
call <SID>BinOptionG("tbi", &tbi)
|
||||
|
||||
call <SID>AddOption("ttyfast", gettext("terminal connection is fast"))
|
||||
call <SID>BinOptionG("tf", &tf)
|
||||
|
||||
call <SID>AddOption("xtermcodes", gettext("request terminal key codes when an xterm is detected"))
|
||||
call <SID>BinOptionG("xtermcodes", &xtermcodes)
|
||||
|
||||
call <SID>AddOption("weirdinvert", gettext("terminal that requires extra redrawing"))
|
||||
call <SID>BinOptionG("wiv", &wiv)
|
||||
|
||||
call <SID>AddOption("esckeys", gettext("recognize keys that start with <Esc> in Insert mode"))
|
||||
call <SID>BinOptionG("ek", &ek)
|
||||
call <SID>AddOption("scrolljump", gettext("minimal number of lines to scroll at a time"))
|
||||
|
||||
251
runtime/pack/dist/opt/matchit/autoload/matchit.vim
vendored
251
runtime/pack/dist/opt/matchit/autoload/matchit.vim
vendored
@@ -1,6 +1,11 @@
|
||||
" matchit.vim: (global plugin) Extended "%" matching
|
||||
" autload script of matchit plugin, see ../plugin/matchit.vim
|
||||
" Last Change: Mar 01, 2020
|
||||
" Last Change: Jun 10, 2021
|
||||
|
||||
" Neovim does not support scriptversion
|
||||
if has("vimscript-4")
|
||||
scriptversion 4
|
||||
endif
|
||||
|
||||
let s:last_mps = ""
|
||||
let s:last_words = ":"
|
||||
@@ -30,11 +35,11 @@ function s:RestoreOptions()
|
||||
" In s:CleanUp(), :execute "set" restore_options .
|
||||
let restore_options = ""
|
||||
if get(b:, 'match_ignorecase', &ic) != &ic
|
||||
let restore_options .= (&ic ? " " : " no") . "ignorecase"
|
||||
let restore_options ..= (&ic ? " " : " no") .. "ignorecase"
|
||||
let &ignorecase = b:match_ignorecase
|
||||
endif
|
||||
if &ve != ''
|
||||
let restore_options = " ve=" . &ve . restore_options
|
||||
let restore_options = " ve=" .. &ve .. restore_options
|
||||
set ve=
|
||||
endif
|
||||
return restore_options
|
||||
@@ -42,22 +47,23 @@ endfunction
|
||||
|
||||
function matchit#Match_wrapper(word, forward, mode) range
|
||||
let restore_options = s:RestoreOptions()
|
||||
" If this function was called from Visual mode, make sure that the cursor
|
||||
" is at the correct end of the Visual range:
|
||||
if a:mode == "v"
|
||||
execute "normal! gv\<Esc>"
|
||||
elseif a:mode == "o" && mode(1) !~# '[vV]'
|
||||
exe "norm! v"
|
||||
elseif a:mode == "n" && mode(1) =~# 'ni'
|
||||
exe "norm! v"
|
||||
endif
|
||||
" In s:CleanUp(), we may need to check whether the cursor moved forward.
|
||||
let startpos = [line("."), col(".")]
|
||||
" Use default behavior if called with a count.
|
||||
" if a count has been applied, use the default [count]% mode (see :h N%)
|
||||
if v:count
|
||||
exe "normal! " . v:count . "%"
|
||||
exe "normal! " .. v:count .. "%"
|
||||
return s:CleanUp(restore_options, a:mode, startpos)
|
||||
end
|
||||
if a:mode =~# "v" && mode(1) =~# 'ni'
|
||||
exe "norm! gv"
|
||||
elseif a:mode == "o" && mode(1) !~# '[vV]'
|
||||
exe "norm! v"
|
||||
" If this function was called from Visual mode, make sure that the cursor
|
||||
" is at the correct end of the Visual range:
|
||||
elseif a:mode == "v"
|
||||
execute "normal! gv\<Esc>"
|
||||
let startpos = [line("."), col(".")]
|
||||
endif
|
||||
|
||||
" First step: if not already done, set the script variables
|
||||
" s:do_BR flag for whether there are backrefs
|
||||
@@ -78,30 +84,30 @@ function matchit#Match_wrapper(word, forward, mode) range
|
||||
" quote the special chars in 'matchpairs', replace [,:] with \| and then
|
||||
" append the builtin pairs (/*, */, #if, #ifdef, #ifndef, #else, #elif,
|
||||
" #endif)
|
||||
let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") .
|
||||
let default = escape(&mps, '[$^.*~\\/?]') .. (strlen(&mps) ? "," : "") ..
|
||||
\ '\/\*:\*\/,#\s*if\%(n\=def\)\=:#\s*else\>:#\s*elif\>:#\s*endif\>'
|
||||
" s:all = pattern with all the keywords
|
||||
let match_words = match_words . (strlen(match_words) ? "," : "") . default
|
||||
let match_words = match_words .. (strlen(match_words) ? "," : "") .. default
|
||||
let s:last_words = match_words
|
||||
if match_words !~ s:notslash . '\\\d'
|
||||
if match_words !~ s:notslash .. '\\\d'
|
||||
let s:do_BR = 0
|
||||
let s:pat = match_words
|
||||
else
|
||||
let s:do_BR = 1
|
||||
let s:pat = s:ParseWords(match_words)
|
||||
endif
|
||||
let s:all = substitute(s:pat, s:notslash . '\zs[,:]\+', '\\|', 'g')
|
||||
let s:all = substitute(s:pat, s:notslash .. '\zs[,:]\+', '\\|', 'g')
|
||||
" Just in case there are too many '\(...)' groups inside the pattern, make
|
||||
" sure to use \%(...) groups, so that error E872 can be avoided
|
||||
let s:all = substitute(s:all, '\\(', '\\%(', 'g')
|
||||
let s:all = '\%(' . s:all . '\)'
|
||||
let s:all = '\%(' .. s:all .. '\)'
|
||||
if exists("b:match_debug")
|
||||
let b:match_pat = s:pat
|
||||
endif
|
||||
" Reconstruct the version with unresolved backrefs.
|
||||
let s:patBR = substitute(match_words.',',
|
||||
\ s:notslash.'\zs[,:]*,[,:]*', ',', 'g')
|
||||
let s:patBR = substitute(s:patBR, s:notslash.'\zs:\{2,}', ':', 'g')
|
||||
let s:patBR = substitute(match_words .. ',',
|
||||
\ s:notslash .. '\zs[,:]*,[,:]*', ',', 'g')
|
||||
let s:patBR = substitute(s:patBR, s:notslash .. '\zs:\{2,}', ':', 'g')
|
||||
endif
|
||||
|
||||
" Second step: set the following local variables:
|
||||
@@ -128,12 +134,15 @@ function matchit#Match_wrapper(word, forward, mode) range
|
||||
let curcol = match(matchline, regexp)
|
||||
" If there is no match, give up.
|
||||
if curcol == -1
|
||||
" Make sure macros abort properly
|
||||
"exe "norm! \<esc>"
|
||||
call feedkeys("\e", 'tni')
|
||||
return s:CleanUp(restore_options, a:mode, startpos)
|
||||
endif
|
||||
let endcol = matchend(matchline, regexp)
|
||||
let suf = strlen(matchline) - endcol
|
||||
let prefix = (curcol ? '^.*\%' . (curcol + 1) . 'c\%(' : '^\%(')
|
||||
let suffix = (suf ? '\)\%' . (endcol + 1) . 'c.*$' : '\)$')
|
||||
let prefix = (curcol ? '^.*\%' .. (curcol + 1) .. 'c\%(' : '^\%(')
|
||||
let suffix = (suf ? '\)\%' .. (endcol + 1) .. 'c.*$' : '\)$')
|
||||
endif
|
||||
if exists("b:match_debug")
|
||||
let b:match_match = matchstr(matchline, regexp)
|
||||
@@ -150,7 +159,7 @@ function matchit#Match_wrapper(word, forward, mode) range
|
||||
" 'while:endwhile' or whatever. A bit of a kluge: s:Choose() returns
|
||||
" group . "," . groupBR, and we pick it apart.
|
||||
let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, s:patBR)
|
||||
let i = matchend(group, s:notslash . ",")
|
||||
let i = matchend(group, s:notslash .. ",")
|
||||
let groupBR = strpart(group, i)
|
||||
let group = strpart(group, 0, i-1)
|
||||
" Now, matchline =~ prefix . substitute(group,':','\|','g') . suffix
|
||||
@@ -159,32 +168,32 @@ function matchit#Match_wrapper(word, forward, mode) range
|
||||
endif
|
||||
if exists("b:match_debug")
|
||||
let b:match_wholeBR = groupBR
|
||||
let i = matchend(groupBR, s:notslash . ":")
|
||||
let i = matchend(groupBR, s:notslash .. ":")
|
||||
let b:match_iniBR = strpart(groupBR, 0, i-1)
|
||||
endif
|
||||
|
||||
" Fourth step: Set the arguments for searchpair().
|
||||
let i = matchend(group, s:notslash . ":")
|
||||
let j = matchend(group, '.*' . s:notslash . ":")
|
||||
let i = matchend(group, s:notslash .. ":")
|
||||
let j = matchend(group, '.*' .. s:notslash .. ":")
|
||||
let ini = strpart(group, 0, i-1)
|
||||
let mid = substitute(strpart(group, i,j-i-1), s:notslash.'\zs:', '\\|', 'g')
|
||||
let mid = substitute(strpart(group, i,j-i-1), s:notslash .. '\zs:', '\\|', 'g')
|
||||
let fin = strpart(group, j)
|
||||
"Un-escape the remaining , and : characters.
|
||||
let ini = substitute(ini, s:notslash . '\zs\\\(:\|,\)', '\1', 'g')
|
||||
let mid = substitute(mid, s:notslash . '\zs\\\(:\|,\)', '\1', 'g')
|
||||
let fin = substitute(fin, s:notslash . '\zs\\\(:\|,\)', '\1', 'g')
|
||||
let ini = substitute(ini, s:notslash .. '\zs\\\(:\|,\)', '\1', 'g')
|
||||
let mid = substitute(mid, s:notslash .. '\zs\\\(:\|,\)', '\1', 'g')
|
||||
let fin = substitute(fin, s:notslash .. '\zs\\\(:\|,\)', '\1', 'g')
|
||||
" searchpair() requires that these patterns avoid \(\) groups.
|
||||
let ini = substitute(ini, s:notslash . '\zs\\(', '\\%(', 'g')
|
||||
let mid = substitute(mid, s:notslash . '\zs\\(', '\\%(', 'g')
|
||||
let fin = substitute(fin, s:notslash . '\zs\\(', '\\%(', 'g')
|
||||
let ini = substitute(ini, s:notslash .. '\zs\\(', '\\%(', 'g')
|
||||
let mid = substitute(mid, s:notslash .. '\zs\\(', '\\%(', 'g')
|
||||
let fin = substitute(fin, s:notslash .. '\zs\\(', '\\%(', 'g')
|
||||
" Set mid. This is optimized for readability, not micro-efficiency!
|
||||
if a:forward && matchline =~ prefix . fin . suffix
|
||||
\ || !a:forward && matchline =~ prefix . ini . suffix
|
||||
if a:forward && matchline =~ prefix .. fin .. suffix
|
||||
\ || !a:forward && matchline =~ prefix .. ini .. suffix
|
||||
let mid = ""
|
||||
endif
|
||||
" Set flag. This is optimized for readability, not micro-efficiency!
|
||||
if a:forward && matchline =~ prefix . fin . suffix
|
||||
\ || !a:forward && matchline !~ prefix . ini . suffix
|
||||
if a:forward && matchline =~ prefix .. fin .. suffix
|
||||
\ || !a:forward && matchline !~ prefix .. ini .. suffix
|
||||
let flag = "bW"
|
||||
else
|
||||
let flag = "W"
|
||||
@@ -193,14 +202,14 @@ function matchit#Match_wrapper(word, forward, mode) range
|
||||
if exists("b:match_skip")
|
||||
let skip = b:match_skip
|
||||
elseif exists("b:match_comment") " backwards compatibility and testing!
|
||||
let skip = "r:" . b:match_comment
|
||||
let skip = "r:" .. b:match_comment
|
||||
else
|
||||
let skip = 's:comment\|string'
|
||||
endif
|
||||
let skip = s:ParseSkip(skip)
|
||||
if exists("b:match_debug")
|
||||
let b:match_ini = ini
|
||||
let b:match_tail = (strlen(mid) ? mid.'\|' : '') . fin
|
||||
let b:match_tail = (strlen(mid) ? mid .. '\|' : '') .. fin
|
||||
endif
|
||||
|
||||
" Fifth step: actually start moving the cursor and call searchpair().
|
||||
@@ -210,25 +219,29 @@ function matchit#Match_wrapper(word, forward, mode) range
|
||||
if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on"))
|
||||
let skip = "0"
|
||||
else
|
||||
execute "if " . skip . "| let skip = '0' | endif"
|
||||
execute "if " .. skip .. "| let skip = '0' | endif"
|
||||
endif
|
||||
let sp_return = searchpair(ini, mid, fin, flag, skip)
|
||||
if &selection isnot# 'inclusive' && a:mode == 'v'
|
||||
" move cursor one pos to the right, because selection is not inclusive
|
||||
" add virtualedit=onemore, to make it work even when the match ends the " line
|
||||
" add virtualedit=onemore, to make it work even when the match ends the
|
||||
" line
|
||||
if !(col('.') < col('$')-1)
|
||||
set ve=onemore
|
||||
let eolmark=1 " flag to set a mark on eol (since we cannot move there)
|
||||
endif
|
||||
norm! l
|
||||
endif
|
||||
let final_position = "call cursor(" . line(".") . "," . col(".") . ")"
|
||||
let final_position = "call cursor(" .. line(".") .. "," .. col(".") .. ")"
|
||||
" Restore cursor position and original screen.
|
||||
call winrestview(view)
|
||||
normal! m'
|
||||
if sp_return > 0
|
||||
execute final_position
|
||||
endif
|
||||
return s:CleanUp(restore_options, a:mode, startpos, mid.'\|'.fin)
|
||||
if exists('eolmark') && eolmark
|
||||
call setpos("''", [0, line('.'), col('$'), 0]) " set mark on the eol
|
||||
endif
|
||||
return s:CleanUp(restore_options, a:mode, startpos, mid .. '\|' .. fin)
|
||||
endfun
|
||||
|
||||
" Restore options and do some special handling for Operator-pending mode.
|
||||
@@ -270,16 +283,16 @@ endfun
|
||||
" a:matchline = "123<tag>12" or "123</tag>12"
|
||||
" then extract "tag" from a:matchline and return "<tag>:</tag>" .
|
||||
fun! s:InsertRefs(groupBR, prefix, group, suffix, matchline)
|
||||
if a:matchline !~ a:prefix .
|
||||
\ substitute(a:group, s:notslash . '\zs:', '\\|', 'g') . a:suffix
|
||||
if a:matchline !~ a:prefix ..
|
||||
\ substitute(a:group, s:notslash .. '\zs:', '\\|', 'g') .. a:suffix
|
||||
return a:group
|
||||
endif
|
||||
let i = matchend(a:groupBR, s:notslash . ':')
|
||||
let i = matchend(a:groupBR, s:notslash .. ':')
|
||||
let ini = strpart(a:groupBR, 0, i-1)
|
||||
let tailBR = strpart(a:groupBR, i)
|
||||
let word = s:Choose(a:group, a:matchline, ":", "", a:prefix, a:suffix,
|
||||
\ a:groupBR)
|
||||
let i = matchend(word, s:notslash . ":")
|
||||
let i = matchend(word, s:notslash .. ":")
|
||||
let wordBR = strpart(word, i)
|
||||
let word = strpart(word, 0, i-1)
|
||||
" Now, a:matchline =~ a:prefix . word . a:suffix
|
||||
@@ -289,10 +302,10 @@ fun! s:InsertRefs(groupBR, prefix, group, suffix, matchline)
|
||||
let table = ""
|
||||
let d = 0
|
||||
while d < 10
|
||||
if tailBR =~ s:notslash . '\\' . d
|
||||
let table = table . d
|
||||
if tailBR =~ s:notslash .. '\\' .. d
|
||||
let table = table .. d
|
||||
else
|
||||
let table = table . "-"
|
||||
let table = table .. "-"
|
||||
endif
|
||||
let d = d + 1
|
||||
endwhile
|
||||
@@ -300,13 +313,13 @@ fun! s:InsertRefs(groupBR, prefix, group, suffix, matchline)
|
||||
let d = 9
|
||||
while d
|
||||
if table[d] != "-"
|
||||
let backref = substitute(a:matchline, a:prefix.word.a:suffix,
|
||||
\ '\'.table[d], "")
|
||||
let backref = substitute(a:matchline, a:prefix .. word .. a:suffix,
|
||||
\ '\' .. table[d], "")
|
||||
" Are there any other characters that should be escaped?
|
||||
let backref = escape(backref, '*,:')
|
||||
execute s:Ref(ini, d, "start", "len")
|
||||
let ini = strpart(ini, 0, start) . backref . strpart(ini, start+len)
|
||||
let tailBR = substitute(tailBR, s:notslash . '\zs\\' . d,
|
||||
let ini = strpart(ini, 0, start) .. backref .. strpart(ini, start+len)
|
||||
let tailBR = substitute(tailBR, s:notslash .. '\zs\\' .. d,
|
||||
\ escape(backref, '\\&'), 'g')
|
||||
endif
|
||||
let d = d-1
|
||||
@@ -320,7 +333,7 @@ fun! s:InsertRefs(groupBR, prefix, group, suffix, matchline)
|
||||
let b:match_word = ""
|
||||
endif
|
||||
endif
|
||||
return ini . ":" . tailBR
|
||||
return ini .. ":" .. tailBR
|
||||
endfun
|
||||
|
||||
" Input a comma-separated list of groups with backrefs, such as
|
||||
@@ -328,25 +341,25 @@ endfun
|
||||
" and return a comma-separated list of groups with backrefs replaced:
|
||||
" return '\(foo\):end\(foo\),\(bar\):end\(bar\)'
|
||||
fun! s:ParseWords(groups)
|
||||
let groups = substitute(a:groups.",", s:notslash.'\zs[,:]*,[,:]*', ',', 'g')
|
||||
let groups = substitute(groups, s:notslash . '\zs:\{2,}', ':', 'g')
|
||||
let groups = substitute(a:groups .. ",", s:notslash .. '\zs[,:]*,[,:]*', ',', 'g')
|
||||
let groups = substitute(groups, s:notslash .. '\zs:\{2,}', ':', 'g')
|
||||
let parsed = ""
|
||||
while groups =~ '[^,:]'
|
||||
let i = matchend(groups, s:notslash . ':')
|
||||
let j = matchend(groups, s:notslash . ',')
|
||||
let i = matchend(groups, s:notslash .. ':')
|
||||
let j = matchend(groups, s:notslash .. ',')
|
||||
let ini = strpart(groups, 0, i-1)
|
||||
let tail = strpart(groups, i, j-i-1) . ":"
|
||||
let tail = strpart(groups, i, j-i-1) .. ":"
|
||||
let groups = strpart(groups, j)
|
||||
let parsed = parsed . ini
|
||||
let i = matchend(tail, s:notslash . ':')
|
||||
let parsed = parsed .. ini
|
||||
let i = matchend(tail, s:notslash .. ':')
|
||||
while i != -1
|
||||
" In 'if:else:endif', ini='if' and word='else' and then word='endif'.
|
||||
let word = strpart(tail, 0, i-1)
|
||||
let tail = strpart(tail, i)
|
||||
let i = matchend(tail, s:notslash . ':')
|
||||
let parsed = parsed . ":" . s:Resolve(ini, word, "word")
|
||||
let i = matchend(tail, s:notslash .. ':')
|
||||
let parsed = parsed .. ":" .. s:Resolve(ini, word, "word")
|
||||
endwhile " Now, tail has been used up.
|
||||
let parsed = parsed . ","
|
||||
let parsed = parsed .. ","
|
||||
endwhile " groups =~ '[^,:]'
|
||||
let parsed = substitute(parsed, ',$', '', '')
|
||||
return parsed
|
||||
@@ -364,14 +377,14 @@ endfun
|
||||
" let j = matchend(getline("."), regexp)
|
||||
" let match = matchstr(getline("."), regexp)
|
||||
fun! s:Wholematch(string, pat, start)
|
||||
let group = '\%(' . a:pat . '\)'
|
||||
let prefix = (a:start ? '\(^.*\%<' . (a:start + 2) . 'c\)\zs' : '^')
|
||||
let group = '\%(' .. a:pat .. '\)'
|
||||
let prefix = (a:start ? '\(^.*\%<' .. (a:start + 2) .. 'c\)\zs' : '^')
|
||||
let len = strlen(a:string)
|
||||
let suffix = (a:start+1 < len ? '\(\%>'.(a:start+1).'c.*$\)\@=' : '$')
|
||||
if a:string !~ prefix . group . suffix
|
||||
let suffix = (a:start+1 < len ? '\(\%>' .. (a:start+1) .. 'c.*$\)\@=' : '$')
|
||||
if a:string !~ prefix .. group .. suffix
|
||||
let prefix = ''
|
||||
endif
|
||||
return prefix . group . suffix
|
||||
return prefix .. group .. suffix
|
||||
endfun
|
||||
|
||||
" No extra arguments: s:Ref(string, d) will
|
||||
@@ -392,7 +405,7 @@ fun! s:Ref(string, d, ...)
|
||||
let match = a:string
|
||||
while cnt
|
||||
let cnt = cnt - 1
|
||||
let index = matchend(match, s:notslash . '\\(')
|
||||
let index = matchend(match, s:notslash .. '\\(')
|
||||
if index == -1
|
||||
return ""
|
||||
endif
|
||||
@@ -404,7 +417,7 @@ fun! s:Ref(string, d, ...)
|
||||
endif
|
||||
let cnt = 1
|
||||
while cnt
|
||||
let index = matchend(match, s:notslash . '\\(\|\\)') - 1
|
||||
let index = matchend(match, s:notslash .. '\\(\|\\)') - 1
|
||||
if index == -2
|
||||
return ""
|
||||
endif
|
||||
@@ -418,7 +431,7 @@ fun! s:Ref(string, d, ...)
|
||||
if a:0 == 1
|
||||
return len
|
||||
elseif a:0 == 2
|
||||
return "let " . a:1 . "=" . start . "| let " . a:2 . "=" . len
|
||||
return "let " .. a:1 .. "=" .. start .. "| let " .. a:2 .. "=" .. len
|
||||
else
|
||||
return strpart(a:string, start, len)
|
||||
endif
|
||||
@@ -431,9 +444,9 @@ endfun
|
||||
fun! s:Count(string, pattern, ...)
|
||||
let pat = escape(a:pattern, '\\')
|
||||
if a:0 > 1
|
||||
let foo = substitute(a:string, '[^'.a:pattern.']', "a:1", "g")
|
||||
let foo = substitute(a:string, '[^' .. a:pattern .. ']', "a:1", "g")
|
||||
let foo = substitute(a:string, pat, a:2, "g")
|
||||
let foo = substitute(foo, '[^' . a:2 . ']', "", "g")
|
||||
let foo = substitute(foo, '[^' .. a:2 .. ']', "", "g")
|
||||
return strlen(foo)
|
||||
endif
|
||||
let result = 0
|
||||
@@ -456,7 +469,7 @@ endfun
|
||||
" unless it is preceded by "\".
|
||||
fun! s:Resolve(source, target, output)
|
||||
let word = a:target
|
||||
let i = matchend(word, s:notslash . '\\\d') - 1
|
||||
let i = matchend(word, s:notslash .. '\\\d') - 1
|
||||
let table = "----------"
|
||||
while i != -2 " There are back references to be replaced.
|
||||
let d = word[i]
|
||||
@@ -477,28 +490,28 @@ fun! s:Resolve(source, target, output)
|
||||
if table[s] == "-"
|
||||
if w + b < 10
|
||||
" let table[s] = w + b
|
||||
let table = strpart(table, 0, s) . (w+b) . strpart(table, s+1)
|
||||
let table = strpart(table, 0, s) .. (w+b) .. strpart(table, s+1)
|
||||
endif
|
||||
let b = b + 1
|
||||
let s = s + 1
|
||||
else
|
||||
execute s:Ref(backref, b, "start", "len")
|
||||
let ref = strpart(backref, start, len)
|
||||
let backref = strpart(backref, 0, start) . ":". table[s]
|
||||
\ . strpart(backref, start+len)
|
||||
let backref = strpart(backref, 0, start) .. ":" .. table[s]
|
||||
\ .. strpart(backref, start+len)
|
||||
let s = s + s:Count(substitute(ref, '\\\\', '', 'g'), '\(', '1')
|
||||
endif
|
||||
endwhile
|
||||
let word = strpart(word, 0, i-1) . backref . strpart(word, i+1)
|
||||
let i = matchend(word, s:notslash . '\\\d') - 1
|
||||
let word = strpart(word, 0, i-1) .. backref .. strpart(word, i+1)
|
||||
let i = matchend(word, s:notslash .. '\\\d') - 1
|
||||
endwhile
|
||||
let word = substitute(word, s:notslash . '\zs:', '\\', 'g')
|
||||
let word = substitute(word, s:notslash .. '\zs:', '\\', 'g')
|
||||
if a:output == "table"
|
||||
return table
|
||||
elseif a:output == "word"
|
||||
return word
|
||||
else
|
||||
return table . word
|
||||
return table .. word
|
||||
endif
|
||||
endfun
|
||||
|
||||
@@ -508,21 +521,21 @@ endfun
|
||||
" If <patn> is the first pattern that matches a:string then return <patn>
|
||||
" if no optional arguments are given; return <patn>,<altn> if a:1 is given.
|
||||
fun! s:Choose(patterns, string, comma, branch, prefix, suffix, ...)
|
||||
let tail = (a:patterns =~ a:comma."$" ? a:patterns : a:patterns . a:comma)
|
||||
let i = matchend(tail, s:notslash . a:comma)
|
||||
let tail = (a:patterns =~ a:comma .. "$" ? a:patterns : a:patterns .. a:comma)
|
||||
let i = matchend(tail, s:notslash .. a:comma)
|
||||
if a:0
|
||||
let alttail = (a:1 =~ a:comma."$" ? a:1 : a:1 . a:comma)
|
||||
let j = matchend(alttail, s:notslash . a:comma)
|
||||
let alttail = (a:1 =~ a:comma .. "$" ? a:1 : a:1 .. a:comma)
|
||||
let j = matchend(alttail, s:notslash .. a:comma)
|
||||
endif
|
||||
let current = strpart(tail, 0, i-1)
|
||||
if a:branch == ""
|
||||
let currpat = current
|
||||
else
|
||||
let currpat = substitute(current, s:notslash . a:branch, '\\|', 'g')
|
||||
let currpat = substitute(current, s:notslash .. a:branch, '\\|', 'g')
|
||||
endif
|
||||
while a:string !~ a:prefix . currpat . a:suffix
|
||||
while a:string !~ a:prefix .. currpat .. a:suffix
|
||||
let tail = strpart(tail, i)
|
||||
let i = matchend(tail, s:notslash . a:comma)
|
||||
let i = matchend(tail, s:notslash .. a:comma)
|
||||
if i == -1
|
||||
return -1
|
||||
endif
|
||||
@@ -530,15 +543,15 @@ fun! s:Choose(patterns, string, comma, branch, prefix, suffix, ...)
|
||||
if a:branch == ""
|
||||
let currpat = current
|
||||
else
|
||||
let currpat = substitute(current, s:notslash . a:branch, '\\|', 'g')
|
||||
let currpat = substitute(current, s:notslash .. a:branch, '\\|', 'g')
|
||||
endif
|
||||
if a:0
|
||||
let alttail = strpart(alttail, j)
|
||||
let j = matchend(alttail, s:notslash . a:comma)
|
||||
let j = matchend(alttail, s:notslash .. a:comma)
|
||||
endif
|
||||
endwhile
|
||||
if a:0
|
||||
let current = current . a:comma . strpart(alttail, 0, j-1)
|
||||
let current = current .. a:comma .. strpart(alttail, 0, j-1)
|
||||
endif
|
||||
return current
|
||||
endfun
|
||||
@@ -562,7 +575,7 @@ fun! matchit#Match_debug()
|
||||
" fin = 'endif' piece, with all backrefs resolved from match
|
||||
amenu &Matchit.&word :echo b:match_word<CR>
|
||||
" '\'.d in ini refers to the same thing as '\'.table[d] in word.
|
||||
amenu &Matchit.t&able :echo '0:' . b:match_table . ':9'<CR>
|
||||
amenu &Matchit.t&able :echo '0:' .. b:match_table .. ':9'<CR>
|
||||
endfun
|
||||
|
||||
" Jump to the nearest unmatched "(" or "if" or "<tag>" if a:spflag == "bW"
|
||||
@@ -598,26 +611,26 @@ fun! matchit#MultiMatch(spflag, mode)
|
||||
endif
|
||||
if (match_words != s:last_words) || (&mps != s:last_mps) ||
|
||||
\ exists("b:match_debug")
|
||||
let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") .
|
||||
let default = escape(&mps, '[$^.*~\\/?]') .. (strlen(&mps) ? "," : "") ..
|
||||
\ '\/\*:\*\/,#\s*if\%(n\=def\)\=:#\s*else\>:#\s*elif\>:#\s*endif\>'
|
||||
let s:last_mps = &mps
|
||||
let match_words = match_words . (strlen(match_words) ? "," : "") . default
|
||||
let match_words = match_words .. (strlen(match_words) ? "," : "") .. default
|
||||
let s:last_words = match_words
|
||||
if match_words !~ s:notslash . '\\\d'
|
||||
if match_words !~ s:notslash .. '\\\d'
|
||||
let s:do_BR = 0
|
||||
let s:pat = match_words
|
||||
else
|
||||
let s:do_BR = 1
|
||||
let s:pat = s:ParseWords(match_words)
|
||||
endif
|
||||
let s:all = '\%(' . substitute(s:pat, '[,:]\+', '\\|', 'g') . '\)'
|
||||
let s:all = '\%(' .. substitute(s:pat, '[,:]\+', '\\|', 'g') .. '\)'
|
||||
if exists("b:match_debug")
|
||||
let b:match_pat = s:pat
|
||||
endif
|
||||
" Reconstruct the version with unresolved backrefs.
|
||||
let s:patBR = substitute(match_words.',',
|
||||
\ s:notslash.'\zs[,:]*,[,:]*', ',', 'g')
|
||||
let s:patBR = substitute(s:patBR, s:notslash.'\zs:\{2,}', ':', 'g')
|
||||
let s:patBR = substitute(match_words .. ',',
|
||||
\ s:notslash .. '\zs[,:]*,[,:]*', ',', 'g')
|
||||
let s:patBR = substitute(s:patBR, s:notslash .. '\zs:\{2,}', ':', 'g')
|
||||
endif
|
||||
|
||||
" Second step: figure out the patterns for searchpair()
|
||||
@@ -625,23 +638,23 @@ fun! matchit#MultiMatch(spflag, mode)
|
||||
" - TODO: A lot of this is copied from matchit#Match_wrapper().
|
||||
" - maybe even more functionality should be split off
|
||||
" - into separate functions!
|
||||
let openlist = split(s:pat . ',', s:notslash . '\zs:.\{-}' . s:notslash . ',')
|
||||
let midclolist = split(',' . s:pat, s:notslash . '\zs,.\{-}' . s:notslash . ':')
|
||||
call map(midclolist, {-> split(v:val, s:notslash . ':')})
|
||||
let openlist = split(s:pat .. ',', s:notslash .. '\zs:.\{-}' .. s:notslash .. ',')
|
||||
let midclolist = split(',' .. s:pat, s:notslash .. '\zs,.\{-}' .. s:notslash .. ':')
|
||||
call map(midclolist, {-> split(v:val, s:notslash .. ':')})
|
||||
let closelist = []
|
||||
let middlelist = []
|
||||
call map(midclolist, {i,v -> [extend(closelist, v[-1 : -1]),
|
||||
\ extend(middlelist, v[0 : -2])]})
|
||||
call map(openlist, {i,v -> v =~# s:notslash . '\\|' ? '\%(' . v . '\)' : v})
|
||||
call map(middlelist, {i,v -> v =~# s:notslash . '\\|' ? '\%(' . v . '\)' : v})
|
||||
call map(closelist, {i,v -> v =~# s:notslash . '\\|' ? '\%(' . v . '\)' : v})
|
||||
call map(openlist, {i,v -> v =~# s:notslash .. '\\|' ? '\%(' .. v .. '\)' : v})
|
||||
call map(middlelist, {i,v -> v =~# s:notslash .. '\\|' ? '\%(' .. v .. '\)' : v})
|
||||
call map(closelist, {i,v -> v =~# s:notslash .. '\\|' ? '\%(' .. v .. '\)' : v})
|
||||
let open = join(openlist, ',')
|
||||
let middle = join(middlelist, ',')
|
||||
let close = join(closelist, ',')
|
||||
if exists("b:match_skip")
|
||||
let skip = b:match_skip
|
||||
elseif exists("b:match_comment") " backwards compatibility and testing!
|
||||
let skip = "r:" . b:match_comment
|
||||
let skip = "r:" .. b:match_comment
|
||||
else
|
||||
let skip = 's:comment\|string'
|
||||
endif
|
||||
@@ -650,18 +663,18 @@ fun! matchit#MultiMatch(spflag, mode)
|
||||
|
||||
" Third step: call searchpair().
|
||||
" Replace '\('--but not '\\('--with '\%(' and ',' with '\|'.
|
||||
let openpat = substitute(open, '\%(' . s:notslash . '\)\@<=\\(', '\\%(', 'g')
|
||||
let openpat = substitute(open, '\%(' .. s:notslash .. '\)\@<=\\(', '\\%(', 'g')
|
||||
let openpat = substitute(openpat, ',', '\\|', 'g')
|
||||
let closepat = substitute(close, '\%(' . s:notslash . '\)\@<=\\(', '\\%(', 'g')
|
||||
let closepat = substitute(close, '\%(' .. s:notslash .. '\)\@<=\\(', '\\%(', 'g')
|
||||
let closepat = substitute(closepat, ',', '\\|', 'g')
|
||||
let middlepat = substitute(middle, '\%(' . s:notslash . '\)\@<=\\(', '\\%(', 'g')
|
||||
let middlepat = substitute(middle, '\%(' .. s:notslash .. '\)\@<=\\(', '\\%(', 'g')
|
||||
let middlepat = substitute(middlepat, ',', '\\|', 'g')
|
||||
|
||||
if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on"))
|
||||
let skip = '0'
|
||||
else
|
||||
try
|
||||
execute "if " . skip . "| let skip = '0' | endif"
|
||||
execute "if " .. skip .. "| let skip = '0' | endif"
|
||||
catch /^Vim\%((\a\+)\)\=:E363/
|
||||
" We won't find anything, so skip searching, should keep Vim responsive.
|
||||
return {}
|
||||
@@ -744,11 +757,11 @@ fun! s:ParseSkip(str)
|
||||
let skip = a:str
|
||||
if skip[1] == ":"
|
||||
if skip[0] == "s"
|
||||
let skip = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '" .
|
||||
\ strpart(skip,2) . "'"
|
||||
let skip = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '" ..
|
||||
\ strpart(skip,2) .. "'"
|
||||
elseif skip[0] == "S"
|
||||
let skip = "synIDattr(synID(line('.'),col('.'),1),'name') !~? '" .
|
||||
\ strpart(skip,2) . "'"
|
||||
let skip = "synIDattr(synID(line('.'),col('.'),1),'name') !~? '" ..
|
||||
\ strpart(skip,2) .. "'"
|
||||
elseif skip[0] == "r"
|
||||
let skip = "strpart(getline('.'),0,col('.'))=~'" . strpart(skip,2). "'"
|
||||
elseif skip[0] == "R"
|
||||
|
||||
13
runtime/pack/dist/opt/matchit/doc/matchit.txt
vendored
13
runtime/pack/dist/opt/matchit/doc/matchit.txt
vendored
@@ -4,7 +4,7 @@ For instructions on installing this file, type
|
||||
`:help matchit-install`
|
||||
inside Vim.
|
||||
|
||||
For Vim version 8.1. Last change: 2021 Nov 13
|
||||
For Vim version 8.2. Last change: 2021 Dec 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Benji Fisher et al
|
||||
@@ -148,6 +148,13 @@ To use the matchit plugin add this line to your |vimrc|: >
|
||||
|
||||
The script should start working the next time you start Vim.
|
||||
|
||||
To use the matching plugin after startup, you can use this command (note the
|
||||
omitted '!'): >
|
||||
packadd matchit
|
||||
|
||||
To use the matchit plugin after Vim has started, execute this command: >
|
||||
packadd matchit
|
||||
|
||||
(Earlier versions of the script did nothing unless a |buffer-variable| named
|
||||
|b:match_words| was defined. Even earlier versions contained autocommands
|
||||
that set this variable for various file types. Now, |b:match_words| is
|
||||
@@ -376,8 +383,8 @@ The back reference '\'.d refers to the same thing as '\'.b:match_table[d] in
|
||||
5. Known Bugs and Limitations *matchit-bugs*
|
||||
|
||||
Repository: https://github.com/chrisbra/matchit/
|
||||
Bugs can be reported at the repository (alternatively you can send me a mail).
|
||||
The latest development snapshot can also be downloaded there.
|
||||
Bugs can be reported at the repository and the latest development snapshot can
|
||||
also be downloaded there.
|
||||
|
||||
Just because I know about a bug does not mean that it is on my todo list. I
|
||||
try to respond to reports of bugs that cause real problems. If it does not
|
||||
|
||||
42
runtime/pack/dist/opt/matchit/plugin/matchit.vim
vendored
42
runtime/pack/dist/opt/matchit/plugin/matchit.vim
vendored
@@ -1,7 +1,7 @@
|
||||
" matchit.vim: (global plugin) Extended "%" matching
|
||||
" Maintainer: Christian Brabandt
|
||||
" Version: 1.17
|
||||
" Last Change: 2019 Oct 24
|
||||
" Version: 1.18
|
||||
" Last Change: 2020 Dec 23
|
||||
" Repository: https://github.com/chrisbra/matchit
|
||||
" Previous URL:http://www.vim.org/script.php?script_id=39
|
||||
" Previous Maintainer: Benji Fisher PhD <benji@member.AMS.org>
|
||||
@@ -48,18 +48,12 @@ set cpo&vim
|
||||
|
||||
nnoremap <silent> <Plug>(MatchitNormalForward) :<C-U>call matchit#Match_wrapper('',1,'n')<CR>
|
||||
nnoremap <silent> <Plug>(MatchitNormalBackward) :<C-U>call matchit#Match_wrapper('',0,'n')<CR>
|
||||
xnoremap <silent> <Plug>(MatchitVisualForward) :<C-U>call matchit#Match_wrapper('',1,'v')<CR>m'gv``
|
||||
xnoremap <silent> <Plug>(MatchitVisualForward) :<C-U>call matchit#Match_wrapper('',1,'v')<CR>
|
||||
\:if col("''") != col("$") \| exe ":normal! m'" \| endif<cr>gv``
|
||||
xnoremap <silent> <Plug>(MatchitVisualBackward) :<C-U>call matchit#Match_wrapper('',0,'v')<CR>m'gv``
|
||||
onoremap <silent> <Plug>(MatchitOperationForward) :<C-U>call matchit#Match_wrapper('',1,'o')<CR>
|
||||
onoremap <silent> <Plug>(MatchitOperationBackward) :<C-U>call matchit#Match_wrapper('',0,'o')<CR>
|
||||
|
||||
nmap <silent> % <Plug>(MatchitNormalForward)
|
||||
nmap <silent> g% <Plug>(MatchitNormalBackward)
|
||||
xmap <silent> % <Plug>(MatchitVisualForward)
|
||||
xmap <silent> g% <Plug>(MatchitVisualBackward)
|
||||
omap <silent> % <Plug>(MatchitOperationForward)
|
||||
omap <silent> g% <Plug>(MatchitOperationBackward)
|
||||
|
||||
" Analogues of [{ and ]} using matching patterns:
|
||||
nnoremap <silent> <Plug>(MatchitNormalMultiBackward) :<C-U>call matchit#MultiMatch("bW", "n")<CR>
|
||||
nnoremap <silent> <Plug>(MatchitNormalMultiForward) :<C-U>call matchit#MultiMatch("W", "n")<CR>
|
||||
@@ -68,16 +62,28 @@ xnoremap <silent> <Plug>(MatchitVisualMultiForward) :<C-U>call matchit#Multi
|
||||
onoremap <silent> <Plug>(MatchitOperationMultiBackward) :<C-U>call matchit#MultiMatch("bW", "o")<CR>
|
||||
onoremap <silent> <Plug>(MatchitOperationMultiForward) :<C-U>call matchit#MultiMatch("W", "o")<CR>
|
||||
|
||||
nmap <silent> [% <Plug>(MatchitNormalMultiBackward)
|
||||
nmap <silent> ]% <Plug>(MatchitNormalMultiForward)
|
||||
xmap <silent> [% <Plug>(MatchitVisualMultiBackward)
|
||||
xmap <silent> ]% <Plug>(MatchitVisualMultiForward)
|
||||
omap <silent> [% <Plug>(MatchitOperationMultiBackward)
|
||||
omap <silent> ]% <Plug>(MatchitOperationMultiForward)
|
||||
|
||||
" text object:
|
||||
xmap <silent> <Plug>(MatchitVisualTextObject) <Plug>(MatchitVisualMultiBackward)o<Plug>(MatchitVisualMultiForward)
|
||||
xmap a% <Plug>(MatchitVisualTextObject)
|
||||
|
||||
if !exists("g:no_plugin_maps")
|
||||
nmap <silent> % <Plug>(MatchitNormalForward)
|
||||
nmap <silent> g% <Plug>(MatchitNormalBackward)
|
||||
xmap <silent> % <Plug>(MatchitVisualForward)
|
||||
xmap <silent> g% <Plug>(MatchitVisualBackward)
|
||||
omap <silent> % <Plug>(MatchitOperationForward)
|
||||
omap <silent> g% <Plug>(MatchitOperationBackward)
|
||||
|
||||
" Analogues of [{ and ]} using matching patterns:
|
||||
nmap <silent> [% <Plug>(MatchitNormalMultiBackward)
|
||||
nmap <silent> ]% <Plug>(MatchitNormalMultiForward)
|
||||
xmap <silent> [% <Plug>(MatchitVisualMultiBackward)
|
||||
xmap <silent> ]% <Plug>(MatchitVisualMultiForward)
|
||||
omap <silent> [% <Plug>(MatchitOperationMultiBackward)
|
||||
omap <silent> ]% <Plug>(MatchitOperationMultiForward)
|
||||
|
||||
" Text object
|
||||
xmap a% <Plug>(MatchitVisualTextObject)
|
||||
endif
|
||||
|
||||
" Call this function to turn on debugging information. Every time the main
|
||||
" script is run, buffer variables will be saved. These can be used directly
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"
|
||||
" Author: Bram Moolenaar
|
||||
" Copyright: Vim license applies, see ":help license"
|
||||
" Last Change: 2021 Nov 29
|
||||
" Last Change: 2021 Dec 16
|
||||
"
|
||||
" WORK IN PROGRESS - Only the basics work
|
||||
" Note: On MS-Windows you need a recent version of gdb. The one included with
|
||||
@@ -98,6 +98,10 @@ call s:Highlight(1, '', &background)
|
||||
hi default debugBreakpoint term=reverse ctermbg=red guibg=red
|
||||
hi default debugBreakpointDisabled term=reverse ctermbg=gray guibg=gray
|
||||
|
||||
func s:GetCommand()
|
||||
return type(g:termdebugger) == v:t_list ? copy(g:termdebugger) : [g:termdebugger]
|
||||
endfunc
|
||||
|
||||
func s:StartDebug(bang, ...)
|
||||
" First argument is the command to debug, second core file or process ID.
|
||||
call s:StartDebug_internal({'gdb_args': a:000, 'bang': a:bang})
|
||||
@@ -113,8 +117,9 @@ func s:StartDebug_internal(dict)
|
||||
echoerr 'Terminal debugger already running, cannot run two'
|
||||
return
|
||||
endif
|
||||
if !executable(g:termdebugger)
|
||||
echoerr 'Cannot execute debugger program "' .. g:termdebugger .. '"'
|
||||
let gdbcmd = s:GetCommand()
|
||||
if !executable(gdbcmd[0])
|
||||
echoerr 'Cannot execute debugger program "' .. gdbcmd[0] .. '"'
|
||||
return
|
||||
endif
|
||||
|
||||
@@ -188,7 +193,7 @@ endfunc
|
||||
func s:CheckGdbRunning()
|
||||
let gdbproc = term_getjob(s:gdbbuf)
|
||||
if gdbproc == v:null || job_status(gdbproc) !=# 'run'
|
||||
echoerr string(g:termdebugger) . ' exited unexpectedly'
|
||||
echoerr string(s:GetCommand()[0]) . ' exited unexpectedly'
|
||||
call s:CloseBuffers()
|
||||
return ''
|
||||
endif
|
||||
@@ -233,7 +238,7 @@ func s:StartDebug_term(dict)
|
||||
let gdb_args = get(a:dict, 'gdb_args', [])
|
||||
let proc_args = get(a:dict, 'proc_args', [])
|
||||
|
||||
let gdb_cmd = [g:termdebugger]
|
||||
let gdb_cmd = s:GetCommand()
|
||||
" Add -quiet to avoid the intro message causing a hit-enter prompt.
|
||||
let gdb_cmd += ['-quiet']
|
||||
" Disable pagination, it causes everything to stop at the gdb
|
||||
@@ -364,7 +369,7 @@ func s:StartDebug_prompt(dict)
|
||||
let gdb_args = get(a:dict, 'gdb_args', [])
|
||||
let proc_args = get(a:dict, 'proc_args', [])
|
||||
|
||||
let gdb_cmd = [g:termdebugger]
|
||||
let gdb_cmd = s:GetCommand()
|
||||
" Add -quiet to avoid the intro message causing a hit-enter prompt.
|
||||
let gdb_cmd += ['-quiet']
|
||||
" Disable pagination, it causes everything to stop at the gdb, needs to be run early
|
||||
@@ -585,7 +590,7 @@ endfunc
|
||||
" to the next ", unescaping characters:
|
||||
" - remove line breaks
|
||||
" - change \\t to \t
|
||||
" - change \0xhh to \xhh
|
||||
" - change \0xhh to \xhh (disabled for now)
|
||||
" - change \ooo to octal
|
||||
" - change \\ to \
|
||||
func s:DecodeMessage(quotedText)
|
||||
@@ -594,12 +599,21 @@ func s:DecodeMessage(quotedText)
|
||||
return
|
||||
endif
|
||||
return a:quotedText
|
||||
\->substitute('^"\|".*\|\\n', '', 'g')
|
||||
\->substitute('\\t', "\t", 'g')
|
||||
\->substitute('\\0x\(\x\x\)', {-> eval('"\x' .. submatch(1) .. '"')}, 'g')
|
||||
\->substitute('\\\o\o\o', {-> eval('"' .. submatch(0) .. '"')}, 'g')
|
||||
\->substitute('\\\\', '\', 'g')
|
||||
\ ->substitute('^"\|".*\|\\n', '', 'g')
|
||||
\ ->substitute('\\t', "\t", 'g')
|
||||
" multi-byte characters arrive in octal form
|
||||
" NULL-values must be kept encoded as those break the string otherwise
|
||||
\ ->substitute('\\000', s:NullRepl, 'g')
|
||||
\ ->substitute('\\\o\o\o', {-> eval('"' .. submatch(0) .. '"')}, 'g')
|
||||
" Note: GDB docs also mention hex encodings - the translations below work
|
||||
" but we keep them out for performance-reasons until we actually see
|
||||
" those in mi-returns
|
||||
" \ ->substitute('\\0x\(\x\x\)', {-> eval('"\x' .. submatch(1) .. '"')}, 'g')
|
||||
" \ ->substitute('\\0x00', s:NullRepl, 'g')
|
||||
\ ->substitute('\\\\', '\', 'g')
|
||||
\ ->substitute(s:NullRepl, '\\000', 'g')
|
||||
endfunc
|
||||
const s:NullRepl = 'XXXNULLXXX'
|
||||
|
||||
" Extract the "name" value from a gdb message with fullname="name".
|
||||
func s:GetFullname(msg)
|
||||
@@ -1081,10 +1095,19 @@ let s:evalFromBalloonExpr = 0
|
||||
|
||||
" Handle the result of data-evaluate-expression
|
||||
func s:HandleEvaluate(msg)
|
||||
let value = substitute(a:msg, '.*value="\(.*\)"', '\1', '')
|
||||
let value = substitute(value, '\\"', '"', 'g')
|
||||
" multi-byte characters arrive in octal form
|
||||
let value = substitute(value, '\\\o\o\o', {-> eval('"' .. submatch(0) .. '"')}, 'g')
|
||||
let value = a:msg
|
||||
\ ->substitute('.*value="\(.*\)"', '\1', '')
|
||||
\ ->substitute('\\"', '"', 'g')
|
||||
\ ->substitute('\\\\', '\\', 'g')
|
||||
"\ multi-byte characters arrive in octal form, replace everthing but NULL values
|
||||
\ ->substitute('\\000', s:NullRepl, 'g')
|
||||
\ ->substitute('\\\o\o\o', {-> eval('"' .. submatch(0) .. '"')}, 'g')
|
||||
"\ Note: GDB docs also mention hex encodings - the translations below work
|
||||
"\ but we keep them out for performance-reasons until we actually see
|
||||
"\ those in mi-returns
|
||||
"\ ->substitute('\\0x00', s:NullRep, 'g')
|
||||
"\ ->substitute('\\0x\(\x\x\)', {-> eval('"\x' .. submatch(1) .. '"')}, 'g')
|
||||
\ ->substitute(s:NullRepl, '\\000', 'g')
|
||||
if s:evalFromBalloonExpr
|
||||
if s:evalFromBalloonExprResult == ''
|
||||
let s:evalFromBalloonExprResult = s:evalexpr . ': ' . value
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 May 24
|
||||
" Last Change: 2021 Dec 07
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -196,7 +196,6 @@ syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
|
||||
" Flag the first zero of an octal number as something special
|
||||
syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero
|
||||
syn match cOctalZero display contained "\<0"
|
||||
syn match cFloat display contained "\d\+f"
|
||||
"floating point number, with dot, optional exponent
|
||||
syn match cFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
|
||||
"floating point number, starting with a dot, optional exponent
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
" Nikolai Weibull (Add CSS2 support)
|
||||
" URL: https://github.com/vim-language-dept/css-syntax.vim
|
||||
" Maintainer: Jay Sitter <jay@jaysitter.com>
|
||||
" Last Change: 2021 Oct 15
|
||||
" Last Change: 2021 Oct 20
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if !exists("main_syntax")
|
||||
@@ -116,7 +116,7 @@ syn keyword cssColor contained ActiveBorder ActiveCaption AppWorkspace ButtonFac
|
||||
syn case ignore
|
||||
|
||||
syn match cssImportant contained "!\s*important\>"
|
||||
syn match cssCustomProp contained "--[a-zA-Z0-9-_]*"
|
||||
syn match cssCustomProp contained "\<--[a-zA-Z0-9-_]*\>"
|
||||
|
||||
syn match cssColor contained "\<transparent\>"
|
||||
syn match cssColor contained "\<currentColor\>"
|
||||
@@ -126,6 +126,7 @@ syn match cssColor contained "#\x\{6\}\>" contains=cssUnitDecorators
|
||||
syn match cssColor contained "#\x\{8\}\>" contains=cssUnitDecorators
|
||||
|
||||
syn region cssURL contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline
|
||||
syn region cssMathGroup contained matchgroup=cssMathParens start="(" end=")" containedin=cssFunction,cssMathGroup contains=cssCustomProp,cssValue.*,cssFunction,cssColor,cssStringQ,cssStringQQ oneline
|
||||
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(var\|calc\)\s*(" end=")" contains=cssCustomProp,cssValue.*,cssFunction,cssColor,cssStringQ,cssStringQQ oneline
|
||||
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\|cubic-bezier\|steps\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma
|
||||
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgba\|hsl\|hsla\|color-stop\|from\|to\)\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma,cssFunction
|
||||
@@ -395,9 +396,9 @@ syn match cssUIAttr contained '\<preserve-3d\>'
|
||||
syn match cssIEUIAttr contained '\<bicubic\>'
|
||||
|
||||
" Webkit/iOS specific properties
|
||||
syn match cssUIProp contained '\<tap-highlight-color\|user-select\|touch-callout\>'
|
||||
syn match cssUIProp contained '\<\(tap-highlight-color\|user-select\|touch-callout\)\>'
|
||||
" IE specific properties
|
||||
syn match cssIEUIProp contained '\<interpolation-mode\|zoom\|filter\>'
|
||||
syn match cssIEUIProp contained '\<\(interpolation-mode\|zoom\|filter\)\>'
|
||||
|
||||
" Webkit/Firebox specific properties/attributes
|
||||
syn keyword cssUIProp contained appearance
|
||||
@@ -423,11 +424,15 @@ syn keyword cssAuralAttr contained male female child code digits continuous
|
||||
syn match cssMobileTextProp contained "\<text-size-adjust\>"
|
||||
|
||||
syn keyword cssMediaProp contained width height orientation scan
|
||||
syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(\(device\)-\)\=aspect-ratio/
|
||||
syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-pixel-ratio/
|
||||
syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-\(height\|width\)/
|
||||
syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)/
|
||||
syn keyword cssMediaProp contained any-hover any-pointer color-gamut grid hover
|
||||
syn keyword cssMediaProp contained overflow-block overflow-inline pointer update
|
||||
syn match cssMediaProp contained /\<\(\(max\|min\)-\)\=\(\(device\)-\)\=aspect-ratio\>/
|
||||
syn match cssMediaProp contained /\<\(\(max\|min\)-\)\=device-pixel-ratio\>/
|
||||
syn match cssMediaProp contained /\<\(\(max\|min\)-\)\=device-\(height\|width\)\>/
|
||||
syn match cssMediaProp contained /\<\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)\>/
|
||||
syn keyword cssMediaAttr contained portrait landscape progressive interlace
|
||||
syn keyword cssMediaAttr contained coarse fast fine hover infinite p3 paged
|
||||
syn keyword cssMediaAttr contained rec2020 scroll slow srgb
|
||||
syn match cssKeyFrameProp contained /\(\d\+\(\.\d\+\)\?%\|\(\<from\|to\>\)\)/ nextgroup=cssDefinition
|
||||
syn match cssPageMarginProp /@\(\(top\|left\|right\|bottom\)-\(left\|center\|right\|middle\|bottom\)\)\(-corner\)\=/ contained nextgroup=cssDefinition
|
||||
syn keyword cssPageProp contained content size
|
||||
@@ -445,17 +450,17 @@ syn match cssBraceError "}"
|
||||
syn match cssAttrComma ","
|
||||
|
||||
" Pseudo class
|
||||
" http://www.w3.org/TR/css3-selectors/
|
||||
" https://www.w3.org/TR/selectors-4/
|
||||
syn match cssPseudoClass ":[A-Za-z0-9_-]*" contains=cssNoise,cssPseudoClassId,cssUnicodeEscape,cssVendor,cssPseudoClassFn
|
||||
syn keyword cssPseudoClassId contained link visited active hover before after left right
|
||||
syn keyword cssPseudoClassId contained root empty target enable disabled checked invalid
|
||||
syn keyword cssPseudoClassId contained root empty target enabled disabled checked invalid
|
||||
syn match cssPseudoClassId contained "\<first-\(line\|letter\)\>"
|
||||
syn match cssPseudoClassId contained "\<\(first\|last\|only\)-\(of-type\|child\)\>"
|
||||
syn region cssPseudoClassFn contained matchgroup=cssFunctionName start="\<\(not\|lang\|\(nth\|nth-last\)-\(of-type\|child\)\)(" end=")" contains=cssStringQ,cssStringQQ
|
||||
syn match cssPseudoClassId contained "\<focus\(-within\|-visible\)\=\>"
|
||||
syn region cssPseudoClassFn contained matchgroup=cssFunctionName start="\<\(not\|is\|lang\|\(nth\|nth-last\)-\(of-type\|child\)\)(" end=")" contains=cssStringQ,cssStringQQ,cssTagName,cssAttributeSelector,cssClassName,cssIdentifier
|
||||
" ------------------------------------
|
||||
" Vendor specific properties
|
||||
syn match cssPseudoClassId contained "\<selection\>"
|
||||
syn match cssPseudoClassId contained "\<focus\(-inner\)\=\>"
|
||||
syn match cssPseudoClassId contained "\<\(input-\)\=placeholder\>"
|
||||
|
||||
" Misc highlight groups
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Debian Vim Maintainers
|
||||
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
|
||||
" Wichert Akkerman <wakkerma@debian.org>
|
||||
" Last Change: 2020 Oct 26
|
||||
" Last Change: 2021 Nov 26
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debcontrol.vim
|
||||
|
||||
" Standard syntax initialization
|
||||
@@ -91,6 +91,11 @@ syn case ignore
|
||||
|
||||
" Handle all fields from deb-src-control(5)
|
||||
|
||||
" Catch-all for the legal fields
|
||||
syn region debcontrolField matchgroup=debcontrolKey start="^\%(\%(XSBC-Original-\)\=Maintainer\|Standards-Version\|Bugs\|Origin\|X[SB]-Python-Version\|\%(XS-\)\=Vcs-Mtn\|\%(XS-\)\=Testsuite\%(-Triggers\)\=\|Build-Profiles\|Tag\|Subarchitecture\|Kernel-Version\|Installer-Menu-Item\): " end="$" contains=debcontrolVariable,debcontrolEmail oneline
|
||||
syn region debcontrolMultiField matchgroup=debcontrolKey start="^\%(Build-\%(Conflicts\|Depends\)\%(-Arch\|-Indep\)\=\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Breaks\|Enhances\|Replaces\|Conflicts\|Provides\|Built-Using\|Uploaders\|X[SBC]\{0,3\}\%(Private-\)\=-[-a-zA-Z0-9]\+\): *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolEmail,debcontrolVariable,debcontrolComment
|
||||
syn region debcontrolMultiFieldSpell matchgroup=debcontrolKey start="^Description: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolEmail,debcontrolVariable,debcontrolComment,@Spell
|
||||
|
||||
" Fields for which we do strict syntax checking
|
||||
syn region debcontrolStrictField matchgroup=debcontrolKey start="^Architecture: *" end="$" contains=debcontrolArchitecture,debcontrolSpace oneline
|
||||
syn region debcontrolStrictField matchgroup=debcontrolKey start="^Multi-Arch: *" end="$" contains=debcontrolMultiArch oneline
|
||||
@@ -99,20 +104,15 @@ syn region debcontrolStrictField matchgroup=debcontrolKey start="^Priority: *" e
|
||||
syn region debcontrolStrictField matchgroup=debcontrolKey start="^Section: *" end="$" contains=debcontrolSection oneline
|
||||
syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XC-\)\=Package-Type: *" end="$" contains=debcontrolPackageType oneline
|
||||
syn region debcontrolStrictField matchgroup=debcontrolKey start="^Homepage: *" end="$" contains=debcontrolHTTPUrl oneline keepend
|
||||
syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XS-\)\=Vcs-\%(Browser\|Arch\|Bzr\|Darcs\|Hg\): *" end="$" contains=debcontrolHTTPUrl oneline keepend
|
||||
syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XS-\)\=Vcs-Svn: *" end="$" contains=debcontrolVcsSvn,debcontrolHTTPUrl oneline keepend
|
||||
syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XS-\)\=Vcs-Cvs: *" end="$" contains=debcontrolVcsCvs oneline keepend
|
||||
syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XS-\)\=Vcs-Git: *" end="$" contains=debcontrolVcsGit oneline keepend
|
||||
syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XS-[-a-zA-Z0-9]\+-\)\=Vcs-\%(Browser\|Arch\|Bzr\|Darcs\|Hg\): *" end="$" contains=debcontrolHTTPUrl oneline keepend
|
||||
syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XS-[-a-zA-Z0-9]\+-\)\=Vcs-Svn: *" end="$" contains=debcontrolVcsSvn,debcontrolHTTPUrl oneline keepend
|
||||
syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XS-[-a-zA-Z0-9]\+-\)\=Vcs-Cvs: *" end="$" contains=debcontrolVcsCvs oneline keepend
|
||||
syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(XS-[-a-zA-Z0-9]\+-\)\=Vcs-Git: *" end="$" contains=debcontrolVcsGit oneline keepend
|
||||
syn region debcontrolStrictField matchgroup=debcontrolKey start="^Rules-Requires-Root: *" end="$" contains=debcontrolR3 oneline
|
||||
syn region debcontrolStrictField matchgroup=debcontrolKey start="^\%(Build-\)\=Essential: *" end="$" contains=debcontrolYesNo oneline
|
||||
|
||||
syn region debcontrolStrictField matchgroup=debcontrolDeprecatedKey start="^\%(XS-\)\=DM-Upload-Allowed: *" end="$" contains=debcontrolDmUpload oneline
|
||||
|
||||
" Catch-all for the other legal fields
|
||||
syn region debcontrolField matchgroup=debcontrolKey start="^\%(\%(XSBC-Original-\)\=Maintainer\|Standards-Version\|Bugs\|Origin\|X[SB]-Python-Version\|\%(XS-\)\=Vcs-Mtn\|\%(XS-\)\=Testsuite\%(-Triggers\)\=\|Build-Profiles\|Tag\|Subarchitecture\|Kernel-Version\|Installer-Menu-Item\): " end="$" contains=debcontrolVariable,debcontrolEmail oneline
|
||||
syn region debcontrolMultiField matchgroup=debcontrolKey start="^\%(Build-\%(Conflicts\|Depends\)\%(-Arch\|-Indep\)\=\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Breaks\|Enhances\|Replaces\|Conflicts\|Provides\|Built-Using\|Uploaders\|X[SBC]\{0,3\}\%(Private-\)\=-[-a-zA-Z0-9]\+\): *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolEmail,debcontrolVariable,debcontrolComment
|
||||
syn region debcontrolMultiFieldSpell matchgroup=debcontrolKey start="^Description: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolEmail,debcontrolVariable,debcontrolComment,@Spell
|
||||
|
||||
" Associate our matches and regions with pretty colours
|
||||
hi def link debcontrolKey Keyword
|
||||
hi def link debcontrolField Normal
|
||||
|
||||
57
runtime/syntax/dep3patch.vim
Normal file
57
runtime/syntax/dep3patch.vim
Normal file
@@ -0,0 +1,57 @@
|
||||
" Vim syntax file
|
||||
" Language: Debian DEP3 Patch headers
|
||||
" Maintainer: Gabriel Filion <gabster@lelutin.ca>
|
||||
" Last Change: 2021-01-09
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/dep3patch.vim
|
||||
"
|
||||
" Specification of the DEP3 patch header format is available at:
|
||||
" https://dep-team.pages.debian.net/deps/dep3/
|
||||
|
||||
" Standard syntax initialization
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
runtime! syntax/diff.vim
|
||||
unlet! b:current_syntax
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn region dep3patchHeaders start="\%^" end="^\%(---\)\@=" contains=dep3patchKey,dep3patchMultiField
|
||||
|
||||
syn case ignore
|
||||
|
||||
syn region dep3patchMultiField matchgroup=dep3patchKey start="^\%(Description\|Subject\)\ze: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contained contains=@Spell
|
||||
syn region dep3patchMultiField matchgroup=dep3patchKey start="^Origin\ze: *" end="$" contained contains=dep3patchHTTPUrl,dep3patchCommitID,dep3patchOriginCategory oneline keepend
|
||||
syn region dep3patchMultiField matchgroup=dep3patchKey start="^Bug\%(-[[:graph:]]\+\)\?\ze: *" end="$" contained contains=dep3patchHTTPUrl oneline keepend
|
||||
syn region dep3patchMultiField matchgroup=dep3patchKey start="^Forwarded\ze: *" end="$" contained contains=dep3patchHTTPUrl,dep3patchForwardedShort oneline keepend
|
||||
syn region dep3patchMultiField matchgroup=dep3patchKey start="^\%(Author\|From\)\ze: *" end="$" contained contains=dep3patchEmail oneline keepend
|
||||
syn region dep3patchMultiField matchgroup=dep3patchKey start="^\%(Reviewed-by\|Acked-by\)\ze: *" end="$" contained contains=dep3patchEmail oneline keepend
|
||||
syn region dep3patchMultiField matchgroup=dep3patchKey start="^Last-Updated\ze: *" end="$" contained contains=dep3patchISODate oneline keepend
|
||||
syn region dep3patchMultiField matchgroup=dep3patchKey start="^Applied-Upstream\ze: *" end="$" contained contains=dep3patchHTTPUrl,dep3patchCommitID oneline keepend
|
||||
|
||||
syn match dep3patchHTTPUrl contained "\vhttps?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$"
|
||||
syn match dep3patchCommitID contained "commit:[[:alnum:]]\+"
|
||||
syn match dep3patchOriginCategory contained "\%(upstream\|backport\|vendor\|other\), "
|
||||
syn match dep3patchForwardedShort contained "\%(yes\|no\|not-needed\), "
|
||||
syn match dep3patchEmail "[_=[:alnum:]\.+-]\+@[[:alnum:]\./\-]\+"
|
||||
syn match dep3patchEmail "<.\{-}>"
|
||||
syn match dep3patchISODate "[[:digit:]]\{4}-[[:digit:]]\{2}-[[:digit:]]\{2}"
|
||||
|
||||
" Associate our matches and regions with pretty colours
|
||||
hi def link dep3patchKey Keyword
|
||||
hi def link dep3patchOriginCategory Keyword
|
||||
hi def link dep3patchForwardedShort Keyword
|
||||
hi def link dep3patchMultiField Normal
|
||||
hi def link dep3patchHTTPUrl Identifier
|
||||
hi def link dep3patchCommitID Identifier
|
||||
hi def link dep3patchEmail Identifier
|
||||
hi def link dep3patchISODate Identifier
|
||||
|
||||
let b:current_syntax = 'dep3patch'
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: ts=8 sw=2
|
||||
@@ -45,7 +45,7 @@ if !exists("dtd_no_tag_errors")
|
||||
syn region dtdError contained start=+<!+lc=2 end=+>+
|
||||
endif
|
||||
|
||||
" if this is a html like comment hightlight also
|
||||
" if this is a html like comment highlight also
|
||||
" the opening <! and the closing > as Comment.
|
||||
syn region dtdComment start=+<![ \t]*--+ end=+-->+ contains=dtdTodo,@Spell
|
||||
|
||||
@@ -99,8 +99,8 @@ syn match dtdEntity "&[^; \t]*;" contains=dtdEntityPunct
|
||||
syn match dtdEntityPunct contained "[&.;]"
|
||||
|
||||
" Strings are between quotes
|
||||
syn region dtdString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=dtdAttrDef,dtdAttrType,dtdEnum,dtdParamEntityInst,dtdEntity,dtdCard
|
||||
syn region dtdString start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=dtdAttrDef,dtdAttrType,dtdEnum,dtdParamEntityInst,dtdEntity,dtdCard
|
||||
syn region dtdString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=dtdAttrDef,dtdAttrType,dtdParamEntityInst,dtdEntity,dtdCard
|
||||
syn region dtdString start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=dtdAttrDef,dtdAttrType,dtdParamEntityInst,dtdEntity,dtdCard
|
||||
|
||||
" Enumeration of elements or data between parenthesis
|
||||
"
|
||||
|
||||
256
runtime/syntax/i3config.vim
Normal file
256
runtime/syntax/i3config.vim
Normal file
@@ -0,0 +1,256 @@
|
||||
" Vim syntax file
|
||||
" Language: i3 config file
|
||||
" Maintainer: Mohamed Boughaba <mohamed dot bgb at gmail dot com>
|
||||
" Version: 0.4
|
||||
" Last Change: 2021 Dec 14
|
||||
|
||||
" References:
|
||||
" http://i3wm.org/docs/userguide.html#configuring
|
||||
" http://vimdoc.sourceforge.net/htmldoc/syntax.html
|
||||
"
|
||||
"
|
||||
" Quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
" Error
|
||||
syn match i3ConfigError /.*/
|
||||
|
||||
" Todo
|
||||
syn keyword i3ConfigTodo TODO FIXME XXX contained
|
||||
|
||||
" Comment
|
||||
" Comments are started with a # and can only be used at the beginning of a line
|
||||
syn match i3ConfigComment /^\s*#.*$/ contains=i3ConfigTodo
|
||||
|
||||
" Font
|
||||
" A FreeType font description is composed by:
|
||||
" a font family, a style, a weight, a variant, a stretch and a size.
|
||||
syn match i3ConfigFontSeparator /,/ contained
|
||||
syn match i3ConfigFontSeparator /:/ contained
|
||||
syn keyword i3ConfigFontKeyword font contained
|
||||
syn match i3ConfigFontNamespace /\w\+:/ contained contains=i3ConfigFontSeparator
|
||||
syn match i3ConfigFontContent /-\?\w\+\(-\+\|\s\+\|,\)/ contained contains=i3ConfigFontNamespace,i3ConfigFontSeparator,i3ConfigFontKeyword
|
||||
syn match i3ConfigFontSize /\s\=\d\+\(px\)\?\s\?$/ contained
|
||||
syn match i3ConfigFont /^\s*font\s\+.*$/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace
|
||||
syn match i3ConfigFont /^\s*font\s\+.*\(\\\_.*\)\?$/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace
|
||||
syn match i3ConfigFont /^\s*font\s\+.*\(\\\_.*\)\?[^\\]\+$/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace
|
||||
syn match i3ConfigFont /^\s*font\s\+\(\(.*\\\_.*\)\|\(.*[^\\]\+$\)\)/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace
|
||||
|
||||
" variables
|
||||
syn match i3ConfigString /\(['"]\)\(.\{-}\)\1/ contained
|
||||
syn match i3ConfigColor /#\w\{6}/ contained
|
||||
syn match i3ConfigVariableModifier /+/ contained
|
||||
syn match i3ConfigVariableAndModifier /+\w\+/ contained contains=i3ConfigVariableModifier
|
||||
syn match i3ConfigVariable /\$\w\+\(\(-\w\+\)\+\)\?\(\s\|+\)\?/ contains=i3ConfigVariableModifier,i3ConfigVariableAndModifier
|
||||
syn keyword i3ConfigInitializeKeyword set contained
|
||||
syn match i3ConfigInitialize /^\s*set\s\+.*$/ contains=i3ConfigVariable,i3ConfigInitializeKeyword,i3ConfigColor,i3ConfigString
|
||||
|
||||
" Gaps
|
||||
syn keyword i3ConfigGapStyleKeyword inner outer horizontal vertical top right bottom left current all set plus minus toggle up down contained
|
||||
syn match i3ConfigGapStyle /^\s*\(gaps\)\s\+\(inner\|outer\|horizontal\|vertical\|left\|top\|right\|bottom\)\(\s\+\(current\|all\)\)\?\(\s\+\(set\|plus\|minus\|toggle\)\)\?\(\s\+\(-\?\d\+\|\$.*\)\)$/ contains=i3ConfigGapStyleKeyword,i3ConfigNumber,i3ConfigVariable
|
||||
syn keyword i3ConfigSmartGapKeyword on inverse_outer contained
|
||||
syn match i3ConfigSmartGap /^\s*smart_gaps\s\+\(on\|inverse_outer\)\s\?$/ contains=i3ConfigSmartGapKeyword
|
||||
syn keyword i3ConfigSmartBorderKeyword on no_gaps contained
|
||||
syn match i3ConfigSmartBorder /^\s*smart_borders\s\+\(on\|no_gaps\)\s\?$/ contains=i3ConfigSmartBorderKeyword
|
||||
|
||||
" Keyboard bindings
|
||||
syn keyword i3ConfigAction toggle fullscreen restart key import kill shrink grow contained
|
||||
syn keyword i3ConfigAction focus move grow height width split layout resize restore reload mute unmute exit mode workspace container to contained
|
||||
syn match i3ConfigModifier /\w\++\w\+\(\(+\w\+\)\+\)\?/ contained contains=i3ConfigVariableModifier
|
||||
syn match i3ConfigNumber /\s\d\+/ contained
|
||||
syn match i3ConfigUnit /\sp\(pt\|x\)/ contained
|
||||
syn match i3ConfigUnitOr /\sor/ contained
|
||||
syn keyword i3ConfigBindKeyword bindsym bindcode exec gaps border contained
|
||||
syn match i3ConfigBindArgument /--\w\+\(\(-\w\+\)\+\)\?\s/ contained
|
||||
syn match i3ConfigBind /^\s*\(bindsym\|bindcode\)\s\+.*$/ contains=i3ConfigVariable,i3ConfigBindKeyword,i3ConfigVariableAndModifier,i3ConfigNumber,i3ConfigUnit,i3ConfigUnitOr,i3ConfigBindArgument,i3ConfigModifier,i3ConfigAction,i3ConfigString,i3ConfigGapStyleKeyword,i3ConfigBorderStyleKeyword
|
||||
|
||||
" Floating
|
||||
syn keyword i3ConfigSizeSpecial x contained
|
||||
syn match i3ConfigNegativeSize /-/ contained
|
||||
syn match i3ConfigSize /-\?\d\+\s\?x\s\?-\?\d\+/ contained contains=i3ConfigSizeSpecial,i3ConfigNumber,i3ConfigNegativeSize
|
||||
syn match i3ConfigFloating /^\s*floating_modifier\s\+\$\w\+\d\?/ contains=i3ConfigVariable
|
||||
syn match i3ConfigFloating /^\s*floating_\(maximum\|minimum\)_size\s\+-\?\d\+\s\?x\s\?-\?\d\+/ contains=i3ConfigSize
|
||||
|
||||
" Orientation
|
||||
syn keyword i3ConfigOrientationKeyword vertical horizontal auto contained
|
||||
syn match i3ConfigOrientation /^\s*default_orientation\s\+\(vertical\|horizontal\|auto\)\s\?$/ contains=i3ConfigOrientationKeyword
|
||||
|
||||
" Layout
|
||||
syn keyword i3ConfigLayoutKeyword default stacking tabbed contained
|
||||
syn match i3ConfigLayout /^\s*workspace_layout\s\+\(default\|stacking\|tabbed\)\s\?$/ contains=i3ConfigLayoutKeyword
|
||||
|
||||
" Border style
|
||||
syn keyword i3ConfigBorderStyleKeyword none normal pixel contained
|
||||
syn match i3ConfigBorderStyle /^\s*\(new_window\|new_float\|default_border\|default_floating_border\)\s\+\(none\|\(normal\|pixel\)\(\s\+\d\+\)\?\(\s\+\$\w\+\(\(-\w\+\)\+\)\?\(\s\|+\)\?\)\?\)\s\?$/ contains=i3ConfigBorderStyleKeyword,i3ConfigNumber,i3ConfigVariable
|
||||
|
||||
" Hide borders and edges
|
||||
syn keyword i3ConfigEdgeKeyword none vertical horizontal both smart smart_no_gaps contained
|
||||
syn match i3ConfigEdge /^\s*hide_edge_borders\s\+\(none\|vertical\|horizontal\|both\|smart\|smart_no_gaps\)\s\?$/ contains=i3ConfigEdgeKeyword
|
||||
|
||||
" Arbitrary commands for specific windows (for_window)
|
||||
syn keyword i3ConfigCommandKeyword for_window contained
|
||||
syn region i3ConfigWindowStringSpecial start=+"+ skip=+\\"+ end=+"+ contained contains=i3ConfigString
|
||||
syn region i3ConfigWindowCommandSpecial start="\[" end="\]" contained contains=i3ConfigWindowStringSpacial,i3ConfigString
|
||||
syn match i3ConfigArbitraryCommand /^\s*for_window\s\+.*$/ contains=i3ConfigWindowCommandSpecial,i3ConfigCommandKeyword,i3ConfigBorderStyleKeyword,i3ConfigLayoutKeyword,i3ConfigOrientationKeyword,Size,i3ConfigNumber
|
||||
|
||||
" Disable focus open opening
|
||||
syn keyword i3ConfigNoFocusKeyword no_focus contained
|
||||
syn match i3ConfigDisableFocus /^\s*no_focus\s\+.*$/ contains=i3ConfigWindowCommandSpecial,i3ConfigNoFocusKeyword
|
||||
|
||||
" Move client to specific workspace automatically
|
||||
syn keyword i3ConfigAssignKeyword assign contained
|
||||
syn match i3ConfigAssignSpecial /→/ contained
|
||||
syn match i3ConfigAssign /^\s*assign\s\+.*$/ contains=i3ConfigAssignKeyword,i3ConfigWindowCommandSpecial,i3ConfigAssignSpecial
|
||||
|
||||
" X resources
|
||||
syn keyword i3ConfigResourceKeyword set_from_resource contained
|
||||
syn match i3ConfigResource /^\s*set_from_resource\s\+.*$/ contains=i3ConfigResourceKeyword,i3ConfigWindowCommandSpecial,i3ConfigColor,i3ConfigVariable
|
||||
|
||||
" Auto start applications
|
||||
syn keyword i3ConfigExecKeyword exec exec_always contained
|
||||
syn match i3ConfigNoStartupId /--no-startup-id/ contained " We are not using i3ConfigBindArgument as only no-startup-id is supported here
|
||||
syn match i3ConfigExec /^\s*exec\(_always\)\?\s\+.*$/ contains=i3ConfigExecKeyword,i3ConfigNoStartupId,i3ConfigString
|
||||
|
||||
" Automatically putting workspaces on specific screens
|
||||
syn keyword i3ConfigWorkspaceKeyword workspace contained
|
||||
syn keyword i3ConfigOutput output contained
|
||||
syn match i3ConfigWorkspace /^\s*workspace\s\+.*$/ contains=i3ConfigWorkspaceKeyword,i3ConfigNumber,i3ConfigString,i3ConfigOutput
|
||||
|
||||
" Changing colors
|
||||
syn keyword i3ConfigClientColorKeyword client focused focused_inactive unfocused urgent placeholder background contained
|
||||
syn match i3ConfigClientColor /^\s*client.\w\+\s\+.*$/ contains=i3ConfigClientColorKeyword,i3ConfigColor,i3ConfigVariable
|
||||
|
||||
syn keyword i3ConfigTitleAlignKeyword left center right contained
|
||||
syn match i3ConfigTitleAlign /^\s*title_align\s\+.*$/ contains=i3ConfigTitleAlignKeyword
|
||||
|
||||
" Interprocess communication
|
||||
syn match i3ConfigInterprocessKeyword /ipc-socket/ contained
|
||||
syn match i3ConfigInterprocess /^\s*ipc-socket\s\+.*$/ contains=i3ConfigInterprocessKeyword
|
||||
|
||||
" Mouse warping
|
||||
syn keyword i3ConfigMouseWarpingKeyword mouse_warping contained
|
||||
syn keyword i3ConfigMouseWarpingType output none contained
|
||||
syn match i3ConfigMouseWarping /^\s*mouse_warping\s\+\(output\|none\)\s\?$/ contains=i3ConfigMouseWarpingKeyword,i3ConfigMouseWarpingType
|
||||
|
||||
" Focus follows mouse
|
||||
syn keyword i3ConfigFocusFollowsMouseKeyword focus_follows_mouse contained
|
||||
syn keyword i3ConfigFocusFollowsMouseType yes no contained
|
||||
syn match i3ConfigFocusFollowsMouse /^\s*focus_follows_mouse\s\+\(yes\|no\)\s\?$/ contains=i3ConfigFocusFollowsMouseKeyword,i3ConfigFocusFollowsMouseType
|
||||
|
||||
" Popups during fullscreen mode
|
||||
syn keyword i3ConfigPopupOnFullscreenKeyword popup_during_fullscreen contained
|
||||
syn keyword i3ConfigPopuponFullscreenType smart ignore leave_fullscreen contained
|
||||
syn match i3ConfigPopupOnFullscreen /^\s*popup_during_fullscreen\s\+\w\+\s\?$/ contains=i3ConfigPopupOnFullscreenKeyword,i3ConfigPopupOnFullscreenType
|
||||
|
||||
" Focus wrapping
|
||||
syn keyword i3ConfigFocusWrappingKeyword force_focus_wrapping focus_wrapping contained
|
||||
syn keyword i3ConfigFocusWrappingType yes no contained
|
||||
syn match i3ConfigFocusWrapping /^\s*\(force_\)\?focus_wrapping\s\+\(yes\|no\)\s\?$/ contains=i3ConfigFocusWrappingType,i3ConfigFocusWrappingKeyword
|
||||
|
||||
" Forcing Xinerama
|
||||
syn keyword i3ConfigForceXineramaKeyword force_xinerama contained
|
||||
syn match i3ConfigForceXinerama /^\s*force_xinerama\s\+\(yes\|no\)\s\?$/ contains=i3ConfigFocusWrappingType,i3ConfigForceXineramaKeyword
|
||||
|
||||
" Automatic back-and-forth when switching to the current workspace
|
||||
syn keyword i3ConfigAutomaticSwitchKeyword workspace_auto_back_and_forth contained
|
||||
syn match i3ConfigAutomaticSwitch /^\s*workspace_auto_back_and_forth\s\+\(yes\|no\)\s\?$/ contains=i3ConfigFocusWrappingType,i3ConfigAutomaticSwitchKeyword
|
||||
|
||||
" Delay urgency hint
|
||||
syn keyword i3ConfigTimeUnit ms contained
|
||||
syn keyword i3ConfigDelayUrgencyKeyword force_display_urgency_hint contained
|
||||
syn match i3ConfigDelayUrgency /^\s*force_display_urgency_hint\s\+\d\+\s\+ms\s\?$/ contains=i3ConfigFocusWrappingType,i3ConfigDelayUrgencyKeyword,i3ConfigNumber,i3ConfigTimeUnit
|
||||
|
||||
" Focus on window activation
|
||||
syn keyword i3ConfigFocusOnActivationKeyword focus_on_window_activation contained
|
||||
syn keyword i3ConfigFocusOnActivationType smart urgent focus none contained
|
||||
syn match i3ConfigFocusOnActivation /^\s*focus_on_window_activation\s\+\(smart\|urgent\|focus\|none\)\s\?$/ contains=i3ConfigFocusOnActivationKeyword,i3ConfigFocusOnActivationType
|
||||
|
||||
" Automatic back-and-forth when switching to the current workspace
|
||||
syn keyword i3ConfigDrawingMarksKeyword show_marks contained
|
||||
syn match i3ConfigDrawingMarks /^\s*show_marks\s\+\(yes\|no\)\s\?$/ contains=i3ConfigFocusWrappingType,i3ConfigDrawingMarksKeyword
|
||||
|
||||
" Group mode/bar
|
||||
syn keyword i3ConfigBlockKeyword mode bar colors i3bar_command status_command position exec mode hidden_state modifier id position output background statusline tray_output tray_padding separator separator_symbol workspace_buttons strip_workspace_numbers binding_mode_indicator focused_workspace active_workspace inactive_workspace urgent_workspace binding_mode contained
|
||||
syn region i3ConfigBlock start=+.*s\?{$+ end=+^}$+ contains=i3ConfigBlockKeyword,i3ConfigString,i3ConfigBind,i3ConfigComment,i3ConfigFont,i3ConfigFocusWrappingType,i3ConfigColor,i3ConfigVariable transparent keepend extend
|
||||
|
||||
" Line continuation
|
||||
syn region i3ConfigLineCont start=/^.*\\$/ end=/^.*$/ contains=i3ConfigBlockKeyword,i3ConfigString,i3ConfigBind,i3ConfigComment,i3ConfigFont,i3ConfigFocusWrappingType,i3ConfigColor,i3ConfigVariable transparent keepend extend
|
||||
|
||||
" Define the highlighting.
|
||||
hi def link i3ConfigError Error
|
||||
hi def link i3ConfigTodo Todo
|
||||
hi def link i3ConfigComment Comment
|
||||
hi def link i3ConfigFontContent Type
|
||||
hi def link i3ConfigFocusOnActivationType Type
|
||||
hi def link i3ConfigPopupOnFullscreenType Type
|
||||
hi def link i3ConfigOrientationKeyword Type
|
||||
hi def link i3ConfigMouseWarpingType Type
|
||||
hi def link i3ConfigFocusFollowsMouseType Type
|
||||
hi def link i3ConfigGapStyleKeyword Type
|
||||
hi def link i3ConfigTitleAlignKeyword Type
|
||||
hi def link i3ConfigSmartGapKeyword Type
|
||||
hi def link i3ConfigSmartBorderKeyword Type
|
||||
hi def link i3ConfigLayoutKeyword Type
|
||||
hi def link i3ConfigBorderStyleKeyword Type
|
||||
hi def link i3ConfigEdgeKeyword Type
|
||||
hi def link i3ConfigAction Type
|
||||
hi def link i3ConfigCommand Type
|
||||
hi def link i3ConfigOutput Type
|
||||
hi def link i3ConfigWindowCommandSpecial Type
|
||||
hi def link i3ConfigFocusWrappingType Type
|
||||
hi def link i3ConfigUnitOr Type
|
||||
hi def link i3ConfigFontSize Constant
|
||||
hi def link i3ConfigColor Constant
|
||||
hi def link i3ConfigNumber Constant
|
||||
hi def link i3ConfigUnit Constant
|
||||
hi def link i3ConfigVariableAndModifier Constant
|
||||
hi def link i3ConfigTimeUnit Constant
|
||||
hi def link i3ConfigModifier Constant
|
||||
hi def link i3ConfigString Constant
|
||||
hi def link i3ConfigNegativeSize Constant
|
||||
hi def link i3ConfigFontSeparator Special
|
||||
hi def link i3ConfigVariableModifier Special
|
||||
hi def link i3ConfigSizeSpecial Special
|
||||
hi def link i3ConfigWindowSpecial Special
|
||||
hi def link i3ConfigAssignSpecial Special
|
||||
hi def link i3ConfigFontNamespace PreProc
|
||||
hi def link i3ConfigBindArgument PreProc
|
||||
hi def link i3ConfigNoStartupId PreProc
|
||||
hi def link i3ConfigFontKeyword Identifier
|
||||
hi def link i3ConfigBindKeyword Identifier
|
||||
hi def link i3ConfigOrientation Identifier
|
||||
hi def link i3ConfigGapStyle Identifier
|
||||
hi def link i3ConfigTitleAlign Identifier
|
||||
hi def link i3ConfigSmartGap Identifier
|
||||
hi def link i3ConfigSmartBorder Identifier
|
||||
hi def link i3ConfigLayout Identifier
|
||||
hi def link i3ConfigBorderStyle Identifier
|
||||
hi def link i3ConfigEdge Identifier
|
||||
hi def link i3ConfigFloating Identifier
|
||||
hi def link i3ConfigCommandKeyword Identifier
|
||||
hi def link i3ConfigNoFocusKeyword Identifier
|
||||
hi def link i3ConfigInitializeKeyword Identifier
|
||||
hi def link i3ConfigAssignKeyword Identifier
|
||||
hi def link i3ConfigResourceKeyword Identifier
|
||||
hi def link i3ConfigExecKeyword Identifier
|
||||
hi def link i3ConfigWorkspaceKeyword Identifier
|
||||
hi def link i3ConfigClientColorKeyword Identifier
|
||||
hi def link i3ConfigInterprocessKeyword Identifier
|
||||
hi def link i3ConfigMouseWarpingKeyword Identifier
|
||||
hi def link i3ConfigFocusFollowsMouseKeyword Identifier
|
||||
hi def link i3ConfigPopupOnFullscreenKeyword Identifier
|
||||
hi def link i3ConfigFocusWrappingKeyword Identifier
|
||||
hi def link i3ConfigForceXineramaKeyword Identifier
|
||||
hi def link i3ConfigAutomaticSwitchKeyword Identifier
|
||||
hi def link i3ConfigDelayUrgencyKeyword Identifier
|
||||
hi def link i3ConfigFocusOnActivationKeyword Identifier
|
||||
hi def link i3ConfigDrawingMarksKeyword Identifier
|
||||
hi def link i3ConfigBlockKeyword Identifier
|
||||
hi def link i3ConfigVariable Statement
|
||||
hi def link i3ConfigArbitraryCommand Type
|
||||
|
||||
let b:current_syntax = "i3config"
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: Python
|
||||
" Maintainer: Zvezdan Petkovic <zpetkovic@acm.org>
|
||||
" Last Change: 2021 Feb 15
|
||||
" Last Change: 2021 Dec 10
|
||||
" Credits: Neil Schemenauer <nas@python.ca>
|
||||
" Dmitry Vasiliev
|
||||
"
|
||||
@@ -77,13 +77,14 @@ endif
|
||||
"
|
||||
" The list can be checked using:
|
||||
"
|
||||
" python3 -c 'import keyword, pprint; pprint.pprint(keyword.kwlist, compact=True)'
|
||||
" python3 -c 'import keyword, pprint; pprint.pprint(keyword.kwlist + keyword.softkwlist, compact=True)'
|
||||
"
|
||||
syn keyword pythonStatement False None True
|
||||
syn keyword pythonStatement as assert break continue del global
|
||||
syn keyword pythonStatement lambda nonlocal pass return with yield
|
||||
syn keyword pythonStatement class def nextgroup=pythonFunction skipwhite
|
||||
syn keyword pythonConditional elif else if
|
||||
syn keyword pythonConditional case match
|
||||
syn keyword pythonRepeat for while
|
||||
syn keyword pythonOperator and in is not or
|
||||
syn keyword pythonException except finally raise try
|
||||
|
||||
@@ -1,396 +1,46 @@
|
||||
" Vim syntax file
|
||||
" Language: Texinfo (macro package for TeX)
|
||||
" Maintainer: Sandor Kopanyi <sandor.kopanyi@mailbox.hu>
|
||||
" URL: <->
|
||||
" Last Change: 2004 Jun 23
|
||||
"
|
||||
" the file follows the Texinfo manual structure; this file is based
|
||||
" on manual for Texinfo version 4.0, 28 September 1999
|
||||
" since @ can have special meanings, everything is 'match'-ed and 'region'-ed
|
||||
" (including @ in 'iskeyword' option has unexpected effects)
|
||||
" Language: Texinfo (documentation format)
|
||||
" Maintainer: Robert Dodier <robert.dodier@gmail.com>
|
||||
" Latest Revision: 2021-12-15
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists("main_syntax")
|
||||
let main_syntax = 'texinfo'
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn match texinfoControlSequence display '\(@end [a-zA-Z@]\+\|@[a-zA-Z@]\+\)'
|
||||
|
||||
syn match texinfoComment display '^\s*\(@comment\|@c\)\>.*$'
|
||||
|
||||
syn region texinfoCode matchgroup=texinfoControlSequence start="@code{" end="}" contains=ALL
|
||||
syn region texinfoVerb matchgroup=texinfoControlSequence start="@verb{" end="}" contains=ALL
|
||||
|
||||
syn region texinfoArgument matchgroup=texinfoBrace start="{" end="}" contains=ALLBUT
|
||||
|
||||
syn region texinfoExample matchgroup=texinfoControlSequence start="^@example\s*$" end="^@end example\s*$" contains=ALL
|
||||
|
||||
syn region texinfoVerbatim matchgroup=texinfoControlSequence start="^@verbatim\s*$" end="^@end verbatim\s*$"
|
||||
|
||||
syn region texinfoMenu matchgroup=texinfoControlSequence start="^@menu\s*$" end="^@end menu\s*$"
|
||||
|
||||
if exists("g:texinfo_delimiters")
|
||||
syn match texinfoDelimiter display '[][{}]'
|
||||
endif
|
||||
|
||||
"in Texinfo can be real big things, like tables; sync for that
|
||||
syn sync lines=200
|
||||
|
||||
"some general stuff
|
||||
"syn match texinfoError "\S" contained TODO
|
||||
syn match texinfoIdent "\k\+" contained "IDENTifier
|
||||
syn match texinfoAssignment "\k\+\s*=\s*\k\+\s*$" contained "assigment statement ( var = val )
|
||||
syn match texinfoSinglePar "\k\+\s*$" contained "single parameter (used for several @-commands)
|
||||
syn match texinfoIndexPar "\k\k\s*$" contained "param. used for different *index commands (+ @documentlanguage command)
|
||||
|
||||
|
||||
"marking words and phrases (chap. 9 in Texinfo manual)
|
||||
"(almost) everything appears as 'contained' too; is for tables (@table)
|
||||
|
||||
"this chapter is at the beginning of this file to avoid overwritings
|
||||
|
||||
syn match texinfoSpecialChar "@acronym" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@acronym{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@b" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@b{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@cite" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@cite{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@code" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@code{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@command" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@command{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@dfn" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@dfn{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@email" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@email{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@emph" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@emph{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@env" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@env{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@file" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@file{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@i" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@i{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@kbd" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@kbd{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@key" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@key{" end="}" contains=texinfoSpecialChar
|
||||
syn match texinfoSpecialChar "@option" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@option{" end="}" contains=texinfoSpecialChar
|
||||
syn match texinfoSpecialChar "@r" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@r{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@samp" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@samp{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@sc" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@sc{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@strong" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@strong{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@t" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@t{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@url" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@url{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoSpecialChar "@var" contained
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@var{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn match texinfoAtCmd "^@kbdinputstyle" nextgroup=texinfoSinglePar skipwhite
|
||||
|
||||
|
||||
"overview of Texinfo (chap. 1 in Texinfo manual)
|
||||
syn match texinfoComment "@c .*"
|
||||
syn match texinfoComment "@c$"
|
||||
syn match texinfoComment "@comment .*"
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoComment start="^@ignore\s*$" end="^@end ignore\s*$" contains=ALL
|
||||
|
||||
|
||||
"beginning a Texinfo file (chap. 3 in Texinfo manual)
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="@center " skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd oneline
|
||||
syn region texinfoMltlnDMAtCmd matchgroup=texinfoAtCmd start="^@detailmenu\s*$" end="^@end detailmenu\s*$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@setfilename " skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@settitle " skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@shorttitlepage " skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@title " skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@titlefont{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@titlepage\s*$" end="^@end titlepage\s*$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoMltlnDMAtCmd,texinfoAtCmd,texinfoPrmAtCmd,texinfoMltlnAtCmd
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@vskip " skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn match texinfoAtCmd "^@exampleindent" nextgroup=texinfoSinglePar skipwhite
|
||||
syn match texinfoAtCmd "^@headings" nextgroup=texinfoSinglePar skipwhite
|
||||
syn match texinfoAtCmd "^\\input" nextgroup=texinfoSinglePar skipwhite
|
||||
syn match texinfoAtCmd "^@paragraphindent" nextgroup=texinfoSinglePar skipwhite
|
||||
syn match texinfoAtCmd "^@setchapternewpage" nextgroup=texinfoSinglePar skipwhite
|
||||
|
||||
|
||||
"ending a Texinfo file (chap. 4 in Texinfo manual)
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="@author " skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
"all below @bye should be comment TODO
|
||||
syn match texinfoAtCmd "^@bye\s*$"
|
||||
syn match texinfoAtCmd "^@contents\s*$"
|
||||
syn match texinfoAtCmd "^@printindex" nextgroup=texinfoIndexPar skipwhite
|
||||
syn match texinfoAtCmd "^@setcontentsaftertitlepage\s*$"
|
||||
syn match texinfoAtCmd "^@setshortcontentsaftertitlepage\s*$"
|
||||
syn match texinfoAtCmd "^@shortcontents\s*$"
|
||||
syn match texinfoAtCmd "^@summarycontents\s*$"
|
||||
|
||||
|
||||
"chapter structuring (chap. 5 in Texinfo manual)
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@appendix" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@appendixsec" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@appendixsection" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@appendixsubsec" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@appendixsubsubsec" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@centerchap" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@chapheading" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@chapter" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@heading" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@majorheading" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@section" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@subheading " skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@subsection" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@subsubheading" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@subsubsection" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@subtitle" skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@unnumbered" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@unnumberedsec" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@unnumberedsubsec" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@unnumberedsubsubsec" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn match texinfoAtCmd "^@lowersections\s*$"
|
||||
syn match texinfoAtCmd "^@raisesections\s*$"
|
||||
|
||||
|
||||
"nodes (chap. 6 in Texinfo manual)
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@anchor{" end="}"
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@top" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@node" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
|
||||
|
||||
"menus (chap. 7 in Texinfo manual)
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@menu\s*$" end="^@end menu\s*$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoMltlnDMAtCmd
|
||||
|
||||
|
||||
"cross references (chap. 8 in Texinfo manual)
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@inforef{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@pxref{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@ref{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@uref{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@xref{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
|
||||
|
||||
"marking words and phrases (chap. 9 in Texinfo manual)
|
||||
"(almost) everything appears as 'contained' too; is for tables (@table)
|
||||
|
||||
"this chapter is at the beginning of this file to avoid overwritings
|
||||
|
||||
|
||||
"quotations and examples (chap. 10 in Texinfo manual)
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@cartouche\s*$" end="^@end cartouche\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@display\s*$" end="^@end display\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@example\s*$" end="^@end example\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@flushleft\s*$" end="^@end flushleft\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@flushright\s*$" end="^@end flushright\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@format\s*$" end="^@end format\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@lisp\s*$" end="^@end lisp\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@quotation\s*$" end="^@end quotation\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@smalldisplay\s*$" end="^@end smalldisplay\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@smallexample\s*$" end="^@end smallexample\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@smallformat\s*$" end="^@end smallformat\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@smalllisp\s*$" end="^@end smalllisp\s*$" contains=ALL
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@exdent" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn match texinfoAtCmd "^@noindent\s*$"
|
||||
syn match texinfoAtCmd "^@smallbook\s*$"
|
||||
|
||||
|
||||
"lists and tables (chap. 11 in Texinfo manual)
|
||||
syn match texinfoAtCmd "@asis" contained
|
||||
syn match texinfoAtCmd "@columnfractions" contained
|
||||
syn match texinfoAtCmd "@item" contained
|
||||
syn match texinfoAtCmd "@itemx" contained
|
||||
syn match texinfoAtCmd "@tab" contained
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@enumerate" end="^@end enumerate\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@ftable" end="^@end ftable\s*$" contains=ALL
|
||||
syn region texinfoMltlnNAtCmd matchgroup=texinfoAtCmd start="^@itemize" end="^@end itemize\s*$" contains=ALL
|
||||
syn region texinfoMltlnNAtCmd matchgroup=texinfoAtCmd start="^@multitable" end="^@end multitable\s*$" contains=ALL
|
||||
syn region texinfoMltlnNAtCmd matchgroup=texinfoAtCmd start="^@table" end="^@end table\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@vtable" end="^@end vtable\s*$" contains=ALL
|
||||
|
||||
|
||||
"indices (chap. 12 in Texinfo manual)
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@\(c\|f\|k\|p\|t\|v\)index" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@..index" skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
"@defcodeindex and @defindex is defined after chap. 15's @def* commands (otherwise those ones will overwrite these ones)
|
||||
syn match texinfoSIPar "\k\k\s*\k\k\s*$" contained
|
||||
syn match texinfoAtCmd "^@syncodeindex" nextgroup=texinfoSIPar skipwhite
|
||||
syn match texinfoAtCmd "^@synindex" nextgroup=texinfoSIPar skipwhite
|
||||
|
||||
"special insertions (chap. 13 in Texinfo manual)
|
||||
syn match texinfoSpecialChar "@\(!\|?\|@\|\s\)"
|
||||
syn match texinfoSpecialChar "@{"
|
||||
syn match texinfoSpecialChar "@}"
|
||||
"accents
|
||||
syn match texinfoSpecialChar "@=."
|
||||
syn match texinfoSpecialChar "@\('\|\"\|\^\|`\)[aeiouyAEIOUY]"
|
||||
syn match texinfoSpecialChar "@\~[aeinouyAEINOUY]"
|
||||
syn match texinfoSpecialChar "@dotaccent{.}"
|
||||
syn match texinfoSpecialChar "@H{.}"
|
||||
syn match texinfoSpecialChar "@,{[cC]}"
|
||||
syn match texinfoSpecialChar "@AA{}"
|
||||
syn match texinfoSpecialChar "@aa{}"
|
||||
syn match texinfoSpecialChar "@L{}"
|
||||
syn match texinfoSpecialChar "@l{}"
|
||||
syn match texinfoSpecialChar "@O{}"
|
||||
syn match texinfoSpecialChar "@o{}"
|
||||
syn match texinfoSpecialChar "@ringaccent{.}"
|
||||
syn match texinfoSpecialChar "@tieaccent{..}"
|
||||
syn match texinfoSpecialChar "@u{.}"
|
||||
syn match texinfoSpecialChar "@ubaraccent{.}"
|
||||
syn match texinfoSpecialChar "@udotaccent{.}"
|
||||
syn match texinfoSpecialChar "@v{.}"
|
||||
"ligatures
|
||||
syn match texinfoSpecialChar "@AE{}"
|
||||
syn match texinfoSpecialChar "@ae{}"
|
||||
syn match texinfoSpecialChar "@copyright{}"
|
||||
syn match texinfoSpecialChar "@bullet" contained "for tables and lists
|
||||
syn match texinfoSpecialChar "@bullet{}"
|
||||
syn match texinfoSpecialChar "@dotless{i}"
|
||||
syn match texinfoSpecialChar "@dotless{j}"
|
||||
syn match texinfoSpecialChar "@dots{}"
|
||||
syn match texinfoSpecialChar "@enddots{}"
|
||||
syn match texinfoSpecialChar "@equiv" contained "for tables and lists
|
||||
syn match texinfoSpecialChar "@equiv{}"
|
||||
syn match texinfoSpecialChar "@error{}"
|
||||
syn match texinfoSpecialChar "@exclamdown{}"
|
||||
syn match texinfoSpecialChar "@expansion{}"
|
||||
syn match texinfoSpecialChar "@minus" contained "for tables and lists
|
||||
syn match texinfoSpecialChar "@minus{}"
|
||||
syn match texinfoSpecialChar "@OE{}"
|
||||
syn match texinfoSpecialChar "@oe{}"
|
||||
syn match texinfoSpecialChar "@point" contained "for tables and lists
|
||||
syn match texinfoSpecialChar "@point{}"
|
||||
syn match texinfoSpecialChar "@pounds{}"
|
||||
syn match texinfoSpecialChar "@print{}"
|
||||
syn match texinfoSpecialChar "@questiondown{}"
|
||||
syn match texinfoSpecialChar "@result" contained "for tables and lists
|
||||
syn match texinfoSpecialChar "@result{}"
|
||||
syn match texinfoSpecialChar "@ss{}"
|
||||
syn match texinfoSpecialChar "@TeX{}"
|
||||
"other
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@dmn{" end="}"
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@footnote{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@image{" end="}"
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@math{" end="}"
|
||||
syn match texinfoAtCmd "@footnotestyle" nextgroup=texinfoSinglePar skipwhite
|
||||
|
||||
|
||||
"making and preventing breaks (chap. 14 in Texinfo manual)
|
||||
syn match texinfoSpecialChar "@\(\*\|-\|\.\)"
|
||||
syn match texinfoAtCmd "^@need" nextgroup=texinfoSinglePar skipwhite
|
||||
syn match texinfoAtCmd "^@page\s*$"
|
||||
syn match texinfoAtCmd "^@sp" nextgroup=texinfoSinglePar skipwhite
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@group\s*$" end="^@end group\s*$" contains=ALL
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@hyphenation{" end="}"
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@w{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
|
||||
|
||||
"definition commands (chap. 15 in Texinfo manual)
|
||||
syn match texinfoMltlnAtCmdFLine "^@def\k\+" contained
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@def\k\+" end="^@end def\k\+$" contains=ALL
|
||||
|
||||
"next 2 commands are from chap. 12; must be defined after @def* commands above to overwrite them
|
||||
syn match texinfoAtCmd "@defcodeindex" nextgroup=texinfoIndexPar skipwhite
|
||||
syn match texinfoAtCmd "@defindex" nextgroup=texinfoIndexPar skipwhite
|
||||
|
||||
|
||||
"conditionally visible text (chap. 16 in Texinfo manual)
|
||||
syn match texinfoAtCmd "^@clear" nextgroup=texinfoSinglePar skipwhite
|
||||
syn region texinfoMltln2AtCmd matchgroup=texinfoAtCmd start="^@html\s*$" end="^@end html\s*$"
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@ifclear" end="^@end ifclear\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@ifhtml" end="^@end ifhtml\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@ifinfo" end="^@end ifinfo\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@ifnothtml" end="^@end ifnothtml\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@ifnotinfo" end="^@end ifnotinfo\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@ifnottex" end="^@end ifnottex\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@ifset" end="^@end ifset\s*$" contains=ALL
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@iftex" end="^@end iftex\s*$" contains=ALL
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@set " skip="\\$" end="$" contains=texinfoSpecialChar oneline
|
||||
syn region texinfoTexCmd start="\$\$" end="\$\$" contained
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@tex" end="^@end tex\s*$" contains=texinfoTexCmd
|
||||
syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@value{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
|
||||
|
||||
"internationalization (chap. 17 in Texinfo manual)
|
||||
syn match texinfoAtCmd "@documentencoding" nextgroup=texinfoSinglePar skipwhite
|
||||
syn match texinfoAtCmd "@documentlanguage" nextgroup=texinfoIndexPar skipwhite
|
||||
|
||||
|
||||
"defining new texinfo commands (chap. 18 in Texinfo manual)
|
||||
syn match texinfoAtCmd "@alias" nextgroup=texinfoAssignment skipwhite
|
||||
syn match texinfoDIEPar "\S*\s*,\s*\S*\s*,\s*\S*\s*$" contained
|
||||
syn match texinfoAtCmd "@definfoenclose" nextgroup=texinfoDIEPar skipwhite
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@macro" end="^@end macro\s*$" contains=ALL
|
||||
|
||||
|
||||
"formatting hardcopy (chap. 19 in Texinfo manual)
|
||||
syn match texinfoAtCmd "^@afourlatex\s*$"
|
||||
syn match texinfoAtCmd "^@afourpaper\s*$"
|
||||
syn match texinfoAtCmd "^@afourwide\s*$"
|
||||
syn match texinfoAtCmd "^@finalout\s*$"
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@pagesizes" end="$" oneline
|
||||
|
||||
|
||||
"creating and installing Info Files (chap. 20 in Texinfo manual)
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@dircategory" skip="\\$" end="$" oneline
|
||||
syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@direntry\s*$" end="^@end direntry\s*$" contains=texinfoSpecialChar
|
||||
syn match texinfoAtCmd "^@novalidate\s*$"
|
||||
|
||||
|
||||
"include files (appendix E in Texinfo manual)
|
||||
syn match texinfoAtCmd "^@include" nextgroup=texinfoSinglePar skipwhite
|
||||
|
||||
|
||||
"page headings (appendix F in Texinfo manual)
|
||||
syn match texinfoHFSpecialChar "@|" contained
|
||||
syn match texinfoThisAtCmd "@thischapter" contained
|
||||
syn match texinfoThisAtCmd "@thischaptername" contained
|
||||
syn match texinfoThisAtCmd "@thisfile" contained
|
||||
syn match texinfoThisAtCmd "@thispage" contained
|
||||
syn match texinfoThisAtCmd "@thistitle" contained
|
||||
syn match texinfoThisAtCmd "@today{}" contained
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@evenfooting" skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@evenheading" skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@everyfooting" skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@everyheading" skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@oddfooting" skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
|
||||
syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@oddheading" skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
|
||||
|
||||
|
||||
"refilling paragraphs (appendix H in Texinfo manual)
|
||||
syn match texinfoAtCmd "@refill"
|
||||
|
||||
|
||||
syn cluster texinfoAll contains=ALLBUT,texinfoThisAtCmd,texinfoHFSpecialChar
|
||||
syn cluster texinfoReducedAll contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
|
||||
"==============================================================================
|
||||
" highlighting
|
||||
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
hi def link texinfoSpecialChar Special
|
||||
hi def link texinfoHFSpecialChar Special
|
||||
|
||||
hi def link texinfoError Error
|
||||
hi def link texinfoIdent Identifier
|
||||
hi def link texinfoAssignment Identifier
|
||||
hi def link texinfoSinglePar Identifier
|
||||
hi def link texinfoIndexPar Identifier
|
||||
hi def link texinfoSIPar Identifier
|
||||
hi def link texinfoDIEPar Identifier
|
||||
hi def link texinfoTexCmd PreProc
|
||||
|
||||
|
||||
hi def link texinfoAtCmd Statement "@-command
|
||||
hi def link texinfoPrmAtCmd String "@-command in one line with unknown nr. of parameters
|
||||
"is String because is found as a region and is 'matchgroup'-ed
|
||||
"to texinfoAtCmd
|
||||
hi def link texinfoBrcPrmAtCmd String "@-command with parameter(s) in braces ({})
|
||||
"is String because is found as a region and is 'matchgroup'-ed to texinfoAtCmd
|
||||
hi def link texinfoMltlnAtCmdFLine texinfoAtCmd "repeated embedded First lines in @-commands
|
||||
hi def link texinfoMltlnAtCmd String "@-command in multiple lines
|
||||
"is String because is found as a region and is 'matchgroup'-ed to texinfoAtCmd
|
||||
hi def link texinfoMltln2AtCmd PreProc "@-command in multiple lines (same as texinfoMltlnAtCmd, just with other colors)
|
||||
hi def link texinfoMltlnDMAtCmd PreProc "@-command in multiple lines (same as texinfoMltlnAtCmd, just with other colors; used for @detailmenu, which can be included in @menu)
|
||||
hi def link texinfoMltlnNAtCmd Normal "@-command in multiple lines (same as texinfoMltlnAtCmd, just with other colors)
|
||||
hi def link texinfoThisAtCmd Statement "@-command used in headers and footers (@this... series)
|
||||
|
||||
hi def link texinfoComment Comment
|
||||
|
||||
|
||||
hi def link texinfoDelimiter Delimiter
|
||||
hi def link texinfoComment Comment
|
||||
hi def link texinfoControlSequence Identifier
|
||||
hi def link texinfoBrace Operator
|
||||
hi def link texinfoArgument Special
|
||||
hi def link texinfoExample String
|
||||
hi def link texinfoVerbatim String
|
||||
hi def link texinfoVerb String
|
||||
hi def link texinfoCode String
|
||||
hi def link texinfoMenu String
|
||||
|
||||
let b:current_syntax = "texinfo"
|
||||
|
||||
if main_syntax == 'texinfo'
|
||||
unlet main_syntax
|
||||
endif
|
||||
|
||||
" vim: ts=8
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim 8.2 script
|
||||
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
||||
" Last Change: December 02, 2021
|
||||
" Version: 8.2-18
|
||||
" Last Change: December 29, 2021
|
||||
" Version: 8.2-23
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
|
||||
" Automatically generated keyword lists: {{{1
|
||||
|
||||
@@ -19,34 +19,34 @@ syn keyword vimTodo contained COMBAK FIXME TODO XXX
|
||||
syn cluster vimCommentGroup contains=vimTodo,@Spell
|
||||
|
||||
" regular vim commands {{{2
|
||||
syn keyword vimCommand contained a ar[gs] argl[ocal] ba[ll] bl[ast] brea[k] buffers ca caf[ter] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cn[ext] colo[rscheme] cons[t] cs d[elete] delel delf[unction] dif[fupdate] difft[his] dli[st] ds[earch] echoc[onsole] em[enu] endw[hile] export filt[er] fo[ld] fu[nction] gvim helpt[ags] iabc[lear] import isp[lit] keepa l[ist] laf[ter] lbel[ow] lcscope lf[ile] lgr[ep] lli[st] lnf[ile] lol[der] lt[ag] lw[indow] menut[ranslate] mkvie[w] nbc[lose] noh[lsearch] ol[dfiles] pa[ckadd] po[p] prof[ile] pta[g] ptr[ewind] py3f[ile] pythonx quita[ll] redraws[tatus] rew[ind] rubyf[ile] sIg sa[rgument] sba[ll] sbr[ewind] scl scscope sfir[st] sgl sic sin sm[ap] snoreme spelld[ump] spellw[rong] srg sta[g] sts[elect] sus[pend] syncbind tabN[ext] tabl[ast] tabr[ewind] tcld[o] tj[ump] tlu tno[remap] tu[nmenu] undol[ist] v vie[w] vne[w] wh[ile] wn[ext] wv[iminfo] xmenu xunme
|
||||
syn keyword vimCommand contained ab arga[dd] argu[ment] bad[d] bm[odified] breaka[dd] bun[load] cabc[lear] cal[l] cc cf[ile] changes cla[st] cnew[er] com cope[n] cscope debug delep dell diffg[et] dig[raphs] do dsp[lit] echoe[rr] en[dif] ene[w] exu[sage] fin[d] foldc[lose] g h[elp] hi if in iuna[bbrev] keepalt la[st] lan[guage] lbo[ttom] ld[o] lfdo lgrepa[dd] lma lo[adview] lop[en] lua m[ove] mes[sages] mod[e] nbs[tart] nor omapc[lear] packl[oadall] popu[p] profd[el] ptf[irst] pts[elect] py3f[ile] pyx r[ead] redrawt[abline] ri[ght] rundo sIl sal[l] sbf[irst] sc scp se[t] sg sgn sie sip sme snoremenu spelli[nfo] spr[evious] sri star[tinsert] substitutepattern sv[iew] syntime tabc[lose] tabm[ove] tabs tclf[ile] tl[ast] tlunmenu to[pleft] tunma[p] unh[ide] var vim9[cmd] vs[plit] win[size] wp[revious] x[it] xnoreme xunmenu
|
||||
syn keyword vimCommand contained abc[lear] argd[elete] as[cii] balt bn[ext] breakd[el] bw[ipeout] cabo[ve] cat[ch] ccl[ose] cfdo chd[ir] class cnf[ile] comc[lear] cp[revious] cstag debugg[reedy] deletel delm[arks] diffo[ff] dir doau e[dit] echom[sg] enddef eval f[ile] fina[lly] foldd[oopen] go[to] ha[rdcopy] hid[e] ij[ump] inor j[oin] keepj[umps] lab[ove] lat lc[d] le[ft] lfir[st] lh[elpgrep] lmak[e] loadk lp[revious] luado ma[rk] mk[exrc] mz[scheme] new nore on[ly] pc[lose] pp[op] promptf[ind] ptj[ump] pu[t] py[thon] pyxdo rec[over] reg[isters] rightb[elow] rv[iminfo] sIn san[dbox] sbl[ast] scI scr[iptnames] setf[iletype] sgI sgp sig sir smenu so[urce] spellr[are] sr srl startg[replace] substituterepeat sw[apname] t tabd[o] tabn[ext] tags te[aroff] tlm tm[enu] tp[revious] type unl ve[rsion] vim9s[cript] wN[ext] winc[md] wq xa[ll] xnoremenu xwininfo
|
||||
syn keyword vimCommand contained abo[veleft] argdo au bd[elete] bo[tright] breakl[ist] cN[ext] cad[dbuffer] cb[uffer] cd cfir[st] che[ckpath] cle[arjumps] cnor comp[iler] cpf[ile] cun def deletep delp diffp[atch] disa[ssemble] doaut ea echon endf[unction] ex files fini[sh] folddoc[losed] gr[ep] helpc[lose] his[tory] il[ist] interface ju[mps] keepp[atterns] lad[dexpr] later lch[dir] lefta[bove] lg[etfile] lhi[story] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] mks[ession] mzf[ile] nmapc[lear] nos[wapfile] opt[ions] pe[rl] pre[serve] promptr[epl] ptl[ast] pw[d] pydo pyxfile red[o] res[ize] ru[ntime] sI sIp sav[eas] sbm[odified] sce scripte[ncoding] setg[lobal] sgc sgr sign sl[eep] smile sor[t] spellr[epall] srI srn startr[eplace] sun[hide] sy tN[ext] tabe[dit] tabnew tc[d] ter[minal] tlmenu tma[p] tr[ewind] u[ndo] unlo[ckvar] verb[ose] vim[grep] w[rite] windo wqa[ll] xmapc[lear] xprop y[ank]
|
||||
syn keyword vimCommand contained addd arge[dit] bN[ext] bel[owright] bp[revious] bro[wse] cNf[ile] cadde[xpr] cbe[fore] cdo cg[etfile] checkt[ime] clo[se] co[py] con[tinue] cq[uit] cuna[bbrev] defc[ompile] deletl dep diffpu[t] dj[ump] dp earlier el[se] endfo[r] exi[t] filet fir[st] foldo[pen] grepa[dd] helpf[ind] i imapc[lear] intro k lN[ext] laddb[uffer] lb[uffer] lcl[ose] leg[acy] lgetb[uffer] ll lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks mksp[ell] n[ext] noa nu[mber] ownsyntax ped[it] prev[ious] ps[earch] ptn[ext] py3 pyf[ile] q[uit] redi[r] ret[ab] rub[y] sIc sIr sbN[ext] sbn[ext] scg scriptv[ersion] setl[ocal] sge sh[ell] sil[ent] sla[st] sn[ext] sp[lit] spellr[rare] src srp stj[ump] sunme syn ta[g] tabf[ind] tabo[nly] tch[dir] tf[irst] tln tmapc[lear] try una[bbreviate] uns[ilent] vert[ical] vimgrepa[dd] wa[ll] winp[os] wundo xme xr[estore] z[^.=]
|
||||
syn keyword vimCommand contained al[l] argg[lobal] b[uffer] bf[irst] br[ewind] bufdo c[hange] caddf[ile] cbel[ow] ce[nter] cgetb[uffer] chi[story] cmapc[lear] col[der] conf[irm] cr[ewind] cw[indow] delc[ommand] deletp di[splay] diffs[plit] dl dr[op] ec elsei[f] endt[ry] exp filetype fix[del] for gui helpg[rep] ia imp is[earch] kee[pmarks] lNf[ile] laddf[ile] lbe[fore] lcs lex[pr] lgete[xpr] lla[st] lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] mkv[imrc] nb[key] noautocmd o[pen] p[rint] perld[o] pro ptN[ext] ptp[revious] py3do python3 qa[ll] redr[aw] retu[rn] rubyd[o] sIe sN[ext] sb[uffer] sbp[revious] sci scs sf[ind] sgi si sim[alt] sm[agic] sno[magic] spe[llgood] spellu[ndo] sre[wind] st[op] stopi[nsert] sunmenu sync tab tabfir[st] tabp[revious] tcl th[row] tlnoremenu tn[ext] ts[elect] undoj[oin] up[date] vi[sual] viu[sage]
|
||||
syn keyword vimCommand contained a ar[gs] argg[lobal] b[uffer] bf[irst] br[ewind] bufdo c[hange] caddf[ile] cbel[ow] ce[nter] cgetb[uffer] chi[story] cmapc[lear] col[der] conf[irm] cr[ewind] cw[indow] delc[ommand] deletp di[splay] diffs[plit] dl dr[op] ec elsei[f] endt[ry] exp filetype fix[del] for gui helpg[rep] ia imp is[earch] kee[pmarks] lNf[ile] laddf[ile] lbe[fore] lcs lex[pr] lgete[xpr] lla[st] lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] mkv[imrc] nb[key] noautocmd o[pen] p[rint] perld[o] pro ptN[ext] ptp[revious] py3do python3 qa[ll] redr[aw] retu[rn] rubyd[o] sIe sN[ext] sb[uffer] sbp[revious] sci scs sf[ind] sgi si sim[alt] sm[agic] sno[magic] spe[llgood] spellu[ndo] sre[wind] st[op] stopi[nsert] sunmenu sync tab tabfir[st] tabp[revious] tcl th[row] tlnoremenu tn[ext] ts[elect] undoj[oin] up[date] vi[sual] viu[sage] wh[ile] wn[ext] wv[iminfo] xmenu xunme
|
||||
syn keyword vimCommand contained ab arga[dd] argl[ocal] ba[ll] bl[ast] brea[k] buffers ca caf[ter] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cn[ext] colo[rscheme] cons[t] cs d[elete] delel delf[unction] dif[fupdate] difft[his] dli[st] ds[earch] echoc[onsole] em[enu] endw[hile] export filt[er] fo[ld] fu[nction] gvim helpt[ags] iabc[lear] import isp[lit] keepa l[ist] laf[ter] lbel[ow] lcscope lf[ile] lgr[ep] lli[st] lnf[ile] lol[der] lt[ag] lw[indow] menut[ranslate] mkvie[w] nbc[lose] noh[lsearch] ol[dfiles] pa[ckadd] po[p] prof[ile] pta[g] ptr[ewind] py3f[ile] pythonx quita[ll] redraws[tatus] rew[ind] rubyf[ile] sIg sa[rgument] sba[ll] sbr[ewind] scl scscope sfir[st] sgl sic sin sm[ap] snoreme spelld[ump] spellw[rong] srg sta[g] sts[elect] sus[pend] syncbind tabN[ext] tabl[ast] tabr[ewind] tcld[o] tj[ump] tlu tno[remap] tu[nmenu] undol[ist] v vie[w] vne[w] win[size] wp[revious] x[it] xnoreme xunmenu
|
||||
syn keyword vimCommand contained abc[lear] argd[elete] argu[ment] bad[d] bm[odified] breaka[dd] bun[load] cabc[lear] cal[l] cc cf[ile] changes cla[st] cnew[er] com cope[n] cscope debug delep dell diffg[et] dig[raphs] do dsp[lit] echoe[rr] en[dif] ene[w] exu[sage] fin[d] foldc[lose] g h[elp] hi if in iuna[bbrev] keepalt la[st] lan[guage] lbo[ttom] ld[o] lfdo lgrepa[dd] lma lo[adview] lop[en] lua m[ove] mes[sages] mod[e] nbs[tart] nor omapc[lear] packl[oadall] popu[p] profd[el] ptf[irst] pts[elect] py3f[ile] pyx r[ead] redrawt[abline] ri[ght] rundo sIl sal[l] sbf[irst] sc scp se[t] sg sgn sie sip sme snoremenu spelli[nfo] spr[evious] sri star[tinsert] substitutepattern sv[iew] syntime tabc[lose] tabm[ove] tabs tclf[ile] tl[ast] tlunmenu to[pleft] tunma[p] unh[ide] var vim9[cmd] vs[plit] winc[md] wq xa[ll] xnoremenu xwininfo
|
||||
syn keyword vimCommand contained abo[veleft] argded[upe] as[cii] balt bn[ext] breakd[el] bw[ipeout] cabo[ve] cat[ch] ccl[ose] cfdo chd[ir] class cnf[ile] comc[lear] cp[revious] cstag debugg[reedy] deletel delm[arks] diffo[ff] dir doau e[dit] echom[sg] enddef eval f[ile] fina[lly] foldd[oopen] go[to] ha[rdcopy] hid[e] ij[ump] inor j[oin] keepj[umps] lab[ove] lat lc[d] le[ft] lfir[st] lh[elpgrep] lmak[e] loadk lp[revious] luado ma[rk] mk[exrc] mz[scheme] new nore on[ly] pc[lose] pp[op] promptf[ind] ptj[ump] pu[t] py[thon] pyxdo rec[over] reg[isters] rightb[elow] rv[iminfo] sIn san[dbox] sbl[ast] scI scr[iptnames] setf[iletype] sgI sgp sig sir smenu so[urce] spellr[are] sr srl startg[replace] substituterepeat sw[apname] t tabd[o] tabn[ext] tags te[aroff] tlm tm[enu] tp[revious] type unl ve[rsion] vim9s[cript] wN[ext] windo wqa[ll] xmapc[lear] xprop y[ank]
|
||||
syn keyword vimCommand contained addd argdo au bd[elete] bo[tright] breakl[ist] cN[ext] cad[dbuffer] cb[uffer] cd cfir[st] che[ckpath] cle[arjumps] cnor comp[iler] cpf[ile] cun def deletep delp diffp[atch] disa[ssemble] doaut ea echon endf[unction] ex files fini[sh] folddoc[losed] gr[ep] helpc[lose] his[tory] il[ist] interface ju[mps] keepp[atterns] lad[dexpr] later lch[dir] lefta[bove] lg[etfile] lhi[story] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] mks[ession] mzf[ile] nmapc[lear] nos[wapfile] opt[ions] pe[rl] pre[serve] promptr[epl] ptl[ast] pw[d] pydo pyxfile red[o] res[ize] ru[ntime] sI sIp sav[eas] sbm[odified] sce scripte[ncoding] setg[lobal] sgc sgr sign sl[eep] smile sor[t] spellr[epall] srI srn startr[eplace] sun[hide] sy tN[ext] tabe[dit] tabnew tc[d] ter[minal] tlmenu tma[p] tr[ewind] u[ndo] unlo[ckvar] verb[ose] vim[grep] w[rite] winp[os] wundo xme xr[estore] z[^.=]
|
||||
syn keyword vimCommand contained al[l] arge[dit] bN[ext] bel[owright] bp[revious] bro[wse] cNf[ile] cadde[xpr] cbe[fore] cdo cg[etfile] checkt[ime] clo[se] co[py] con[tinue] cq[uit] cuna[bbrev] defc[ompile] deletl dep diffpu[t] dj[ump] dp earlier el[se] endfo[r] exi[t] filet fir[st] foldo[pen] grepa[dd] helpf[ind] i imapc[lear] intro k lN[ext] laddb[uffer] lb[uffer] lcl[ose] leg[acy] lgetb[uffer] ll lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks mksp[ell] n[ext] noa nu[mber] ownsyntax ped[it] prev[ious] ps[earch] ptn[ext] py3 pyf[ile] q[uit] redi[r] ret[ab] rub[y] sIc sIr sbN[ext] sbn[ext] scg scriptv[ersion] setl[ocal] sge sh[ell] sil[ent] sla[st] sn[ext] sp[lit] spellr[rare] src srp stj[ump] sunme syn ta[g] tabf[ind] tabo[nly] tch[dir] tf[irst] tln tmapc[lear] try una[bbreviate] uns[ilent] vert[ical] vimgrepa[dd] wa[ll]
|
||||
syn match vimCommand contained "\<z[-+^.=]\=\>"
|
||||
syn keyword vimStdPlugin contained Arguments Asm Break Cfilter Clear Continue DiffOrig Evaluate Finish Gdb Lfilter Man N[ext] Over P[rint] Program Run S Source Step Stop Termdebug TermdebugCommand TOhtml Winbar XMLent XMLns
|
||||
|
||||
" vimOptions are caught only when contained in a vimSet {{{2
|
||||
syn keyword vimOption contained acd ambw arshape aw backupskip beval bk bri bufhidden cdpath cindent cm colorcolumn completeopt cp cscopeprg csprg culopt def diffexpr ea ei ep eventignore fdi fenc fileformat fkmap foldexpr foldopen fsync gfw gtt guipty hi hkp ignorecase imd imstatusfunc indentkeys isfname js langmap linebreak lmap lw mat maxmemtot mkspellmem mod mousef mousetime nf ofu para penc pm previewwindow printoptions pw qftf relativenumber rightleftcmd ru sbr scrollfocus sel shellcmdflag shellxquote showfulltag signcolumn smc spell splitbelow ssl stl sw sxe tabpagemax tagrelative tbis termencoding textauto thesaurus titleold top ttimeout ttymouse twt undofile varsofttabstop verbosefile viminfofile wak weirdinvert wig wildoptions winheight wm wrapscan
|
||||
syn keyword vimOption contained ai anti asd awa balloondelay bevalterm bkc briopt buflisted cedit cink cmdheight columns completepopup cpo cscopequickfix csqf cursorbind define diffopt ead ek equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guicursor guitablabel hid hl im imdisable imstyle indk isi key langmenu lines lnr lz matchpairs mco ml modeline mousefocus mp nrformats omnifunc paragraphs perldll pmbcs printdevice prompt pythondll quickfixtextfunc remap rl rubydll sc scrolljump selection shellpipe shiftround showmatch siso smd spellcapcheck splitright ssop stmp swapfile sxq tabstop tags tbs termguicolors textmode thesaurusfunc titlestring tpm ttimeoutlen ttyscroll tx undolevels vartabstop vfile virtualedit warn wfh wildchar wim winminheight wmh write
|
||||
syn keyword vimOption contained akm antialias autochdir background ballooneval bex bl brk buftype cf cinkeys cmdwinheight com completeslash cpoptions cscoperelative csre cursorcolumn delcombine digraph eadirection emo equalprg expandtab fdls fex fileignorecase fml foldlevel formatexpr gcr gli guifont guitabtooltip hidden hlg imactivatefunc imi inc inex isident keymap langnoremap linespace loadplugins ma matchtime mef mle modelineexpr mousehide mps nu opendevice paste pex pmbfn printencoding pt pythonhome quoteescape renderoptions rlc ruf scb scrolloff selectmode shellquote shiftwidth showmode sj sn spellfile spo st sts swapsync syn tag tagstack tc termwinkey textwidth tildeop tl tr ttm ttytype uc undoreload vb vi visualbell wb wfw wildcharm winaltkeys winminwidth wmnu writeany
|
||||
syn keyword vimOption contained al ar autoindent backspace balloonevalterm bexpr bo browsedir casemap cfu cino cmp comments concealcursor cpp cscopetag cst cursorline dex dip eb emoji errorbells exrc fdm ff filetype fmr foldlevelstart formatlistpat gd go guifontset helpfile highlight hls imactivatekey iminsert include inf isk keymodel langremap lisp lpl macatsui maxcombine menc mls modelines mousem msm number operatorfunc pastetoggle pexpr popt printexpr pumheight pythonthreedll rdt report rnu ruler scf scrollopt sessionoptions shellredir shm showtabline slm so spelllang spr sta su swb synmaxcol tagbsearch tal tcldll termwinscroll tf timeout tm ts tty tw udf updatecount vbs viewdir vop wc wh wildignore wincolor winptydll wmw writebackup
|
||||
syn keyword vimOption contained aleph arab autoread backup balloonexpr bg bomb bs cb ch cinoptions cms commentstring conceallevel cpt cscopetagorder csto cursorlineopt dg dir ed enc errorfile fcl fdn ffs fillchars fo foldmarker formatoptions gdefault gp guifontwide helpheight history hlsearch imaf ims includeexpr infercase iskeyword keywordprg laststatus lispwords lrm magic maxfuncdepth menuitems mm modifiable mousemodel mzq numberwidth opfunc patchexpr pfn pp printfont pumwidth pythonthreehome re restorescreen ro rulerformat scl scs sft shellslash shortmess shq sm softtabstop spelloptions sps stal sua swf syntax tagcase tb tenc termwinsize tfu timeoutlen to tsl ttybuiltin twk udir updatetime vdir viewoptions vsts wcm whichwrap wildignorecase window winwidth wop writedelay
|
||||
syn keyword vimOption contained allowrevins arabic autoshelldir backupcopy bdir bh breakat bsdir cc charconvert cinw co compatible confirm crb cscopeverbose csverb cwh dict directory edcompatible encoding errorformat fcs fdo fic fixendofline foldclose foldmethod formatprg gfm grepformat guiheadroom helplang hk ic imak imsearch incsearch insertmode isp km lazyredraw list ls makeef maxmapdepth mfd mmd modified mouses mzquantum nuw osfiletype patchmode ph preserveindent printheader pvh pyx readonly revins rop runtimepath scr sect sh shelltemp shortname si smartcase sol spellsuggest sr startofline suffixes switchbuf ta tagfunc tbi term termwintype tgc title toolbar tsr ttyfast tws ul ur ve vif vts wcr wi wildmenu winfixheight wiv wrap ws
|
||||
syn keyword vimOption contained altkeymap arabicshape autowrite backupdir bdlay bin breakindent bsk ccv ci cinwords cocu complete copyindent cryptmethod csl cuc debug dictionary display ef endofline esckeys fdc fdt fileencoding fixeol foldcolumn foldminlines fp gfn grepprg guiligatures hf hkmap icon imc imsf inde is isprint kmp lbr listchars lsp makeencoding maxmem mh mmp more mouseshape mzschemedll odev pa path pheader previewheight printmbcharset pvp pyxversion redrawtime ri rs sb scroll sections shcf shelltype showbreak sidescroll smartindent sp spf srr statusline suffixesadd sws tabline taglength tbidi termbidi terse tgst titlelen toolbariconsize tsrfu ttym twsl undodir ut verbose viminfo wa wd wic wildmode winfixwidth wiw wrapmargin ww
|
||||
syn keyword vimOption contained ambiwidth ari autowriteall backupext belloff binary breakindentopt bt cd cin clipboard cole completefunc cot cscopepathcomp cspc cul deco diff dy efm eol et fde fen fileencodings fk foldenable foldnestmax fs gfs gtl guioptions hh hkmapp iconstring imcmdline imst indentexpr isf joinspaces kp lcs lm luadll makeprg maxmempattern mis mmt mouse mouset mzschemegcdll oft packpath pdev pi previewpopup printmbfont pvw qe regexpengine rightleft rtp sbo scrollbind secure shell shellxescape showcmd sidescrolloff smarttab spc spl ss
|
||||
syn keyword vimOption contained acd ambw arshape aw backupskip beval bk bri bufhidden cdh ci cinwords cocu complete copyindent cryptmethod csl cuc debug dictionary display ef endofline esckeys fdc fdt fileencoding fixeol foldcolumn foldminlines fp gfn grepprg guiligatures hf hkmap icon imc imsf inde is isprint kmp lbr listchars lsp makeencoding maxmem mh mmp more mouseshape mzschemedll odev pa path pheader previewheight printmbcharset pvp pyxversion redrawtime ri rs sb scroll sections shcf shelltype showbreak sidescroll smartindent sp spf srr statusline sw sxq tabstop tags tbs termguicolors textmode thesaurusfunc titlestring tpm ttimeoutlen ttyscroll tx undolevels vartabstop vfile virtualedit warn wfh wildchar wim winminheight wmh write
|
||||
syn keyword vimOption contained ai anti asd awa balloondelay bevalterm bkc briopt buflisted cdhome cin clipboard cole completefunc cot cscopepathcomp cspc cul deco diff dy efm eol et fde fen fileencodings fk foldenable foldnestmax fs gfs gtl guioptions hh hkmapp iconstring imcmdline imst indentexpr isf joinspaces kp lcs lm luadll makeprg maxmempattern mis mmt mouse mouset mzschemegcdll oft packpath pdev pi previewpopup printmbfont pvw qe regexpengine rightleft rtp sbo scrollbind secure shell shellxescape showcmd sidescrolloff smarttab spc spl ss stl swapfile syn tag tagstack tc termwinkey textwidth tildeop tl tr ttm ttytype uc undoreload vb vi visualbell wb wfw wildcharm winaltkeys winminwidth wmnu writeany
|
||||
syn keyword vimOption contained akm antialias autochdir background ballooneval bex bl brk buftype cdpath cindent cm colorcolumn completeopt cp cscopeprg csprg culopt def diffexpr ea ei ep eventignore fdi fenc fileformat fkmap foldexpr foldopen fsync gfw gtt guipty hi hkp ignorecase imd imstatusfunc indentkeys isfname js langmap linebreak lmap lw mat maxmemtot mkspellmem mod mousef mousetime nf ofu para penc pm previewwindow printoptions pw qftf relativenumber rightleftcmd ru sbr scrollfocus sel shellcmdflag shellxquote showfulltag signcolumn smc spell splitbelow ssl stmp swapsync synmaxcol tagbsearch tal tcldll termwinscroll tf timeout tm ts tty tw udf updatecount vbs viewdir vop wc wh wildignore wincolor winptydll wmw writebackup
|
||||
syn keyword vimOption contained al ar autoindent backspace balloonevalterm bexpr bo browsedir casemap cedit cink cmdheight columns completepopup cpo cscopequickfix csqf cursorbind define diffopt ead ek equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guicursor guitablabel hid hl im imdisable imstyle indk isi key langmenu lines lnr lz matchpairs mco ml modeline mousefocus mp nrformats omnifunc paragraphs perldll pmbcs printdevice prompt pythondll quickfixtextfunc remap rl rubydll sc scrolljump selection shellpipe shiftround showmatch siso smd spellcapcheck splitright ssop sts swb syntax tagcase tb tenc termwinsize tfu timeoutlen to tsl ttybuiltin twk udir updatetime vdir viewoptions vsts wcm whichwrap wildignorecase window winwidth wop writedelay
|
||||
syn keyword vimOption contained aleph arab autoread backup balloonexpr bg bomb bs cb cf cinkeys cmdwinheight com completeslash cpoptions cscoperelative csre cursorcolumn delcombine digraph eadirection emo equalprg expandtab fdls fex fileignorecase fml foldlevel formatexpr gcr gli guifont guitabtooltip hidden hlg imactivatefunc imi inc inex isident keymap langnoremap linespace loadplugins ma matchtime mef mle modelineexpr mousehide mps nu opendevice paste pex pmbfn printencoding pt pythonhome quoteescape renderoptions rlc ruf scb scrolloff selectmode shellquote shiftwidth showmode sj sn spellfile spo st su swf ta tagfunc tbi term termwintype tgc title toolbar tsr ttyfast tws ul ur ve vif vts wcr wi wildmenu winfixheight wiv wrap ws
|
||||
syn keyword vimOption contained allowrevins arabic autoshelldir backupcopy bdir bh breakat bsdir cc cfu cino cmp comments concealcursor cpp cscopetag cst cursorline dex dip eb emoji errorbells exrc fdm ff filetype fmr foldlevelstart formatlistpat gd go guifontset helpfile highlight hls imactivatekey iminsert include inf isk keymodel langremap lisp lpl macatsui maxcombine menc mls modelines mousem msm number operatorfunc pastetoggle pexpr popt printexpr pumheight pythonthreedll rdt report rnu ruler scf scrollopt sessionoptions shellredir shm showtabline slm so spelllang spr sta sua switchbuf tabline taglength tbidi termbidi terse tgst titlelen toolbariconsize tsrfu ttym twsl undodir ut verbose viminfo wa wd wic wildmode winfixwidth wiw wrapmargin ww
|
||||
syn keyword vimOption contained altkeymap arabicshape autowrite backupdir bdlay bin breakindent bsk ccv ch cinoptions cms commentstring conceallevel cpt cscopetagorder csto cursorlineopt dg dir ed enc errorfile fcl fdn ffs fillchars fo foldmarker formatoptions gdefault gp guifontwide helpheight history hlsearch imaf ims includeexpr infercase iskeyword keywordprg laststatus lispwords lrm magic maxfuncdepth menuitems mm modifiable mousemodel mzq numberwidth opfunc patchexpr pfn pp printfont pumwidth pythonthreehome re restorescreen ro rulerformat scl scs sft shellslash shortmess shq sm softtabstop spelloptions sps stal suffixes sws tabpagemax tagrelative tbis termencoding textauto thesaurus titleold top ttimeout ttymouse twt undofile varsofttabstop verbosefile viminfofile wak weirdinvert wig wildoptions winheight wm wrapscan xtermcodes
|
||||
syn keyword vimOption contained ambiwidth ari autowriteall backupext belloff binary breakindentopt bt cd charconvert cinw co compatible confirm crb cscopeverbose csverb cwh dict directory edcompatible encoding errorformat fcs fdo fic fixendofline foldclose foldmethod formatprg gfm grepformat guiheadroom helplang hk ic imak imsearch incsearch insertmode isp km lazyredraw list ls makeef maxmapdepth mfd mmd modified mouses mzquantum nuw osfiletype patchmode ph preserveindent printheader pvh pyx readonly revins rop runtimepath scr sect sh shelltemp shortname si smartcase sol spellsuggest sr startofline suffixesadd sxe
|
||||
|
||||
" vimOptions: These are the turn-off setting variants {{{2
|
||||
syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoindent noautowrite noawa noballoonevalterm nobin nobl nobri noci nocompatible nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noemoji noequalalways noet noexrc nofileignorecase nofk nofs nogdefault nohidden nohkmapp nohlsearch noignorecase noimcmdline noincsearch noinsertmode nojs nolazyredraw nolisp noloadplugins nolz nomagic nomle nomodelineexpr nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscrollbind noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup
|
||||
syn keyword vimOption contained noai noaltkeymap noar noarabicshape noasd noautoread noautowriteall nobackup nobeval nobinary nobomb nobuflisted nocin noconfirm nocrb nocscopeverbose nocsverb nocursorbind nodeco nodiff noeb noek noendofline noerrorbells noex nofen nofixendofline nofkmap nofsync noguipty nohk nohkp noic noim noimd noinf nois nolangnoremap nolbr nolist nolpl noma nomh nomod nomodifiable nomore nomousefocus nonu noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscf noscrollfocus nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab nosn nospell nosplitright nosr nosta nostmp noswf notagbsearch notagstack notbidi notermbidi notextauto notf notildeop notitle notop nottimeout nottyfast noudf novb nowa nowb nowfh nowic nowildmenu nowinfixwidth nowmnu nowrapscan nowriteany nows
|
||||
syn keyword vimOption contained noakm noanti noarab noari noautochdir noautoshelldir noaw noballooneval nobevalterm nobk nobreakindent nocf nocindent nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noemo noeol noesckeys noexpandtab nofic nofixeol nofoldenable nogd nohid nohkmap nohls noicon noimc noimdisable noinfercase nojoinspaces nolangremap nolinebreak nolnr nolrm nomacatsui noml nomodeline
|
||||
syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoindent noautowrite noawa noballoonevalterm nobin nobl nobri noci nocompatible nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noemoji noequalalways noet noexrc nofileignorecase nofk nofs nogdefault nohidden nohkmapp nohlsearch noignorecase noimcmdline noincsearch noinsertmode nojs nolazyredraw nolisp noloadplugins nolz nomagic nomle nomodelineexpr nomore nomousefocus nonu noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscf noscrollfocus nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab nosn nospell nosplitright nosr nosta nostmp noswf notagbsearch notagstack notbidi notermbidi notextauto notf notildeop notitle notop nottimeout nottyfast noudf novb nowa nowb nowfh nowic nowildmenu nowinfixwidth nowmnu nowrapscan nowriteany nows
|
||||
syn keyword vimOption contained noai noaltkeymap noar noarabicshape noasd noautoread noautowriteall nobackup nobeval nobinary nobomb nobuflisted nocin noconfirm nocrb nocscopeverbose nocsverb nocursorbind nodeco nodiff noeb noek noendofline noerrorbells noex nofen nofixendofline nofkmap nofsync noguipty nohk nohkp noic noim noimd noinf nois nolangnoremap nolbr nolist nolpl noma nomh nomod nomodifiable nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscrollbind noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup noxtermcodes
|
||||
syn keyword vimOption contained noakm noanti noarab noari noautochdir noautoshelldir noaw noballooneval nobevalterm nobk nobreakindent nocf nocindent nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noemo noeol noesckeys noexpandtab nofic nofixeol nofoldenable nogd nohid nohkmap nohls noicon noimc noimdisable noinfercase nojoinspaces nolangremap nolinebreak nolnr nolrm nomacatsui noml nomodeline nomodified
|
||||
|
||||
" vimOptions: These are the invertible variants {{{2
|
||||
syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoindent invautowrite invawa invballoonevalterm invbin invbl invbri invci invcompatible invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible invemoji invequalalways invet invexrc invfileignorecase invfk invfs invgdefault invhidden invhkmapp invhlsearch invignorecase invimcmdline invincsearch invinsertmode invjs invlazyredraw invlisp invloadplugins invlz invmagic invmle invmodelineexpr invmodified invmousef invmousehide invnumber invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscrollbind invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd invsol invsplitbelow invspr invssl invstartofline invswapfile invta invtagrelative invtbi invtbs invterse invtextmode invtgst invtimeout invto invtr invttybuiltin invtx invundofile invvisualbell invwarn invweirdinvert invwfw invwildignorecase invwinfixheight invwiv invwrap invwrite invwritebackup
|
||||
syn keyword vimOption contained invai invaltkeymap invar invarabicshape invasd invautoread invautowriteall invbackup invbeval invbinary invbomb invbuflisted invcin invconfirm invcrb invcscopeverbose invcsverb invcursorbind invdeco invdiff inveb invek invendofline inverrorbells invex invfen invfixendofline invfkmap invfsync invguipty invhk invhkp invic invim invimd invinf invis invlangnoremap invlbr invlist invlpl invma invmh invmod invmodifiable invmore invmousefocus invnu invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscf invscrollfocus invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab invsn invspell invsplitright invsr invsta invstmp invswf invtagbsearch invtagstack invtbidi invtermbidi invtextauto invtf invtildeop invtitle invtop invttimeout invttyfast invudf invvb invwa invwb invwfh invwic invwildmenu invwinfixwidth invwmnu invwrapscan invwriteany invws
|
||||
syn keyword vimOption contained invakm invanti invarab invari invautochdir invautoshelldir invaw invballooneval invbevalterm invbk invbreakindent invcf invcindent invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invemo inveol invesckeys invexpandtab invfic invfixeol invfoldenable invgd invhid invhkmap invhls invicon invimc invimdisable invinfercase invjoinspaces invlangremap invlinebreak invlnr invlrm invmacatsui invml invmodeline
|
||||
syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoindent invautowrite invawa invballoonevalterm invbin invbl invbri invci invcompatible invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible invemoji invequalalways invet invexrc invfileignorecase invfk invfs invgdefault invhidden invhkmapp invhlsearch invignorecase invimcmdline invincsearch invinsertmode invjs invlazyredraw invlisp invloadplugins invlz invmagic invmle invmodelineexpr invmore invmousefocus invnu invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscf invscrollfocus invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab invsn invspell invsplitright invsr invsta invstmp invswf invtagbsearch invtagstack invtbidi invtermbidi invtextauto invtf invtildeop invtitle invtop invttimeout invttyfast invudf invvb invwa invwb invwfh invwic invwildmenu invwinfixwidth invwmnu invwrapscan invwriteany invws
|
||||
syn keyword vimOption contained invai invaltkeymap invar invarabicshape invasd invautoread invautowriteall invbackup invbeval invbinary invbomb invbuflisted invcin invconfirm invcrb invcscopeverbose invcsverb invcursorbind invdeco invdiff inveb invek invendofline inverrorbells invex invfen invfixendofline invfkmap invfsync invguipty invhk invhkp invic invim invimd invinf invis invlangnoremap invlbr invlist invlpl invma invmh invmod invmodifiable invmousef invmousehide invnumber invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscrollbind invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd invsol invsplitbelow invspr invssl invstartofline invswapfile invta invtagrelative invtbi invtbs invterse invtextmode invtgst invtimeout invto invtr invttybuiltin invtx invundofile invvisualbell invwarn invweirdinvert invwfw invwildignorecase invwinfixheight invwiv invwrap invwrite invwritebackup invxtermcodes
|
||||
syn keyword vimOption contained invakm invanti invarab invari invautochdir invautoshelldir invaw invballooneval invbevalterm invbk invbreakindent invcf invcindent invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invemo inveol invesckeys invexpandtab invfic invfixeol invfoldenable invgd invhid invhkmap invhls invicon invimc invimdisable invinfercase invjoinspaces invlangremap invlinebreak invlnr invlrm invmacatsui invml invmodeline invmodified
|
||||
|
||||
" termcap codes (which can also be set) {{{2
|
||||
syn keyword vimOption contained t_8b t_8u t_AF t_AL t_bc t_BE t_ce t_cl t_Co t_Cs t_CV t_db t_DL t_EI t_F2 t_F4 t_F6 t_F8 t_fd t_fs t_IE t_k1 t_k2 t_K3 t_K4 t_K5 t_K6 t_K7 t_K8 t_K9 t_kb t_KB t_kd t_KD t_KE t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_PE t_PS t_RB t_RC t_RF t_Ri t_RI t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_Si t_SI t_so t_sr t_SR t_ST t_te t_Te t_TE t_ti t_TI t_ts t_Ts t_u7 t_ue t_us t_ut t_vb t_ve t_vi t_vs t_VS t_WP t_WS t_xn t_xs t_ZH t_ZR
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
" 20190923 - Fix xmlEndTag to match xmlTag (vim/vim#884)
|
||||
" 20190924 - Fix xmlAttribute property (amadeus/vim-xml@d8ce1c946)
|
||||
" 20191103 - Enable spell checking globally
|
||||
" 20210428 - Improve syntax synchronizing
|
||||
|
||||
" CONFIGURATION:
|
||||
" syntax folding can be turned on by
|
||||
@@ -302,9 +303,12 @@ unlet b:current_syntax
|
||||
|
||||
|
||||
" synchronizing
|
||||
" TODO !!! to be improved !!!
|
||||
|
||||
syn sync match xmlSyncDT grouphere xmlDocType +\_.\(<!DOCTYPE\)\@=+
|
||||
syn sync match xmlSyncComment grouphere xmlComment +<!--+
|
||||
syn sync match xmlSyncComment groupthere NONE +-->+
|
||||
|
||||
" The following is slow on large documents (and the doctype is optional
|
||||
" syn sync match xmlSyncDT grouphere xmlDocType +\_.\(<!DOCTYPE\)\@=+
|
||||
" syn sync match xmlSyncDT groupthere NONE +]>+
|
||||
|
||||
if exists('g:xml_syntax_folding')
|
||||
@@ -313,7 +317,7 @@ if exists('g:xml_syntax_folding')
|
||||
syn sync match xmlSync groupthere xmlRegion +</[^ /!?<>"']\+>+
|
||||
endif
|
||||
|
||||
syn sync minlines=100
|
||||
syn sync minlines=100 maxlines=200
|
||||
|
||||
|
||||
" The default highlighting.
|
||||
@@ -354,4 +358,4 @@ let b:current_syntax = "xml"
|
||||
let &cpo = s:xml_cpo_save
|
||||
unlet s:xml_cpo_save
|
||||
|
||||
" vim: ts=8
|
||||
" vim: ts=4
|
||||
|
||||
@@ -41,11 +41,12 @@ if get(g:, 'zsh_fold_enable', 0)
|
||||
setlocal foldmethod=syntax
|
||||
endif
|
||||
|
||||
syn match zshQuoted '\\.'
|
||||
syn match zshPOSIXQuoted '\\[xX][0-9a-fA-F]\{1,2}'
|
||||
syn match zshPOSIXQuoted '\\[0-7]\{1,3}'
|
||||
syn match zshPOSIXQuoted '\\u[0-9a-fA-F]\{1,4}'
|
||||
syn match zshPOSIXQuoted '\\U[1-9a-fA-F]\{1,8}'
|
||||
syn match zshQuoted '\\.'
|
||||
|
||||
syn region zshString matchgroup=zshStringDelimiter start=+"+ end=+"+
|
||||
\ contains=zshQuoted,@zshDerefs,@zshSubst fold
|
||||
syn region zshString matchgroup=zshStringDelimiter start=+'+ end=+'+ fold
|
||||
@@ -133,217 +134,15 @@ syn keyword zshCommands alias autoload bg bindkey break bye cap cd
|
||||
\ zmodload zparseopts zprof zpty zrecompile
|
||||
\ zregexparse zsocket zstyle ztcp
|
||||
|
||||
" Options, generated by: echo ${(j:\n:)options[(I)*]} | sort
|
||||
" Create a list of option names from zsh source dir:
|
||||
" #!/bin/zsh
|
||||
" topdir=/path/to/zsh-xxx
|
||||
" grep '^pindex([A-Za-z_]*)$' $topdir/Doc/Zsh/options.yo |
|
||||
" while read opt
|
||||
" do
|
||||
" echo ${${(L)opt#pindex\(}%\)}
|
||||
" done
|
||||
|
||||
" Options, generated by from the zsh source with the make-options.zsh script.
|
||||
syn case ignore
|
||||
|
||||
syn match zshOptStart /^\s*\%(\%(\%(un\)\?setopt\)\|set\s+[-+]o\)/ nextgroup=zshOption skipwhite
|
||||
syn match zshOption /
|
||||
\ \%(\%(\<no_\?\)\?aliases\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?aliasfuncdef\>\)\|\%(\%(no_\?\)\?alias_func_def\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?allexport\>\)\|\%(\%(no_\?\)\?all_export\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?alwayslastprompt\>\)\|\%(\%(no_\?\)\?always_last_prompt\>\)\|\%(\%(no_\?\)\?always_lastprompt\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?alwaystoend\>\)\|\%(\%(no_\?\)\?always_to_end\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?appendcreate\>\)\|\%(\%(no_\?\)\?append_create\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?appendhistory\>\)\|\%(\%(no_\?\)\?append_history\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?autocd\>\)\|\%(\%(no_\?\)\?auto_cd\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?autocontinue\>\)\|\%(\%(no_\?\)\?auto_continue\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?autolist\>\)\|\%(\%(no_\?\)\?auto_list\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?automenu\>\)\|\%(\%(no_\?\)\?auto_menu\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?autonamedirs\>\)\|\%(\%(no_\?\)\?auto_name_dirs\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?autoparamkeys\>\)\|\%(\%(no_\?\)\?auto_param_keys\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?autoparamslash\>\)\|\%(\%(no_\?\)\?auto_param_slash\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?autopushd\>\)\|\%(\%(no_\?\)\?auto_pushd\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?autoremoveslash\>\)\|\%(\%(no_\?\)\?auto_remove_slash\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?autoresume\>\)\|\%(\%(no_\?\)\?auto_resume\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?badpattern\>\)\|\%(\%(no_\?\)\?bad_pattern\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?banghist\>\)\|\%(\%(no_\?\)\?bang_hist\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?bareglobqual\>\)\|\%(\%(no_\?\)\?bare_glob_qual\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?bashautolist\>\)\|\%(\%(no_\?\)\?bash_auto_list\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?bashrematch\>\)\|\%(\%(no_\?\)\?bash_rematch\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?beep\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?bgnice\>\)\|\%(\%(no_\?\)\?bg_nice\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?braceccl\>\)\|\%(\%(no_\?\)\?brace_ccl\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?braceexpand\>\)\|\%(\%(no_\?\)\?brace_expand\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?bsdecho\>\)\|\%(\%(no_\?\)\?bsd_echo\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?caseglob\>\)\|\%(\%(no_\?\)\?case_glob\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?casematch\>\)\|\%(\%(no_\?\)\?case_match\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?cbases\>\)\|\%(\%(no_\?\)\?c_bases\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?cdablevars\>\)\|\%(\%(no_\?\)\?cdable_vars\>\)\|\%(\%(no_\?\)\?cd_able_vars\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?cdsilent\>\)\|\%(\%(no_\?\)\?cd_silent\>\)\|\%(\%(no_\?\)\?cd_silent\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?chasedots\>\)\|\%(\%(no_\?\)\?chase_dots\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?chaselinks\>\)\|\%(\%(no_\?\)\?chase_links\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?checkjobs\>\)\|\%(\%(no_\?\)\?check_jobs\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?checkrunningjobs\>\)\|\%(\%(no_\?\)\?check_running_jobs\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?clobber\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?clobberempty\>\)\|\%(\%(no_\?\)\?clobber_empty\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?combiningchars\>\)\|\%(\%(no_\?\)\?combining_chars\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?completealiases\>\)\|\%(\%(no_\?\)\?complete_aliases\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?completeinword\>\)\|\%(\%(no_\?\)\?complete_in_word\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?continueonerror\>\)\|\%(\%(no_\?\)\?continue_on_error\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?correct\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?correctall\>\)\|\%(\%(no_\?\)\?correct_all\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?cprecedences\>\)\|\%(\%(no_\?\)\?c_precedences\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?cshjunkiehistory\>\)\|\%(\%(no_\?\)\?csh_junkie_history\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?cshjunkieloops\>\)\|\%(\%(no_\?\)\?csh_junkie_loops\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?cshjunkiequotes\>\)\|\%(\%(no_\?\)\?csh_junkie_quotes\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?csh_nullcmd\>\)\|\%(\%(no_\?\)\?csh_null_cmd\>\)\|\%(\%(no_\?\)\?cshnullcmd\>\)\|\%(\%(no_\?\)\?csh_null_cmd\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?cshnullglob\>\)\|\%(\%(no_\?\)\?csh_null_glob\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?debugbeforecmd\>\)\|\%(\%(no_\?\)\?debug_before_cmd\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?dotglob\>\)\|\%(\%(no_\?\)\?dot_glob\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?dvorak\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?emacs\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?equals\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?errexit\>\)\|\%(\%(no_\?\)\?err_exit\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?errreturn\>\)\|\%(\%(no_\?\)\?err_return\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?evallineno\>\)\|\%(\%(no_\?\)\?eval_lineno\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?exec\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?extendedglob\>\)\|\%(\%(no_\?\)\?extended_glob\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?extendedhistory\>\)\|\%(\%(no_\?\)\?extended_history\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?flowcontrol\>\)\|\%(\%(no_\?\)\?flow_control\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?forcefloat\>\)\|\%(\%(no_\?\)\?force_float\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?functionargzero\>\)\|\%(\%(no_\?\)\?function_argzero\>\)\|\%(\%(no_\?\)\?function_arg_zero\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?glob\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?globalexport\>\)\|\%(\%(no_\?\)\?global_export\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?globalrcs\>\)\|\%(\%(no_\?\)\?global_rcs\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?globassign\>\)\|\%(\%(no_\?\)\?glob_assign\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?globcomplete\>\)\|\%(\%(no_\?\)\?glob_complete\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?globdots\>\)\|\%(\%(no_\?\)\?glob_dots\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?glob_subst\>\)\|\%(\%(no_\?\)\?globsubst\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?globstarshort\>\)\|\%(\%(no_\?\)\?glob_star_short\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?hashall\>\)\|\%(\%(no_\?\)\?hash_all\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?hashcmds\>\)\|\%(\%(no_\?\)\?hash_cmds\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?hashdirs\>\)\|\%(\%(no_\?\)\?hash_dirs\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?hashexecutablesonly\>\)\|\%(\%(no_\?\)\?hash_executables_only\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?hashlistall\>\)\|\%(\%(no_\?\)\?hash_list_all\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?histallowclobber\>\)\|\%(\%(no_\?\)\?hist_allow_clobber\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?histappend\>\)\|\%(\%(no_\?\)\?hist_append\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?histbeep\>\)\|\%(\%(no_\?\)\?hist_beep\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?hist_expand\>\)\|\%(\%(no_\?\)\?histexpand\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?hist_expire_dups_first\>\)\|\%(\%(no_\?\)\?histexpiredupsfirst\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?histfcntllock\>\)\|\%(\%(no_\?\)\?hist_fcntl_lock\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?histfindnodups\>\)\|\%(\%(no_\?\)\?hist_find_no_dups\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?histignorealldups\>\)\|\%(\%(no_\?\)\?hist_ignore_all_dups\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?histignoredups\>\)\|\%(\%(no_\?\)\?hist_ignore_dups\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?histignorespace\>\)\|\%(\%(no_\?\)\?hist_ignore_space\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?histlexwords\>\)\|\%(\%(no_\?\)\?hist_lex_words\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?histnofunctions\>\)\|\%(\%(no_\?\)\?hist_no_functions\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?histnostore\>\)\|\%(\%(no_\?\)\?hist_no_store\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?histreduceblanks\>\)\|\%(\%(no_\?\)\?hist_reduce_blanks\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?histsavebycopy\>\)\|\%(\%(no_\?\)\?hist_save_by_copy\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?histsavenodups\>\)\|\%(\%(no_\?\)\?hist_save_no_dups\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?histsubstpattern\>\)\|\%(\%(no_\?\)\?hist_subst_pattern\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?histverify\>\)\|\%(\%(no_\?\)\?hist_verify\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?hup\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?ignorebraces\>\)\|\%(\%(no_\?\)\?ignore_braces\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?ignoreclosebraces\>\)\|\%(\%(no_\?\)\?ignore_close_braces\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?ignoreeof\>\)\|\%(\%(no_\?\)\?ignore_eof\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?incappendhistory\>\)\|\%(\%(no_\?\)\?inc_append_history\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?incappendhistorytime\>\)\|\%(\%(no_\?\)\?inc_append_history_time\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?interactive\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?interactivecomments\>\)\|\%(\%(no_\?\)\?interactive_comments\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?ksharrays\>\)\|\%(\%(no_\?\)\?ksh_arrays\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?kshautoload\>\)\|\%(\%(no_\?\)\?ksh_autoload\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?kshglob\>\)\|\%(\%(no_\?\)\?ksh_glob\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?kshoptionprint\>\)\|\%(\%(no_\?\)\?ksh_option_print\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?kshtypeset\>\)\|\%(\%(no_\?\)\?ksh_typeset\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?kshzerosubscript\>\)\|\%(\%(no_\?\)\?ksh_zero_subscript\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?listambiguous\>\)\|\%(\%(no_\?\)\?list_ambiguous\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?listbeep\>\)\|\%(\%(no_\?\)\?list_beep\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?listpacked\>\)\|\%(\%(no_\?\)\?list_packed\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?listrowsfirst\>\)\|\%(\%(no_\?\)\?list_rows_first\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?listtypes\>\)\|\%(\%(no_\?\)\?list_types\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?localloops\>\)\|\%(\%(no_\?\)\?local_loops\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?localoptions\>\)\|\%(\%(no_\?\)\?local_options\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?localpatterns\>\)\|\%(\%(no_\?\)\?local_patterns\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?localtraps\>\)\|\%(\%(no_\?\)\?local_traps\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?log\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?login\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?longlistjobs\>\)\|\%(\%(no_\?\)\?long_list_jobs\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?magicequalsubst\>\)\|\%(\%(no_\?\)\?magic_equal_subst\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?mark_dirs\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?mailwarn\>\)\|\%(\%(no_\?\)\?mail_warn\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?mailwarning\>\)\|\%(\%(no_\?\)\?mail_warning\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?markdirs\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?menucomplete\>\)\|\%(\%(no_\?\)\?menu_complete\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?monitor\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?multibyte\>\)\|\%(\%(no_\?\)\?multi_byte\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?multifuncdef\>\)\|\%(\%(no_\?\)\?multi_func_def\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?multios\>\)\|\%(\%(no_\?\)\?multi_os\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?nomatch\>\)\|\%(\%(no_\?\)\?no_match\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?notify\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?nullglob\>\)\|\%(\%(no_\?\)\?null_glob\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?numericglobsort\>\)\|\%(\%(no_\?\)\?numeric_glob_sort\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?octalzeroes\>\)\|\%(\%(no_\?\)\?octal_zeroes\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?onecmd\>\)\|\%(\%(no_\?\)\?one_cmd\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?overstrike\>\)\|\%(\%(no_\?\)\?over_strike\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?pathdirs\>\)\|\%(\%(no_\?\)\?path_dirs\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?pathscript\>\)\|\%(\%(no_\?\)\?path_script\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?physical\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?pipefail\>\)\|\%(\%(no_\?\)\?pipe_fail\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?posixaliases\>\)\|\%(\%(no_\?\)\?posix_aliases\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?posixargzero\>\)\|\%(\%(no_\?\)\?posix_arg_zero\>\)\|\%(\%(no_\?\)\?posix_argzero\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?posixbuiltins\>\)\|\%(\%(no_\?\)\?posix_builtins\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?posixcd\>\)\|\%(\%(no_\?\)\?posix_cd\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?posixidentifiers\>\)\|\%(\%(no_\?\)\?posix_identifiers\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?posixjobs\>\)\|\%(\%(no_\?\)\?posix_jobs\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?posixstrings\>\)\|\%(\%(no_\?\)\?posix_strings\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?posixtraps\>\)\|\%(\%(no_\?\)\?posix_traps\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?printeightbit\>\)\|\%(\%(no_\?\)\?print_eight_bit\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?printexitvalue\>\)\|\%(\%(no_\?\)\?print_exit_value\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?privileged\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?promptbang\>\)\|\%(\%(no_\?\)\?prompt_bang\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?promptcr\>\)\|\%(\%(no_\?\)\?prompt_cr\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?promptpercent\>\)\|\%(\%(no_\?\)\?prompt_percent\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?promptsp\>\)\|\%(\%(no_\?\)\?prompt_sp\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?promptsubst\>\)\|\%(\%(no_\?\)\?prompt_subst\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?promptvars\>\)\|\%(\%(no_\?\)\?prompt_vars\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?pushdignoredups\>\)\|\%(\%(no_\?\)\?pushd_ignore_dups\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?pushdminus\>\)\|\%(\%(no_\?\)\?pushd_minus\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?pushdsilent\>\)\|\%(\%(no_\?\)\?pushd_silent\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?pushdtohome\>\)\|\%(\%(no_\?\)\?pushd_to_home\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?rcexpandparam\>\)\|\%(\%(no_\?\)\?rc_expandparam\>\)\|\%(\%(no_\?\)\?rc_expand_param\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?rcquotes\>\)\|\%(\%(no_\?\)\?rc_quotes\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?rcs\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?recexact\>\)\|\%(\%(no_\?\)\?rec_exact\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?rematchpcre\>\)\|\%(\%(no_\?\)\?re_match_pcre\>\)\|\%(\%(no_\?\)\?rematch_pcre\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?restricted\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?rmstarsilent\>\)\|\%(\%(no_\?\)\?rm_star_silent\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?rmstarwait\>\)\|\%(\%(no_\?\)\?rm_star_wait\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?sharehistory\>\)\|\%(\%(no_\?\)\?share_history\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?shfileexpansion\>\)\|\%(\%(no_\?\)\?sh_file_expansion\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?shglob\>\)\|\%(\%(no_\?\)\?sh_glob\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?shinstdin\>\)\|\%(\%(no_\?\)\?shin_stdin\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?shnullcmd\>\)\|\%(\%(no_\?\)\?sh_nullcmd\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?shoptionletters\>\)\|\%(\%(no_\?\)\?sh_option_letters\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?shortloops\>\)\|\%(\%(no_\?\)\?short_loops\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?shortrepeat\>\)\|\%(\%(no_\?\)\?short_repeat\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?shwordsplit\>\)\|\%(\%(no_\?\)\?sh_word_split\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?singlecommand\>\)\|\%(\%(no_\?\)\?single_command\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?singlelinezle\>\)\|\%(\%(no_\?\)\?single_line_zle\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?sourcetrace\>\)\|\%(\%(no_\?\)\?source_trace\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?stdin\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?sunkeyboardhack\>\)\|\%(\%(no_\?\)\?sun_keyboard_hack\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?trackall\>\)\|\%(\%(no_\?\)\?track_all\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?transientrprompt\>\)\|\%(\%(no_\?\)\?transient_rprompt\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?trapsasync\>\)\|\%(\%(no_\?\)\?traps_async\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?typesetsilent\>\)\|\%(\%(no_\?\)\?type_set_silent\>\)\|\%(\%(no_\?\)\?typeset_silent\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?unset\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?verbose\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?vi\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?warnnestedvar\>\)\|\%(\%(no_\?\)\?warn_nested_var\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?warncreateglobal\>\)\|\%(\%(no_\?\)\?warn_create_global\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?xtrace\>\)\|
|
||||
\ \%(\%(\<no_\?\)\?zle\>\)/ nextgroup=zshOption,zshComment skipwhite contained
|
||||
|
||||
syn match zshOptStart
|
||||
\ /\v^\s*%(%(un)?setopt|set\s+[-+]o)/
|
||||
\ nextgroup=zshOption skipwhite
|
||||
syn match zshOption nextgroup=zshOption,zshComment skipwhite contained /\v
|
||||
\ <%(no_?)?%(
|
||||
\ auto_?cd|auto_?pushd|cdable_?vars|cd_?silent|chase_?dots|chase_?links|posix_?cd|pushd_?ignore_?dups|pushd_?minus|pushd_?silent|pushd_?to_?home|always_?last_?prompt|always_?to_?end|auto_?list|auto_?menu|auto_?name_?dirs|auto_?param_?keys|auto_?param_?slash|auto_?remove_?slash|bash_?auto_?list|complete_?aliases|complete_?in_?word|glob_?complete|hash_?list_?all|list_?ambiguous|list_?beep|list_?packed|list_?rows_?first|list_?types|menu_?complete|rec_?exact|bad_?pattern|bare_?glob_?qual|brace_?ccl|case_?glob|case_?match|case_?paths|csh_?null_?glob|equals|extended_?glob|force_?float|glob|glob_?assign|glob_?dots|glob_?star_?short|glob_?subst|hist_?subst_?pattern|ignore_?braces|ignore_?close_?braces|ksh_?glob|magic_?equal_?subst|mark_?dirs|multibyte|nomatch|null_?glob|numeric_?glob_?sort|rc_?expand_?param|rematch_?pcre|sh_?glob|unset|warn_?create_?global|warn_?nested_?var|warnnestedvar|append_?history|bang_?hist|extended_?history|hist_?allow_?clobber|hist_?beep|hist_?expire_?dups_?first|hist_?fcntl_?lock|hist_?find_?no_?dups|hist_?ignore_?all_?dups|hist_?ignore_?dups|hist_?ignore_?space|hist_?lex_?words|hist_?no_?functions|hist_?no_?store|hist_?reduce_?blanks|hist_?save_?by_?copy|hist_?save_?no_?dups|hist_?verify|inc_?append_?history|inc_?append_?history_?time|share_?history|all_?export|global_?export|global_?rcs|rcs|aliases|clobber|clobber_?empty|correct|correct_?all|dvorak|flow_?control|ignore_?eof|interactive_?comments|hash_?cmds|hash_?dirs|hash_?executables_?only|mail_?warning|path_?dirs|path_?script|print_?eight_?bit|print_?exit_?value|rc_?quotes|rm_?star_?silent|rm_?star_?wait|short_?loops|short_?repeat|sun_?keyboard_?hack|auto_?continue|auto_?resume|bg_?nice|check_?jobs|check_?running_?jobs|hup|long_?list_?jobs|monitor|notify|posix_?jobs|prompt_?bang|prompt_?cr|prompt_?sp|prompt_?percent|prompt_?subst|transient_?rprompt|alias_?func_?def|c_?bases|c_?precedences|debug_?before_?cmd|err_?exit|err_?return|eval_?lineno|exec|function_?argzero|local_?loops|local_?options|local_?patterns|local_?traps|multi_?func_?def|multios|octal_?zeroes|pipe_?fail|source_?trace|typeset_?silent|typeset_?to_?unset|verbose|xtrace|append_?create|bash_?rematch|bsd_?echo|continue_?on_?error|csh_?junkie_?history|csh_?junkie_?loops|csh_?junkie_?quotes|csh_?nullcmd|ksh_?arrays|ksh_?autoload|ksh_?option_?print|ksh_?typeset|ksh_?zero_?subscript|posix_?aliases|posix_?argzero|posix_?builtins|posix_?identifiers|posix_?strings|posix_?traps|sh_?file_?expansion|sh_?nullcmd|sh_?option_?letters|sh_?word_?split|traps_?async|interactive|login|privileged|restricted|shin_?stdin|single_?command|beep|combining_?chars|emacs|overstrike|single_?line_?zle|vi|zle|brace_?expand|dot_?glob|hash_?all|hist_?append|hist_?expand|log|mail_?warn|one_?cmd|physical|prompt_?vars|stdin|track_?all|no_?match
|
||||
\)>/
|
||||
syn case match
|
||||
|
||||
syn keyword zshTypes float integer local typeset declare private readonly
|
||||
@@ -365,7 +164,7 @@ syn region zshGlob start='(#' end=')'
|
||||
syn region zshMathSubst matchgroup=zshSubstDelim transparent
|
||||
\ start='\%(\$\?\)[<=>]\@<!((' skip='\\)' end='))'
|
||||
\ contains=zshParentheses,@zshSubst,zshNumber,
|
||||
\ @zshDerefs,zshString keepend fold
|
||||
\ @zshDerefs,zshString fold
|
||||
" The ms=s+1 prevents matching zshBrackets several times on opening brackets
|
||||
" (see https://github.com/chrisbra/vim-zsh/issues/21#issuecomment-576330348)
|
||||
syn region zshBrackets contained transparent start='{'ms=s+1 skip='\\}'
|
||||
|
||||
@@ -776,8 +776,12 @@ STDMETHODIMP CShellExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
|
||||
// development.
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
LPCMINVOKECOMMANDINFOEX lpcmiex = (LPCMINVOKECOMMANDINFOEX)lpcmi;
|
||||
LPCWSTR currentDirectory = lpcmi->cbSize == sizeof(CMINVOKECOMMANDINFOEX) ? lpcmiex->lpDirectoryW : NULL;
|
||||
|
||||
hr = InvokeSingleGvim(lpcmi->hwnd,
|
||||
lpcmi->lpDirectory,
|
||||
currentDirectory,
|
||||
lpcmi->lpVerb,
|
||||
lpcmi->lpParameters,
|
||||
lpcmi->nShow,
|
||||
@@ -884,7 +888,7 @@ searchpath(char *name)
|
||||
|
||||
|
||||
STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent,
|
||||
LPCSTR /* pszWorkingDir */,
|
||||
LPCWSTR workingDir,
|
||||
LPCSTR /* pszCmd */,
|
||||
LPCSTR /* pszParam */,
|
||||
int /* iShowCmd */,
|
||||
@@ -944,7 +948,7 @@ STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent,
|
||||
FALSE, // Set handle inheritance to FALSE.
|
||||
0, // No creation flags.
|
||||
NULL, // Use parent's environment block.
|
||||
NULL, // Use parent's starting directory.
|
||||
workingDir, // Use parent's starting directory.
|
||||
&si, // Pointer to STARTUPINFO structure.
|
||||
&pi) // Pointer to PROCESS_INFORMATION structure.
|
||||
)
|
||||
|
||||
@@ -130,7 +130,7 @@ protected:
|
||||
int idHWnd);
|
||||
|
||||
STDMETHODIMP InvokeSingleGvim(HWND hParent,
|
||||
LPCSTR pszWorkingDir,
|
||||
LPCWSTR workingDir,
|
||||
LPCSTR pszCmd,
|
||||
LPCSTR pszParam,
|
||||
int iShowCmd,
|
||||
|
||||
@@ -180,8 +180,11 @@ SRC += \
|
||||
userfunc.c \
|
||||
version.c \
|
||||
viminfo.c \
|
||||
vim9cmds.c \
|
||||
vim9compile.c \
|
||||
vim9execute.c \
|
||||
vim9expr.c \
|
||||
vim9instr.c \
|
||||
vim9script.c \
|
||||
vim9type.c \
|
||||
window.c \
|
||||
|
||||
@@ -825,8 +825,11 @@ OBJ = \
|
||||
$(OUTDIR)/usercmd.o \
|
||||
$(OUTDIR)/userfunc.o \
|
||||
$(OUTDIR)/version.o \
|
||||
$(OUTDIR)/vim9cmds.o \
|
||||
$(OUTDIR)/vim9compile.o \
|
||||
$(OUTDIR)/vim9execute.o \
|
||||
$(OUTDIR)/vim9expr.o \
|
||||
$(OUTDIR)/vim9instr.o \
|
||||
$(OUTDIR)/vim9script.o \
|
||||
$(OUTDIR)/vim9type.o \
|
||||
$(OUTDIR)/viminfo.o \
|
||||
@@ -1203,10 +1206,16 @@ $(OUTDIR)/netbeans.o: netbeans.c $(INCL) version.h
|
||||
|
||||
$(OUTDIR)/version.o: version.c $(INCL) version.h
|
||||
|
||||
$(OUTDIR)/vim9cmds.o: vim9cmds.c $(INCL) version.h
|
||||
|
||||
$(OUTDIR)/vim9compile.o: vim9compile.c $(INCL) version.h
|
||||
|
||||
$(OUTDIR)/vim9execute.o: vim9execute.c $(INCL) version.h
|
||||
|
||||
$(OUTDIR)/vim9expr.o: vim9expr.c $(INCL) version.h
|
||||
|
||||
$(OUTDIR)/vim9instr.o: vim9instr.c $(INCL) version.h
|
||||
|
||||
$(OUTDIR)/vim9script.o: vim9script.c $(INCL) version.h
|
||||
|
||||
$(OUTDIR)/vim9type.o: vim9type.c $(INCL) version.h
|
||||
|
||||
@@ -147,6 +147,8 @@
|
||||
#
|
||||
# Static Code Analysis: ANALYZE=yes (works with VS2012 or later)
|
||||
#
|
||||
# Address Sanitizer: ASAN=yes (works with VS2019 or later)
|
||||
#
|
||||
# You can combine any of these interfaces
|
||||
#
|
||||
# Example: To build the non-debug, GUI version with Perl interface:
|
||||
@@ -662,6 +664,12 @@ CFLAGS = $(CFLAGS) -DHAVE_STDINT_H
|
||||
CFLAGS = $(CFLAGS) /analyze
|
||||
!endif
|
||||
|
||||
# Address Sanitizer (ASAN) generally available starting with VS2019 version
|
||||
# 16.9
|
||||
!if ("$(ASAN)" == "yes") && ($(MSVC_MAJOR) >= 14)
|
||||
CFLAGS = $(CFLAGS) /fsanitize=address
|
||||
!endif
|
||||
|
||||
!ifdef NODEBUG
|
||||
VIM = vim
|
||||
! if "$(OPTIMIZE)" == "SPACE"
|
||||
@@ -834,8 +842,11 @@ OBJ = \
|
||||
$(OUTDIR)\undo.obj \
|
||||
$(OUTDIR)\usercmd.obj \
|
||||
$(OUTDIR)\userfunc.obj \
|
||||
$(OUTDIR)\vim9cmds.obj \
|
||||
$(OUTDIR)\vim9compile.obj \
|
||||
$(OUTDIR)\vim9execute.obj \
|
||||
$(OUTDIR)\vim9expr.obj \
|
||||
$(OUTDIR)\vim9instr.obj \
|
||||
$(OUTDIR)\vim9script.obj \
|
||||
$(OUTDIR)\vim9type.obj \
|
||||
$(OUTDIR)\viminfo.obj \
|
||||
@@ -1826,10 +1837,16 @@ $(OUTDIR)/userfunc.obj: $(OUTDIR) userfunc.c $(INCL)
|
||||
|
||||
$(OUTDIR)/version.obj: $(OUTDIR) version.c $(INCL) version.h
|
||||
|
||||
$(OUTDIR)/vim9cmds.obj: $(OUTDIR) vim9cmds.c $(INCL)
|
||||
|
||||
$(OUTDIR)/vim9compile.obj: $(OUTDIR) vim9compile.c $(INCL)
|
||||
|
||||
$(OUTDIR)/vim9execute.obj: $(OUTDIR) vim9execute.c $(INCL)
|
||||
|
||||
$(OUTDIR)/vim9expr.obj: $(OUTDIR) vim9expr.c $(INCL)
|
||||
|
||||
$(OUTDIR)/vim9instr.obj: $(OUTDIR) vim9instr.c $(INCL)
|
||||
|
||||
$(OUTDIR)/vim9script.obj: $(OUTDIR) vim9script.c $(INCL)
|
||||
|
||||
$(OUTDIR)/vim9type.obj: $(OUTDIR) vim9type.c $(INCL)
|
||||
@@ -2033,8 +2050,11 @@ proto.h: \
|
||||
proto/undo.pro \
|
||||
proto/usercmd.pro \
|
||||
proto/userfunc.pro \
|
||||
proto/vim9cmds.pro \
|
||||
proto/vim9compile.pro \
|
||||
proto/vim9execute.pro \
|
||||
proto/vim9expr.pro \
|
||||
proto/vim9instr.pro \
|
||||
proto/vim9script.pro \
|
||||
proto/vim9type.pro \
|
||||
proto/viminfo.pro \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Makefile for Vim on OpenVMS
|
||||
#
|
||||
# Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com>
|
||||
# Last change: 2021 Nov 19
|
||||
# Last change: 2021 Dec 20
|
||||
#
|
||||
# This script has been tested on VMS 6.2 to 8.4 on DEC Alpha, VAX and IA64
|
||||
# with MMS and MMK
|
||||
@@ -410,8 +410,11 @@ SRC = \
|
||||
usercmd.c \
|
||||
userfunc.c \
|
||||
version.c \
|
||||
vim9cmds.c \
|
||||
vim9compile.c \
|
||||
vim9execute.c \
|
||||
vim9expr.c \
|
||||
vim9instr.c \
|
||||
vim9script.c \
|
||||
vim9type.c \
|
||||
viminfo.c \
|
||||
@@ -531,8 +534,11 @@ OBJ = \
|
||||
usercmd.obj \
|
||||
userfunc.obj \
|
||||
version.obj \
|
||||
vim9cmds.obj \
|
||||
vim9compile.obj \
|
||||
vim9execute.obj \
|
||||
vim9expr.obj \
|
||||
vim9instr.obj \
|
||||
vim9script.obj \
|
||||
vim9type.obj \
|
||||
viminfo.obj \
|
||||
@@ -1112,6 +1118,10 @@ viminfo.obj : viminfo.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \
|
||||
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
errors.h globals.h version.h
|
||||
vim9cmds.obj : vim9cmds.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \
|
||||
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
errors.h globals.h version.h
|
||||
vim9compile.obj : vim9compile.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \
|
||||
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
@@ -1120,6 +1130,14 @@ vim9execute.obj : vim9execute.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \
|
||||
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
errors.h globals.h version.h
|
||||
vim9expr.obj : vim9expr.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \
|
||||
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
errors.h globals.h version.h
|
||||
vim9instr.obj : vim9instr.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \
|
||||
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
errors.h globals.h version.h
|
||||
vim9script.obj : vim9script.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \
|
||||
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
|
||||
55
src/Makefile
55
src/Makefile
@@ -1491,13 +1491,14 @@ POST_DEFS = $(X_CFLAGS) $(MZSCHEME_CFLAGS) $(EXTRA_DEFS)
|
||||
|
||||
ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(SANITIZER_CFLAGS) $(LEAK_CFLAGS) $(ABORT_CFLAGS) $(POST_DEFS)
|
||||
|
||||
ALL_IF_CFLAGS = $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS)
|
||||
ALL_IF_CFLAGS_EXTRA = $(LUA_CFLAGS_EXTRA) $(PERL_CFLAGS_EXTRA) $(PYTHON_CFLAGS_EXTRA) $(PYTHON3_CFLAGS_EXTRA) $(RUBY_CFLAGS_EXTRA) $(TCL_CFLAGS_EXTRA)
|
||||
|
||||
# Exclude $CFLAGS for osdef.sh, for Mac 10.4 some flags don't work together
|
||||
# with "-E".
|
||||
OSDEF_CFLAGS = $(PRE_DEFS) $(POST_DEFS)
|
||||
|
||||
LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) \
|
||||
$(RUBY_CFLAGS) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) \
|
||||
$(PYTHON3_CFLAGS) $(TCL_CFLAGS) $(VTERM_CFLAGS) \
|
||||
LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) $(ALL_IF_CFLAGS) $(VTERM_CFLAGS) \
|
||||
-Dinline= -D__extension__= -Dalloca=alloca
|
||||
|
||||
LINT_EXTRA = -D"__attribute__(x)="
|
||||
@@ -1695,8 +1696,11 @@ BASIC_SRC = \
|
||||
usercmd.c \
|
||||
userfunc.c \
|
||||
version.c \
|
||||
vim9cmds.c, \
|
||||
vim9compile.c \
|
||||
vim9execute.c \
|
||||
vim9expr.c, \
|
||||
vim9instr.c, \
|
||||
vim9script.c \
|
||||
vim9type.c \
|
||||
viminfo.c \
|
||||
@@ -1848,8 +1852,11 @@ OBJ_COMMON = \
|
||||
objects/usercmd.o \
|
||||
objects/userfunc.o \
|
||||
objects/version.o \
|
||||
objects/vim9cmds.o \
|
||||
objects/vim9compile.o \
|
||||
objects/vim9execute.o \
|
||||
objects/vim9expr.o \
|
||||
objects/vim9instr.o \
|
||||
objects/vim9script.o \
|
||||
objects/vim9type.o \
|
||||
objects/viminfo.o \
|
||||
@@ -2034,8 +2041,11 @@ PRO_AUTO = \
|
||||
usercmd.pro \
|
||||
userfunc.pro \
|
||||
version.pro \
|
||||
vim9cmds.pro \
|
||||
vim9compile.pro \
|
||||
vim9execute.pro \
|
||||
vim9expr.pro \
|
||||
vim9instr.pro \
|
||||
vim9script.pro \
|
||||
vim9type.pro \
|
||||
viminfo.pro \
|
||||
@@ -3348,7 +3358,7 @@ objects/if_xcmdsrv.o: if_xcmdsrv.c
|
||||
$(CCC) -o $@ if_xcmdsrv.c
|
||||
|
||||
objects/if_lua.o: if_lua.c
|
||||
$(CCC_NF) $(LUA_CFLAGS) $(ALL_CFLAGS) -o $@ if_lua.c
|
||||
$(CCC_NF) $(LUA_CFLAGS) $(ALL_CFLAGS) $(LUA_CFLAGS_EXTRA) -o $@ if_lua.c
|
||||
|
||||
objects/if_mzsch.o: if_mzsch.c $(MZSCHEME_EXTRA)
|
||||
$(CCC) -o $@ $(MZSCHEME_CFLAGS_EXTRA) if_mzsch.c
|
||||
@@ -3357,22 +3367,22 @@ mzscheme_base.c:
|
||||
$(MZSCHEME_MZC) --c-mods mzscheme_base.c ++lib scheme/base
|
||||
|
||||
objects/if_perl.o: auto/if_perl.c
|
||||
$(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) -o $@ auto/if_perl.c
|
||||
$(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) $(PERL_CFLAGS_EXTRA) -o $@ auto/if_perl.c
|
||||
|
||||
objects/if_perlsfio.o: if_perlsfio.c
|
||||
$(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) -o $@ if_perlsfio.c
|
||||
$(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) $(PERL_CFLAGS_EXTRA) -o $@ if_perlsfio.c
|
||||
|
||||
objects/if_python.o: if_python.c if_py_both.h
|
||||
$(CCC_NF) $(PYTHON_CFLAGS) $(PYTHON_CFLAGS_EXTRA) $(ALL_CFLAGS) -o $@ if_python.c
|
||||
$(CCC_NF) $(PYTHON_CFLAGS) $(ALL_CFLAGS) $(PYTHON_CFLAGS_EXTRA) -o $@ if_python.c
|
||||
|
||||
objects/if_python3.o: if_python3.c if_py_both.h
|
||||
$(CCC_NF) $(PYTHON3_CFLAGS) $(PYTHON3_CFLAGS_EXTRA) $(ALL_CFLAGS) -o $@ if_python3.c
|
||||
$(CCC_NF) $(PYTHON3_CFLAGS) $(ALL_CFLAGS) $(PYTHON3_CFLAGS_EXTRA) -o $@ if_python3.c
|
||||
|
||||
objects/if_ruby.o: if_ruby.c
|
||||
$(CCC_NF) $(RUBY_CFLAGS) $(ALL_CFLAGS) -o $@ if_ruby.c
|
||||
$(CCC_NF) $(RUBY_CFLAGS) $(ALL_CFLAGS) $(RUBY_CFLAGS_EXTRA) -o $@ if_ruby.c
|
||||
|
||||
objects/if_tcl.o: if_tcl.c
|
||||
$(CCC_NF) $(TCL_CFLAGS) $(ALL_CFLAGS) -o $@ if_tcl.c
|
||||
$(CCC_NF) $(TCL_CFLAGS) $(ALL_CFLAGS) $(TCL_CFLAGS_EXTRA) -o $@ if_tcl.c
|
||||
|
||||
objects/indent.o: indent.c
|
||||
$(CCC) -o $@ indent.c
|
||||
@@ -3450,10 +3460,10 @@ objects/ops.o: ops.c
|
||||
$(CCC) -o $@ ops.c
|
||||
|
||||
objects/option.o: option.c optiondefs.h
|
||||
$(CCC_NF) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS) $(ALL_CFLAGS) -o $@ option.c
|
||||
$(CCC_NF) $(ALL_IF_CFLAGS) $(ALL_CFLAGS) $(ALL_IF_CFLAGS_EXTRA) -o $@ option.c
|
||||
|
||||
objects/optionstr.o: optionstr.c
|
||||
$(CCC_NF) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS) $(ALL_CFLAGS) -o $@ optionstr.c
|
||||
$(CCC_NF) $(ALL_IF_CFLAGS) $(ALL_CFLAGS) $(ALL_IF_CFLAGS_EXTRA) -o $@ optionstr.c
|
||||
|
||||
objects/os_qnx.o: os_qnx.c $(VIM_H_DEPENDENCIES)
|
||||
$(CCC) -o $@ os_qnx.c
|
||||
@@ -3575,12 +3585,21 @@ objects/usercmd.o: usercmd.c
|
||||
objects/userfunc.o: userfunc.c
|
||||
$(CCC) -o $@ userfunc.c
|
||||
|
||||
objects/vim9cmds.o: vim9cmds.c
|
||||
$(CCC) -o $@ vim9cmds.c
|
||||
|
||||
objects/vim9compile.o: vim9compile.c
|
||||
$(CCC) -o $@ vim9compile.c
|
||||
|
||||
objects/vim9execute.o: vim9execute.c
|
||||
$(CCC) -o $@ vim9execute.c
|
||||
|
||||
objects/vim9expr.o: vim9expr.c
|
||||
$(CCC) -o $@ vim9expr.c
|
||||
|
||||
objects/vim9instr.o: vim9instr.c
|
||||
$(CCC) -o $@ vim9instr.c
|
||||
|
||||
objects/vim9script.o: vim9script.c
|
||||
$(CCC) -o $@ vim9script.c
|
||||
|
||||
@@ -4137,6 +4156,10 @@ objects/version.o: version.c vim.h protodef.h auto/config.h feature.h os_unix.h
|
||||
auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
proto.h globals.h errors.h version.h
|
||||
objects/vim9cmds.o: vim9cmds.c vim.h protodef.h auto/config.h feature.h \
|
||||
os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
proto.h globals.h errors.h vim9.h
|
||||
objects/vim9compile.o: vim9compile.c vim.h protodef.h auto/config.h feature.h \
|
||||
os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
@@ -4145,6 +4168,14 @@ objects/vim9execute.o: vim9execute.c vim.h protodef.h auto/config.h feature.h \
|
||||
os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
proto.h globals.h errors.h vim9.h
|
||||
objects/vim9expr.o: vim9expr.c vim.h protodef.h auto/config.h feature.h \
|
||||
os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
proto.h globals.h errors.h vim9.h
|
||||
objects/vim9instr.o: vim9instr.c vim.h protodef.h auto/config.h feature.h \
|
||||
os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
proto.h globals.h errors.h vim9.h
|
||||
objects/vim9script.o: vim9script.c vim.h protodef.h auto/config.h feature.h \
|
||||
os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
|
||||
@@ -224,7 +224,7 @@ lalloc(size_t size, int message)
|
||||
{
|
||||
// Don't hide this message
|
||||
emsg_silent = 0;
|
||||
iemsg(_("E341: Internal error: lalloc(0, )"));
|
||||
iemsg(_(e_internal_error_lalloc_zero));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ lalloc(size_t size, int message)
|
||||
// if some blocks are released call malloc again.
|
||||
for (;;)
|
||||
{
|
||||
// Handle three kind of systems:
|
||||
// Handle three kinds of systems:
|
||||
// 1. No check for available memory: Just return.
|
||||
// 2. Slow check for available memory: call mch_avail_mem() after
|
||||
// allocating KEEP_ROOM amount of memory.
|
||||
@@ -339,7 +339,7 @@ do_outofmem_msg(size_t size)
|
||||
// message fails, e.g. when setting v:errmsg.
|
||||
did_outofmem_msg = TRUE;
|
||||
|
||||
semsg(_("E342: Out of memory! (allocating %lu bytes)"), (long_u)size);
|
||||
semsg(_(e_out_of_memory_allocating_nr_bytes), (long_u)size);
|
||||
|
||||
if (starting == NO_SCREEN)
|
||||
// Not even finished with initializations and already out of
|
||||
|
||||
@@ -460,7 +460,7 @@ do_arglist(
|
||||
vim_regfree(regmatch.regprog);
|
||||
vim_free(p);
|
||||
if (!didone)
|
||||
semsg(_(e_nomatch2), ((char_u **)new_ga.ga_data)[i]);
|
||||
semsg(_(e_no_match_str_2), ((char_u **)new_ga.ga_data)[i]);
|
||||
}
|
||||
ga_clear(&new_ga);
|
||||
}
|
||||
@@ -471,7 +471,7 @@ do_arglist(
|
||||
ga_clear(&new_ga);
|
||||
if (i == FAIL || exp_count == 0)
|
||||
{
|
||||
emsg(_(e_nomatch));
|
||||
emsg(_(e_no_match));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
@@ -673,11 +673,11 @@ do_argfile(exarg_T *eap, int argn)
|
||||
if (argn < 0 || argn >= ARGCOUNT)
|
||||
{
|
||||
if (ARGCOUNT <= 1)
|
||||
emsg(_("E163: There is only one file to edit"));
|
||||
emsg(_(e_there_is_only_one_file_to_edit));
|
||||
else if (argn < 0)
|
||||
emsg(_("E164: Cannot go before first file"));
|
||||
emsg(_(e_cannot_go_before_first_file));
|
||||
else
|
||||
emsg(_("E165: Cannot go beyond last file"));
|
||||
emsg(_(e_cannot_go_beyond_last_file));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -758,6 +758,33 @@ ex_next(exarg_T *eap)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ":argdedupe"
|
||||
*/
|
||||
void
|
||||
ex_argdedupe(exarg_T *eap UNUSED)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
|
||||
for (i = 0; i < ARGCOUNT; ++i)
|
||||
for (j = i + 1; j < ARGCOUNT; ++j)
|
||||
if (fnamecmp(ARGLIST[i].ae_fname, ARGLIST[j].ae_fname) == 0)
|
||||
{
|
||||
vim_free(ARGLIST[j].ae_fname);
|
||||
mch_memmove(ARGLIST + j, ARGLIST + j + 1,
|
||||
(ARGCOUNT - j - 1) * sizeof(aentry_T));
|
||||
--ARGCOUNT;
|
||||
|
||||
if (curwin->w_arg_idx == j)
|
||||
curwin->w_arg_idx = i;
|
||||
else if (curwin->w_arg_idx > j)
|
||||
--curwin->w_arg_idx;
|
||||
|
||||
--j;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ":argedit"
|
||||
*/
|
||||
@@ -812,7 +839,7 @@ ex_argdelete(exarg_T *eap)
|
||||
{
|
||||
if (curwin->w_arg_idx >= ARGCOUNT)
|
||||
{
|
||||
emsg(_("E610: No argument to delete"));
|
||||
emsg(_(e_no_argument_to_delete));
|
||||
return;
|
||||
}
|
||||
eap->line1 = eap->line2 = curwin->w_arg_idx + 1;
|
||||
@@ -823,7 +850,7 @@ ex_argdelete(exarg_T *eap)
|
||||
n = eap->line2 - eap->line1 + 1;
|
||||
if (*eap->arg != NUL)
|
||||
// Can't have both a range and an argument.
|
||||
emsg(_(e_invarg));
|
||||
emsg(_(e_invalid_argument));
|
||||
else if (n <= 0)
|
||||
{
|
||||
// Don't give an error for ":%argdel" if the list is empty.
|
||||
@@ -910,6 +937,7 @@ do_arg_all(
|
||||
tabpage_T *old_curtab, *last_curtab;
|
||||
win_T *new_curwin = NULL;
|
||||
tabpage_T *new_curtab = NULL;
|
||||
int prev_arglist_locked = arglist_locked;
|
||||
|
||||
#ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
@@ -936,6 +964,7 @@ do_arg_all(
|
||||
// watch out for its size to be changed.
|
||||
alist = curwin->w_alist;
|
||||
++alist->al_refcount;
|
||||
arglist_locked = TRUE;
|
||||
|
||||
old_curwin = curwin;
|
||||
old_curtab = curtab;
|
||||
@@ -1100,7 +1129,7 @@ do_arg_all(
|
||||
else if (wpnext->w_frame->fr_parent
|
||||
!= curwin->w_frame->fr_parent)
|
||||
{
|
||||
emsg(_("E249: window layout changed unexpectedly"));
|
||||
emsg(_(e_window_layout_changed_unexpectedly));
|
||||
i = count;
|
||||
break;
|
||||
}
|
||||
@@ -1155,6 +1184,7 @@ do_arg_all(
|
||||
|
||||
// Remove the "lock" on the argument list.
|
||||
alist_unlink(alist);
|
||||
arglist_locked = prev_arglist_locked;
|
||||
|
||||
--autocmd_no_enter;
|
||||
|
||||
|
||||
89
src/auto/configure
vendored
89
src/auto/configure
vendored
@@ -662,12 +662,14 @@ CHANNEL_SRC
|
||||
NETBEANS_OBJ
|
||||
NETBEANS_SRC
|
||||
RUBY_LIBS
|
||||
RUBY_CFLAGS_EXTRA
|
||||
RUBY_CFLAGS
|
||||
RUBY_PRO
|
||||
RUBY_OBJ
|
||||
RUBY_SRC
|
||||
vi_cv_path_ruby
|
||||
TCL_LIBS
|
||||
TCL_CFLAGS_EXTRA
|
||||
TCL_CFLAGS
|
||||
TCL_PRO
|
||||
TCL_OBJ
|
||||
@@ -675,15 +677,18 @@ TCL_SRC
|
||||
vi_cv_path_tcl
|
||||
PYTHON3_OBJ
|
||||
PYTHON3_SRC
|
||||
PYTHON3_CFLAGS_EXTRA
|
||||
PYTHON3_CFLAGS
|
||||
PYTHON3_LIBS
|
||||
vi_cv_path_python3
|
||||
PYTHON_OBJ
|
||||
PYTHON_SRC
|
||||
PYTHON_CFLAGS_EXTRA
|
||||
PYTHON_CFLAGS
|
||||
PYTHON_LIBS
|
||||
vi_cv_path_python
|
||||
PERL_LIBS
|
||||
PERL_CFLAGS_EXTRA
|
||||
PERL_CFLAGS
|
||||
PERL_PRO
|
||||
PERL_OBJ
|
||||
@@ -700,6 +705,7 @@ MZSCHEME_PRO
|
||||
MZSCHEME_OBJ
|
||||
MZSCHEME_SRC
|
||||
vi_cv_path_mzscheme
|
||||
LUA_CFLAGS_EXTRA
|
||||
LUA_CFLAGS
|
||||
LUA_LIBS
|
||||
LUA_PRO
|
||||
@@ -4545,9 +4551,42 @@ fi
|
||||
|
||||
OS_EXTRA_SRC=""; OS_EXTRA_OBJ=""
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uname" >&5
|
||||
$as_echo_n "checking uname... " >&6; }
|
||||
if test "x$vim_cv_uname_output" = "x" ; then
|
||||
vim_cv_uname_output=`(uname) 2>/dev/null`
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_uname_output" >&5
|
||||
$as_echo "$vim_cv_uname_output" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_uname_output (cached)" >&5
|
||||
$as_echo "$vim_cv_uname_output (cached)" >&6; }
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uname -r" >&5
|
||||
$as_echo_n "checking uname -r... " >&6; }
|
||||
if test "x$vim_cv_uname_r_output" = "x" ; then
|
||||
vim_cv_uname_r_output=`(uname -r) 2>/dev/null`
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_uname_r_output" >&5
|
||||
$as_echo "$vim_cv_uname_r_output" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_uname_r_output (cached)" >&5
|
||||
$as_echo "$vim_cv_uname_r_output (cached)" >&6; }
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uname -m" >&5
|
||||
$as_echo_n "checking uname -m... " >&6; }
|
||||
if test "x$vim_cv_uname_m_output" = "x" ; then
|
||||
vim_cv_uname_m_output=`(uname -m) 2>/dev/null`
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_uname_m_output" >&5
|
||||
$as_echo "$vim_cv_uname_m_output" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_uname_m_output (cached)" >&5
|
||||
$as_echo "$vim_cv_uname_m_output (cached)" >&6; }
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Haiku" >&5
|
||||
$as_echo_n "checking for Haiku... " >&6; }
|
||||
case `uname` in
|
||||
case $vim_cv_uname_output in
|
||||
Haiku) HAIKU=yes; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; };;
|
||||
*) HAIKU=no; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
@@ -4556,7 +4595,7 @@ esac
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for QNX" >&5
|
||||
$as_echo_n "checking for QNX... " >&6; }
|
||||
case `uname` in
|
||||
case $vim_cv_uname_output in
|
||||
QNX) OS_EXTRA_SRC=os_qnx.c; OS_EXTRA_OBJ=objects/os_qnx.o
|
||||
test -z "$with_x" && with_x=no
|
||||
QNX=yes; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
@@ -4567,7 +4606,7 @@ esac
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Darwin (Mac OS X)" >&5
|
||||
$as_echo_n "checking for Darwin (Mac OS X)... " >&6; }
|
||||
if test "`(uname) 2>/dev/null`" = Darwin; then
|
||||
if test "$vim_cv_uname_output" = Darwin; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
MACOS_X=yes
|
||||
@@ -4968,7 +5007,7 @@ esac
|
||||
if test "$cf_cv_ebcdic" = "yes"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for z/OS Unix" >&5
|
||||
$as_echo_n "checking for z/OS Unix... " >&6; }
|
||||
case `uname` in
|
||||
case $vim_cv_uname_output in
|
||||
OS/390) zOSUnix="yes";
|
||||
if test "$CC" = "cc"; then
|
||||
ccm="$_CC_CCMODE"
|
||||
@@ -5613,7 +5652,7 @@ $as_echo "yes" >&6; }
|
||||
fi
|
||||
if test "X$LUA_CFLAGS$LUA_LIBS" != "X" && \
|
||||
test "x$MACOS_X" = "xyes" && test "x$vi_cv_with_luajit" != "xno" && \
|
||||
test "`(uname -m) 2>/dev/null`" = "x86_64"; then
|
||||
test "$vim_cv_uname_m_output" = "x86_64"; then
|
||||
LUA_LIBS="-pagezero_size 10000 -image_base 100000000 $LUA_LIBS"
|
||||
fi
|
||||
fi
|
||||
@@ -5625,6 +5664,7 @@ $as_echo "yes" >&6; }
|
||||
|
||||
|
||||
|
||||
|
||||
fi
|
||||
|
||||
|
||||
@@ -5850,8 +5890,8 @@ $as_echo "not found" >&6; }
|
||||
fi
|
||||
if test "$GCC" = yes; then
|
||||
MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${path}"
|
||||
elif test "`(uname) 2>/dev/null`" = SunOS &&
|
||||
uname -r | grep '^5' >/dev/null; then
|
||||
elif test "$vim_cv_uname_output" = SunOS &&
|
||||
echo $vim_cv_uname_r_output | grep '^5' >/dev/null; then
|
||||
MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${path}"
|
||||
fi
|
||||
fi
|
||||
@@ -6240,6 +6280,7 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-pythoninterp argument" >&5
|
||||
$as_echo_n "checking --enable-pythoninterp argument... " >&6; }
|
||||
# Check whether --enable-pythoninterp was given.
|
||||
@@ -6492,13 +6533,13 @@ $as_echo "$vi_cv_dll_name_python" >&6; }
|
||||
$as_echo_n "checking if -pthread should be used... " >&6; }
|
||||
threadsafe_flag=
|
||||
thread_lib=
|
||||
if test "`(uname) 2>/dev/null`" != Darwin; then
|
||||
if test "$vim_cv_uname_output" != Darwin; then
|
||||
test "$GCC" = yes && threadsafe_flag="-pthread"
|
||||
if test "`(uname) 2>/dev/null`" = FreeBSD; then
|
||||
if test "$vim_cv_uname_output" = FreeBSD; then
|
||||
threadsafe_flag="-D_THREAD_SAFE"
|
||||
thread_lib="-pthread"
|
||||
fi
|
||||
if test "`(uname) 2>/dev/null`" = SunOS; then
|
||||
if test "$vim_cv_uname_output" = SunOS; then
|
||||
threadsafe_flag="-pthreads"
|
||||
fi
|
||||
fi
|
||||
@@ -6590,6 +6631,7 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-python3interp argument" >&5
|
||||
$as_echo_n "checking --enable-python3interp argument... " >&6; }
|
||||
# Check whether --enable-python3interp was given.
|
||||
@@ -6840,13 +6882,13 @@ $as_echo "$vi_cv_dll_name_python3" >&6; }
|
||||
$as_echo_n "checking if -pthread should be used... " >&6; }
|
||||
threadsafe_flag=
|
||||
thread_lib=
|
||||
if test "`(uname) 2>/dev/null`" != Darwin; then
|
||||
if test "$vim_cv_uname_output" != Darwin; then
|
||||
test "$GCC" = yes && threadsafe_flag="-pthread"
|
||||
if test "`(uname) 2>/dev/null`" = FreeBSD; then
|
||||
if test "$vim_cv_uname_output" = FreeBSD; then
|
||||
threadsafe_flag="-D_THREAD_SAFE"
|
||||
thread_lib="-pthread"
|
||||
fi
|
||||
if test "`(uname) 2>/dev/null`" = SunOS; then
|
||||
if test "$vim_cv_uname_output" = SunOS; then
|
||||
threadsafe_flag="-pthreads"
|
||||
fi
|
||||
fi
|
||||
@@ -6936,6 +6978,7 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
if test "$python_ok" = yes && test "$python3_ok" = yes; then
|
||||
$as_echo "#define DYNAMIC_PYTHON 1" >>confdefs.h
|
||||
|
||||
@@ -7470,8 +7513,8 @@ $as_echo_n "checking for Tcl library by myself... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $try/lib$trylib" >&5
|
||||
$as_echo "$try/lib$trylib" >&6; }
|
||||
TCL_LIBS="-L\"$try\" -ltcl$ver -ldl -lm"
|
||||
if test "`(uname) 2>/dev/null`" = SunOS &&
|
||||
uname -r | grep '^5' >/dev/null; then
|
||||
if test "$vim_cv_uname_output" = SunOS &&
|
||||
echo $vim_cv_uname_r_output | grep '^5' >/dev/null; then
|
||||
TCL_LIBS="$TCL_LIBS -R $try"
|
||||
fi
|
||||
break 3
|
||||
@@ -7516,6 +7559,7 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-rubyinterp argument" >&5
|
||||
$as_echo_n "checking --enable-rubyinterp argument... " >&6; }
|
||||
# Check whether --enable-rubyinterp was given.
|
||||
@@ -7679,6 +7723,7 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-cscope argument" >&5
|
||||
$as_echo_n "checking --enable-cscope argument... " >&6; }
|
||||
# Check whether --enable-cscope was given.
|
||||
@@ -8911,8 +8956,8 @@ fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Corrected X libraries to $x_libraries" >&5
|
||||
$as_echo "Corrected X libraries to $x_libraries" >&6; }
|
||||
X_LIBS="$X_LIBS -L$x_libraries"
|
||||
if test "`(uname) 2>/dev/null`" = SunOS &&
|
||||
uname -r | grep '^5' >/dev/null; then
|
||||
if test "$vim_cv_uname_output" = SunOS &&
|
||||
echo $vim_cv_uname_r_output | grep '^5' >/dev/null; then
|
||||
X_LIBS="$X_LIBS -R $x_libraries"
|
||||
fi
|
||||
fi
|
||||
@@ -9736,7 +9781,7 @@ $as_echo "yes" >&6; }
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FreeBSD" >&5
|
||||
$as_echo_n "checking for FreeBSD... " >&6; }
|
||||
if test "`(uname) 2>/dev/null`" = FreeBSD; then
|
||||
if test "$vim_cv_uname_output" = FreeBSD; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE"
|
||||
@@ -10220,8 +10265,8 @@ $as_echo "in default path" >&6; }
|
||||
if test -n "$GUI_LIB_LOC"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUI_LIB_LOC" >&5
|
||||
$as_echo "$GUI_LIB_LOC" >&6; }
|
||||
if test "`(uname) 2>/dev/null`" = SunOS &&
|
||||
uname -r | grep '^5' >/dev/null; then
|
||||
if test "$vim_cv_uname_output" = SunOS &&
|
||||
echo $vim_cv_uname_r_output | grep '^5' >/dev/null; then
|
||||
GUI_LIB_LOC="$GUI_LIB_LOC -R $GUI_LIB_LOC"
|
||||
fi
|
||||
fi
|
||||
@@ -10768,7 +10813,7 @@ fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CYGWIN or MSYS environment" >&5
|
||||
$as_echo_n "checking for CYGWIN or MSYS environment... " >&6; }
|
||||
case `uname` in
|
||||
case $vim_cv_uname_output in
|
||||
CYGWIN*|MSYS*) CYGWIN=yes; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CYGWIN clipboard support" >&5
|
||||
@@ -11965,7 +12010,7 @@ rm -f core conftest.err conftest.$ac_objext \
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: empty: automatic terminal library selection" >&5
|
||||
$as_echo "empty: automatic terminal library selection" >&6; }
|
||||
case "`uname -s 2>/dev/null`" in
|
||||
case "$vim_cv_uname_output" in
|
||||
OSF1|SCO_SV) tlibs="tinfo ncurses curses termlib termcap";;
|
||||
*) tlibs="tinfo ncurses termlib termcap curses";;
|
||||
esac
|
||||
|
||||
@@ -515,9 +515,9 @@ au_del_group(char_u *name)
|
||||
|
||||
i = au_find_group(name);
|
||||
if (i == AUGROUP_ERROR) // the group doesn't exist
|
||||
semsg(_("E367: No such group: \"%s\""), name);
|
||||
semsg(_(e_no_such_group_str), name);
|
||||
else if (i == current_augroup)
|
||||
emsg(_("E936: Cannot delete the current group"));
|
||||
emsg(_(e_cannot_delete_current_group));
|
||||
else
|
||||
{
|
||||
event_T event;
|
||||
@@ -580,7 +580,7 @@ do_augroup(char_u *arg, int del_group)
|
||||
if (del_group)
|
||||
{
|
||||
if (*arg == NUL)
|
||||
emsg(_(e_argreq));
|
||||
emsg(_(e_argument_required));
|
||||
else
|
||||
au_del_group(arg);
|
||||
}
|
||||
@@ -687,7 +687,7 @@ find_end_event(
|
||||
{
|
||||
if (arg[1] && !VIM_ISWHITE(arg[1]))
|
||||
{
|
||||
semsg(_("E215: Illegal character after *: %s"), arg);
|
||||
semsg(_(e_illegal_character_after_star_str), arg);
|
||||
return NULL;
|
||||
}
|
||||
pat = arg + 1;
|
||||
@@ -699,9 +699,9 @@ find_end_event(
|
||||
if ((int)event_name2nr(pat, &p) >= NUM_EVENTS)
|
||||
{
|
||||
if (have_group)
|
||||
semsg(_("E216: No such event: %s"), pat);
|
||||
semsg(_(e_no_such_event_str), pat);
|
||||
else
|
||||
semsg(_("E216: No such group or event: %s"), pat);
|
||||
semsg(_(e_no_such_group_or_event_str), pat);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -911,7 +911,7 @@ do_autocmd(exarg_T *eap, char_u *arg_in, int forceit)
|
||||
if (STRNCMP(cmd, "++once", 6) == 0 && VIM_ISWHITE(cmd[6]))
|
||||
{
|
||||
if (once)
|
||||
semsg(_(e_duparg2), "++once");
|
||||
semsg(_(e_duplicate_argument_str), "++once");
|
||||
once = TRUE;
|
||||
cmd = skipwhite(cmd + 6);
|
||||
}
|
||||
@@ -920,7 +920,7 @@ do_autocmd(exarg_T *eap, char_u *arg_in, int forceit)
|
||||
if ((STRNCMP(cmd, "++nested", 8) == 0 && VIM_ISWHITE(cmd[8])))
|
||||
{
|
||||
if (nested)
|
||||
semsg(_(e_duparg2), "++nested");
|
||||
semsg(_(e_duplicate_argument_str), "++nested");
|
||||
nested = TRUE;
|
||||
cmd = skipwhite(cmd + 8);
|
||||
}
|
||||
@@ -929,7 +929,7 @@ do_autocmd(exarg_T *eap, char_u *arg_in, int forceit)
|
||||
if (STRNCMP(cmd, "nested", 6) == 0 && VIM_ISWHITE(cmd[6]))
|
||||
{
|
||||
if (nested)
|
||||
semsg(_(e_duparg2), "nested");
|
||||
semsg(_(e_duplicate_argument_str), "nested");
|
||||
nested = TRUE;
|
||||
cmd = skipwhite(cmd + 6);
|
||||
}
|
||||
@@ -967,7 +967,7 @@ do_autocmd(exarg_T *eap, char_u *arg_in, int forceit)
|
||||
last_group = AUGROUP_ERROR; // for listing the group name
|
||||
if (*arg == '*' || *arg == NUL || *arg == '|')
|
||||
{
|
||||
if (!forceit && *cmd != NUL)
|
||||
if (*cmd != NUL)
|
||||
emsg(_(e_cannot_define_autocommands_for_all_events));
|
||||
else
|
||||
for (event = (event_T)0; (int)event < NUM_EVENTS;
|
||||
@@ -1205,8 +1205,7 @@ do_autocmd_event(
|
||||
if (is_buflocal && (buflocal_nr == 0
|
||||
|| buflist_findnr(buflocal_nr) == NULL))
|
||||
{
|
||||
semsg(_("E680: <buffer=%d>: invalid buffer number "),
|
||||
buflocal_nr);
|
||||
semsg(_(e_buffer_nr_invalid_buffer_number), buflocal_nr);
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
@@ -1329,7 +1328,7 @@ do_doautocmd(
|
||||
|
||||
if (*arg == '*')
|
||||
{
|
||||
emsg(_("E217: Can't execute autocommands for ALL events"));
|
||||
emsg(_(e_cant_execute_autocommands_for_all_events));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
@@ -1613,10 +1612,15 @@ win_found:
|
||||
#endif
|
||||
}
|
||||
#if defined(FEAT_GUI)
|
||||
// Hide the scrollbars from the aucmd_win and update.
|
||||
gui_mch_enable_scrollbar(&aucmd_win->w_scrollbars[SBAR_LEFT], FALSE);
|
||||
gui_mch_enable_scrollbar(&aucmd_win->w_scrollbars[SBAR_RIGHT], FALSE);
|
||||
gui_may_update_scrollbars();
|
||||
if (gui.in_use)
|
||||
{
|
||||
// Hide the scrollbars from the aucmd_win and update.
|
||||
gui_mch_enable_scrollbar(
|
||||
&aucmd_win->w_scrollbars[SBAR_LEFT], FALSE);
|
||||
gui_mch_enable_scrollbar(
|
||||
&aucmd_win->w_scrollbars[SBAR_RIGHT], FALSE);
|
||||
gui_may_update_scrollbars();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -1891,6 +1895,7 @@ apply_autocmds_group(
|
||||
int did_save_redobuff = FALSE;
|
||||
save_redo_T save_redo;
|
||||
int save_KeyTyped = KeyTyped;
|
||||
int save_did_emsg;
|
||||
ESTACK_CHECK_DECLARATION
|
||||
|
||||
/*
|
||||
@@ -1936,7 +1941,7 @@ apply_autocmds_group(
|
||||
*/
|
||||
if (nesting == 10)
|
||||
{
|
||||
emsg(_("E218: autocommand nesting too deep"));
|
||||
emsg(_(e_autocommand_nesting_too_deep));
|
||||
goto BYPASS_AU;
|
||||
}
|
||||
|
||||
@@ -2171,9 +2176,13 @@ apply_autocmds_group(
|
||||
// make sure cursor and topline are valid
|
||||
check_lnums(TRUE);
|
||||
|
||||
save_did_emsg = did_emsg;
|
||||
|
||||
do_cmdline(NULL, getnextac, (void *)&patcmd,
|
||||
DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT);
|
||||
|
||||
did_emsg += save_did_emsg;
|
||||
|
||||
if (nesting == 1)
|
||||
// restore cursor and topline, unless they were changed
|
||||
reset_lnums();
|
||||
|
||||
345
src/blob.c
345
src/blob.c
@@ -240,6 +240,7 @@ blob2string(blob_T *blob, char_u **tofree, char_u *numbuf)
|
||||
vim_snprintf((char *)numbuf, NUMBUFLEN, "%02X", (int)blob_get(blob, i));
|
||||
ga_concat(&ga, numbuf);
|
||||
}
|
||||
ga_append(&ga, NUL); // append a NUL at the end
|
||||
*tofree = ga.ga_data;
|
||||
return *tofree;
|
||||
}
|
||||
@@ -349,7 +350,7 @@ blob_slice_or_index(
|
||||
}
|
||||
else
|
||||
{
|
||||
semsg(_(e_blobidx), n1);
|
||||
semsg(_(e_blob_index_out_of_range_nr), n1);
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
@@ -365,7 +366,7 @@ check_blob_index(long bloblen, varnumber_T n1, int quiet)
|
||||
if (n1 < 0 || n1 > bloblen)
|
||||
{
|
||||
if (!quiet)
|
||||
semsg(_(e_blobidx), n1);
|
||||
semsg(_(e_blob_index_out_of_range_nr), n1);
|
||||
return FAIL;
|
||||
}
|
||||
return OK;
|
||||
@@ -380,7 +381,7 @@ check_blob_range(long bloblen, varnumber_T n1, varnumber_T n2, int quiet)
|
||||
if (n2 < 0 || n2 >= bloblen || n2 < n1)
|
||||
{
|
||||
if (!quiet)
|
||||
semsg(_(e_blobidx), n2);
|
||||
semsg(_(e_blob_index_out_of_range_nr), n2);
|
||||
return FAIL;
|
||||
}
|
||||
return OK;
|
||||
@@ -398,7 +399,7 @@ blob_set_range(blob_T *dest, long n1, long n2, typval_T *src)
|
||||
|
||||
if (n2 - n1 + 1 != blob_len(src->vval.v_blob))
|
||||
{
|
||||
emsg(_("E972: Blob value does not have the right number of bytes"));
|
||||
emsg(_(e_blob_value_does_not_have_right_number_of_bytes));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
@@ -409,78 +410,306 @@ blob_set_range(blob_T *dest, long n1, long n2, typval_T *src)
|
||||
}
|
||||
|
||||
/*
|
||||
* "remove({blob})" function
|
||||
* "add(blob, item)" function
|
||||
*/
|
||||
void
|
||||
blob_add(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
blob_T *b = argvars[0].vval.v_blob;
|
||||
int error = FALSE;
|
||||
varnumber_T n;
|
||||
|
||||
if (b == NULL)
|
||||
{
|
||||
if (in_vim9script())
|
||||
emsg(_(e_cannot_add_to_null_blob));
|
||||
return;
|
||||
}
|
||||
|
||||
if (value_check_lock(b->bv_lock, (char_u *)N_("add() argument"), TRUE))
|
||||
return;
|
||||
|
||||
n = tv_get_number_chk(&argvars[1], &error);
|
||||
if (error)
|
||||
return;
|
||||
|
||||
ga_append(&b->bv_ga, (int)n);
|
||||
copy_tv(&argvars[0], rettv);
|
||||
}
|
||||
|
||||
/*
|
||||
* "remove({blob}, {idx} [, {end}])" function
|
||||
*/
|
||||
void
|
||||
blob_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg)
|
||||
{
|
||||
blob_T *b = argvars[0].vval.v_blob;
|
||||
blob_T *newblob;
|
||||
int error = FALSE;
|
||||
long idx;
|
||||
long end;
|
||||
int len;
|
||||
char_u *p;
|
||||
|
||||
if (b != NULL && value_check_lock(b->bv_lock, arg_errmsg, TRUE))
|
||||
return;
|
||||
|
||||
idx = (long)tv_get_number_chk(&argvars[1], &error);
|
||||
if (!error)
|
||||
{
|
||||
int len = blob_len(b);
|
||||
char_u *p;
|
||||
if (error)
|
||||
return;
|
||||
|
||||
if (idx < 0)
|
||||
// count from the end
|
||||
idx = len + idx;
|
||||
if (idx < 0 || idx >= len)
|
||||
len = blob_len(b);
|
||||
|
||||
if (idx < 0)
|
||||
// count from the end
|
||||
idx = len + idx;
|
||||
if (idx < 0 || idx >= len)
|
||||
{
|
||||
semsg(_(e_blob_index_out_of_range_nr), idx);
|
||||
return;
|
||||
}
|
||||
if (argvars[2].v_type == VAR_UNKNOWN)
|
||||
{
|
||||
// Remove one item, return its value.
|
||||
p = (char_u *)b->bv_ga.ga_data;
|
||||
rettv->vval.v_number = (varnumber_T) *(p + idx);
|
||||
mch_memmove(p + idx, p + idx + 1, (size_t)len - idx - 1);
|
||||
--b->bv_ga.ga_len;
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove range of items, return blob with values.
|
||||
end = (long)tv_get_number_chk(&argvars[2], &error);
|
||||
if (error)
|
||||
return;
|
||||
if (end < 0)
|
||||
// count from the end
|
||||
end = len + end;
|
||||
if (end >= len || idx > end)
|
||||
{
|
||||
semsg(_(e_blob_index_out_of_range_nr), end);
|
||||
return;
|
||||
}
|
||||
newblob = blob_alloc();
|
||||
if (newblob == NULL)
|
||||
return;
|
||||
newblob->bv_ga.ga_len = end - idx + 1;
|
||||
if (ga_grow(&newblob->bv_ga, end - idx + 1) == FAIL)
|
||||
{
|
||||
vim_free(newblob);
|
||||
return;
|
||||
}
|
||||
p = (char_u *)b->bv_ga.ga_data;
|
||||
mch_memmove((char_u *)newblob->bv_ga.ga_data, p + idx,
|
||||
(size_t)(end - idx + 1));
|
||||
++newblob->bv_refcount;
|
||||
rettv->v_type = VAR_BLOB;
|
||||
rettv->vval.v_blob = newblob;
|
||||
|
||||
if (len - end - 1 > 0)
|
||||
mch_memmove(p + idx, p + end + 1, (size_t)(len - end - 1));
|
||||
b->bv_ga.ga_len -= end - idx + 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Implementation of map() and filter() for a Blob. Apply "expr" to every
|
||||
* number in Blob "blob_arg" and return the result in "rettv".
|
||||
*/
|
||||
void
|
||||
blob_filter_map(
|
||||
blob_T *blob_arg,
|
||||
filtermap_T filtermap,
|
||||
typval_T *expr,
|
||||
typval_T *rettv)
|
||||
{
|
||||
blob_T *b;
|
||||
int i;
|
||||
typval_T tv;
|
||||
varnumber_T val;
|
||||
blob_T *b_ret;
|
||||
int idx = 0;
|
||||
int rem;
|
||||
|
||||
if (filtermap == FILTERMAP_MAPNEW)
|
||||
{
|
||||
rettv->v_type = VAR_BLOB;
|
||||
rettv->vval.v_blob = NULL;
|
||||
}
|
||||
if ((b = blob_arg) == NULL)
|
||||
return;
|
||||
|
||||
b_ret = b;
|
||||
if (filtermap == FILTERMAP_MAPNEW)
|
||||
{
|
||||
if (blob_copy(b, rettv) == FAIL)
|
||||
return;
|
||||
b_ret = rettv->vval.v_blob;
|
||||
}
|
||||
|
||||
// set_vim_var_nr() doesn't set the type
|
||||
set_vim_var_type(VV_KEY, VAR_NUMBER);
|
||||
|
||||
for (i = 0; i < b->bv_ga.ga_len; i++)
|
||||
{
|
||||
typval_T newtv;
|
||||
|
||||
tv.v_type = VAR_NUMBER;
|
||||
val = blob_get(b, i);
|
||||
tv.vval.v_number = val;
|
||||
set_vim_var_nr(VV_KEY, idx);
|
||||
if (filter_map_one(&tv, expr, filtermap, &newtv, &rem) == FAIL
|
||||
|| did_emsg)
|
||||
break;
|
||||
if (newtv.v_type != VAR_NUMBER && newtv.v_type != VAR_BOOL)
|
||||
{
|
||||
semsg(_(e_blobidx), idx);
|
||||
clear_tv(&newtv);
|
||||
emsg(_(e_invalid_operation_for_blob));
|
||||
break;
|
||||
}
|
||||
if (filtermap != FILTERMAP_FILTER)
|
||||
{
|
||||
if (newtv.vval.v_number != val)
|
||||
blob_set(b_ret, i, newtv.vval.v_number);
|
||||
}
|
||||
else if (rem)
|
||||
{
|
||||
char_u *p = (char_u *)blob_arg->bv_ga.ga_data;
|
||||
|
||||
mch_memmove(p + i, p + i + 1,
|
||||
(size_t)b->bv_ga.ga_len - i - 1);
|
||||
--b->bv_ga.ga_len;
|
||||
--i;
|
||||
}
|
||||
++idx;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* "insert(blob, {item} [, {idx}])" function
|
||||
*/
|
||||
void
|
||||
blob_insert_func(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
blob_T *b = argvars[0].vval.v_blob;
|
||||
long before = 0;
|
||||
int error = FALSE;
|
||||
int val, len;
|
||||
char_u *p;
|
||||
|
||||
if (b == NULL)
|
||||
{
|
||||
if (in_vim9script())
|
||||
emsg(_(e_cannot_add_to_null_blob));
|
||||
return;
|
||||
}
|
||||
|
||||
if (value_check_lock(b->bv_lock, (char_u *)N_("insert() argument"), TRUE))
|
||||
return;
|
||||
|
||||
len = blob_len(b);
|
||||
if (argvars[2].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
before = (long)tv_get_number_chk(&argvars[2], &error);
|
||||
if (error)
|
||||
return; // type error; errmsg already given
|
||||
if (before < 0 || before > len)
|
||||
{
|
||||
semsg(_(e_invalid_argument_str), tv_get_string(&argvars[2]));
|
||||
return;
|
||||
}
|
||||
if (argvars[2].v_type == VAR_UNKNOWN)
|
||||
{
|
||||
// Remove one item, return its value.
|
||||
p = (char_u *)b->bv_ga.ga_data;
|
||||
rettv->vval.v_number = (varnumber_T) *(p + idx);
|
||||
mch_memmove(p + idx, p + idx + 1, (size_t)len - idx - 1);
|
||||
--b->bv_ga.ga_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
blob_T *blob;
|
||||
|
||||
// Remove range of items, return blob with values.
|
||||
end = (long)tv_get_number_chk(&argvars[2], &error);
|
||||
if (error)
|
||||
return;
|
||||
if (end < 0)
|
||||
// count from the end
|
||||
end = len + end;
|
||||
if (end >= len || idx > end)
|
||||
{
|
||||
semsg(_(e_blobidx), end);
|
||||
return;
|
||||
}
|
||||
blob = blob_alloc();
|
||||
if (blob == NULL)
|
||||
return;
|
||||
blob->bv_ga.ga_len = end - idx + 1;
|
||||
if (ga_grow(&blob->bv_ga, end - idx + 1) == FAIL)
|
||||
{
|
||||
vim_free(blob);
|
||||
return;
|
||||
}
|
||||
p = (char_u *)b->bv_ga.ga_data;
|
||||
mch_memmove((char_u *)blob->bv_ga.ga_data, p + idx,
|
||||
(size_t)(end - idx + 1));
|
||||
++blob->bv_refcount;
|
||||
rettv->v_type = VAR_BLOB;
|
||||
rettv->vval.v_blob = blob;
|
||||
|
||||
if (len - end - 1 > 0)
|
||||
mch_memmove(p + idx, p + end + 1, (size_t)(len - end - 1));
|
||||
b->bv_ga.ga_len -= end - idx + 1;
|
||||
}
|
||||
}
|
||||
val = tv_get_number_chk(&argvars[1], &error);
|
||||
if (error)
|
||||
return;
|
||||
if (val < 0 || val > 255)
|
||||
{
|
||||
semsg(_(e_invalid_argument_str), tv_get_string(&argvars[1]));
|
||||
return;
|
||||
}
|
||||
|
||||
if (ga_grow(&b->bv_ga, 1) == FAIL)
|
||||
return;
|
||||
p = (char_u *)b->bv_ga.ga_data;
|
||||
mch_memmove(p + before + 1, p + before, (size_t)len - before);
|
||||
*(p + before) = val;
|
||||
++b->bv_ga.ga_len;
|
||||
|
||||
copy_tv(&argvars[0], rettv);
|
||||
}
|
||||
|
||||
/*
|
||||
* reduce() Blob argvars[0] using the function 'funcname' with arguments in
|
||||
* 'funcexe' starting with the initial value argvars[2] and return the result
|
||||
* in 'rettv'.
|
||||
*/
|
||||
void
|
||||
blob_reduce(
|
||||
typval_T *argvars,
|
||||
char_u *func_name,
|
||||
funcexe_T *funcexe,
|
||||
typval_T *rettv)
|
||||
{
|
||||
blob_T *b = argvars[0].vval.v_blob;
|
||||
int called_emsg_start = called_emsg;
|
||||
int r;
|
||||
typval_T initial;
|
||||
typval_T argv[3];
|
||||
int i;
|
||||
|
||||
if (argvars[2].v_type == VAR_UNKNOWN)
|
||||
{
|
||||
if (b == NULL || b->bv_ga.ga_len == 0)
|
||||
{
|
||||
semsg(_(e_reduce_of_an_empty_str_with_no_initial_value), "Blob");
|
||||
return;
|
||||
}
|
||||
initial.v_type = VAR_NUMBER;
|
||||
initial.vval.v_number = blob_get(b, 0);
|
||||
i = 1;
|
||||
}
|
||||
else if (argvars[2].v_type != VAR_NUMBER)
|
||||
{
|
||||
emsg(_(e_number_expected));
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
initial = argvars[2];
|
||||
i = 0;
|
||||
}
|
||||
|
||||
copy_tv(&initial, rettv);
|
||||
if (b == NULL)
|
||||
return;
|
||||
|
||||
for ( ; i < b->bv_ga.ga_len; i++)
|
||||
{
|
||||
argv[0] = *rettv;
|
||||
argv[1].v_type = VAR_NUMBER;
|
||||
argv[1].vval.v_number = blob_get(b, i);
|
||||
r = call_func(func_name, -1, rettv, 2, argv, funcexe);
|
||||
clear_tv(&argv[0]);
|
||||
if (r == FAIL || called_emsg != called_emsg_start)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* "reverse({blob})" function
|
||||
*/
|
||||
void
|
||||
blob_reverse(blob_T *b, typval_T *rettv)
|
||||
{
|
||||
int i, len = blob_len(b);
|
||||
|
||||
for (i = 0; i < len / 2; i++)
|
||||
{
|
||||
int tmp = blob_get(b, i);
|
||||
|
||||
blob_set(b, i, blob_get(b, len - i - 1));
|
||||
blob_set(b, len - i - 1, tmp);
|
||||
}
|
||||
rettv_blob_set(rettv, b);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -416,7 +416,7 @@ bf_key_init(
|
||||
keylen = (int)STRLEN(key) / 2;
|
||||
if (keylen == 0)
|
||||
{
|
||||
iemsg(_("E831: bf_key_init() called with empty password"));
|
||||
iemsg(_(e_bf_key_init_called_with_empty_password));
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < keylen; i++)
|
||||
@@ -519,7 +519,7 @@ bf_self_test(void)
|
||||
// warning.
|
||||
if (ui != 0xffffffffUL || ui + 1 != 0) {
|
||||
err++;
|
||||
emsg(_("E820: sizeof(uint32_t) != 4"));
|
||||
emsg(_(e_sizeof_uint32_isnot_four));
|
||||
}
|
||||
|
||||
if (!bf_check_tables(pax_init, sbx_init, 0x6ffa520a))
|
||||
@@ -540,7 +540,7 @@ bf_self_test(void)
|
||||
if (memcmp(bk.uc, bf_test_data[i].cryptxt, 8) != 0)
|
||||
{
|
||||
if (err == 0 && memcmp(bk.uc, bf_test_data[i].badcryptxt, 8) == 0)
|
||||
emsg(_("E817: Blowfish big/little endian use wrong"));
|
||||
emsg(_(e_blowfish_big_little_endian_use_wrong));
|
||||
err++;
|
||||
}
|
||||
}
|
||||
@@ -651,7 +651,7 @@ crypt_blowfish_init(
|
||||
state->method_state = bfs;
|
||||
|
||||
// "blowfish" uses a 64 byte buffer, causing it to repeat 8 byte groups 8
|
||||
// times. "blowfish2" uses a 8 byte buffer to avoid repeating.
|
||||
// times. "blowfish2" uses an 8 byte buffer to avoid repeating.
|
||||
bfs->cfb_len = state->method_nr == CRYPT_M_BF ? BF_MAX_CFB_LEN : BF_BLOCK;
|
||||
|
||||
if (blowfish_self_test() == FAIL)
|
||||
@@ -672,12 +672,12 @@ blowfish_self_test(void)
|
||||
{
|
||||
if (sha256_self_test() == FAIL)
|
||||
{
|
||||
emsg(_("E818: sha256 test failed"));
|
||||
emsg(_(e_sha256_test_failed));
|
||||
return FAIL;
|
||||
}
|
||||
if (bf_self_test() == FAIL)
|
||||
{
|
||||
emsg(_("E819: Blowfish test failed"));
|
||||
emsg(_(e_blowfish_test_failed));
|
||||
return FAIL;
|
||||
}
|
||||
return OK;
|
||||
|
||||
36
src/buffer.c
36
src/buffer.c
@@ -63,7 +63,6 @@ static void clear_wininfo(buf_T *buf);
|
||||
static char *msg_loclist = N_("[Location List]");
|
||||
static char *msg_qflist = N_("[Quickfix List]");
|
||||
#endif
|
||||
static char *e_auabort = N_("E855: Autocommands caused command to abort");
|
||||
|
||||
// Number of times free_buffer() was called.
|
||||
static int buf_free_count = 0;
|
||||
@@ -427,7 +426,7 @@ buf_hashtab_add(buf_T *buf)
|
||||
{
|
||||
sprintf((char *)buf->b_key, "%x", buf->b_fnum);
|
||||
if (hash_add(&buf_hashtab, buf->b_key) == FAIL)
|
||||
emsg(_("E931: Buffer cannot be registered"));
|
||||
emsg(_(e_buffer_cannot_be_registered));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -461,8 +460,7 @@ can_unload_buffer(buf_T *buf)
|
||||
}
|
||||
}
|
||||
if (!can_unload)
|
||||
semsg(_("E937: Attempt to delete a buffer that is in use: %s"),
|
||||
buf->b_fname);
|
||||
semsg(_(e_attempt_to_delete_buffer_that_is_in_use_str), buf->b_fname);
|
||||
return can_unload;
|
||||
}
|
||||
|
||||
@@ -594,7 +592,7 @@ close_buffer(
|
||||
{
|
||||
// Autocommands deleted the buffer.
|
||||
aucmd_abort:
|
||||
emsg(_(e_auabort));
|
||||
emsg(_(e_autocommands_caused_command_to_abort));
|
||||
return FALSE;
|
||||
}
|
||||
--buf->b_locked;
|
||||
@@ -1416,7 +1414,6 @@ do_buffer_ext(
|
||||
bp = NULL; // used when no loaded buffer found
|
||||
if (au_new_curbuf.br_buf != NULL && bufref_valid(&au_new_curbuf))
|
||||
buf = au_new_curbuf.br_buf;
|
||||
#ifdef FEAT_JUMPLIST
|
||||
else if (curwin->w_jumplistlen > 0)
|
||||
{
|
||||
int jumpidx;
|
||||
@@ -1452,7 +1449,6 @@ do_buffer_ext(
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (buf == NULL) // No previous buffer, Try 2'nd approach
|
||||
{
|
||||
@@ -1612,7 +1608,7 @@ do_bufdel(
|
||||
if (addr_count == 2)
|
||||
{
|
||||
if (*arg) // both range and argument is not allowed
|
||||
return ex_errmsg(e_trailing_arg, arg);
|
||||
return ex_errmsg(e_trailing_characters_str, arg);
|
||||
bnr = start_bnr;
|
||||
}
|
||||
else // addr_count == 1
|
||||
@@ -1662,11 +1658,11 @@ do_bufdel(
|
||||
if (deleted == 0)
|
||||
{
|
||||
if (command == DOBUF_UNLOAD)
|
||||
STRCPY(IObuff, _("E515: No buffers were unloaded"));
|
||||
STRCPY(IObuff, _(e_no_buffers_were_unloaded));
|
||||
else if (command == DOBUF_DEL)
|
||||
STRCPY(IObuff, _("E516: No buffers were deleted"));
|
||||
STRCPY(IObuff, _(e_no_buffers_were_deleted));
|
||||
else
|
||||
STRCPY(IObuff, _("E517: No buffers were wiped out"));
|
||||
STRCPY(IObuff, _(e_no_buffers_were_wiped_out));
|
||||
errormsg = (char *)IObuff;
|
||||
}
|
||||
else if (deleted >= p_report)
|
||||
@@ -1825,7 +1821,7 @@ enter_buffer(buf_T *buf)
|
||||
if (curbuf->b_ml.ml_mfp == NULL) // need to load the file
|
||||
{
|
||||
// If there is no filetype, allow for detecting one. Esp. useful for
|
||||
// ":ball" used in a autocommand. If there already is a filetype we
|
||||
// ":ball" used in an autocommand. If there already is a filetype we
|
||||
// might prefer to keep it.
|
||||
if (*curbuf->b_p_ft == NUL)
|
||||
did_filetype = FALSE;
|
||||
@@ -1907,7 +1903,7 @@ no_write_message(void)
|
||||
{
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (term_job_running(curbuf->b_term))
|
||||
emsg(_("E948: Job still running (add ! to end the job)"));
|
||||
emsg(_(e_job_still_running_add_bang_to_end_the_job));
|
||||
else
|
||||
#endif
|
||||
emsg(_(e_no_write_since_last_change_add_bang_to_override));
|
||||
@@ -1918,7 +1914,7 @@ no_write_message_nobang(buf_T *buf UNUSED)
|
||||
{
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (term_job_running(buf->b_term))
|
||||
emsg(_("E948: Job still running"));
|
||||
emsg(_(e_job_still_running));
|
||||
else
|
||||
#endif
|
||||
emsg(_(e_no_write_since_last_change));
|
||||
@@ -2387,7 +2383,7 @@ buflist_getfile(
|
||||
if ((options & GETF_ALT) && n == 0)
|
||||
emsg(_(e_no_alternate_file));
|
||||
else
|
||||
semsg(_("E92: Buffer %d not found"), n);
|
||||
semsg(_(e_buffer_nr_not_found), n);
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
@@ -2671,9 +2667,9 @@ buflist_findpat(
|
||||
}
|
||||
|
||||
if (match == -2)
|
||||
semsg(_("E93: More than one match for %s"), pattern);
|
||||
semsg(_(e_more_than_one_match_for_str), pattern);
|
||||
else if (match < 0)
|
||||
semsg(_("E94: No matching buffer for %s"), pattern);
|
||||
semsg(_(e_no_matching_buffer_for_str), pattern);
|
||||
return match;
|
||||
}
|
||||
|
||||
@@ -3375,7 +3371,7 @@ setfname(
|
||||
if (obuf->b_ml.ml_mfp != NULL || in_use)
|
||||
{
|
||||
if (message)
|
||||
emsg(_("E95: Buffer with this name already exists"));
|
||||
emsg(_(e_buffer_with_this_name_already_exists));
|
||||
vim_free(ffname);
|
||||
return FAIL;
|
||||
}
|
||||
@@ -5033,7 +5029,7 @@ build_stl_str_hl(
|
||||
sp->userhl = 0;
|
||||
}
|
||||
|
||||
// When inside update_screen we do not want redrawing a stausline, ruler,
|
||||
// When inside update_screen we do not want redrawing a statusline, ruler,
|
||||
// title, etc. to trigger another redraw, it may cause an endless loop.
|
||||
if (updating_screen)
|
||||
{
|
||||
@@ -5663,7 +5659,7 @@ bt_dontwrite_msg(buf_T *buf)
|
||||
{
|
||||
if (bt_dontwrite(buf))
|
||||
{
|
||||
emsg(_("E382: Cannot write, 'buftype' option is set"));
|
||||
emsg(_(e_cannot_write_buftype_option_is_set));
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
@@ -667,7 +667,6 @@ buf_write(
|
||||
int prev_got_int = got_int;
|
||||
int checking_conversion;
|
||||
int file_readonly = FALSE; // overwritten file is read-only
|
||||
static char *err_readonly = "is read-only (cannot override: \"W\" in 'cpoptions')";
|
||||
#if defined(UNIX) // XXX fix me sometime?
|
||||
int made_writable = FALSE; // 'w' bit has been set
|
||||
#endif
|
||||
@@ -701,7 +700,7 @@ buf_write(
|
||||
{
|
||||
// This can happen during startup when there is a stray "w" in the
|
||||
// vimrc file.
|
||||
emsg(_(e_emptybuf));
|
||||
emsg(_(e_empty_buffer));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
@@ -897,7 +896,7 @@ buf_write(
|
||||
--no_wait_return;
|
||||
msg_scroll = msg_save;
|
||||
if (nofile_err)
|
||||
emsg(_("E676: No matching autocommands for acwrite buffer"));
|
||||
emsg(_(e_no_matching_autocommands_for_acwrite_buffer));
|
||||
|
||||
if (nofile_err
|
||||
#ifdef FEAT_EVAL
|
||||
@@ -932,7 +931,7 @@ buf_write(
|
||||
#ifdef FEAT_EVAL
|
||||
if (!aborting())
|
||||
#endif
|
||||
emsg(_("E203: Autocommands deleted or unloaded buffer to be written"));
|
||||
emsg(_(e_autocommands_deleted_or_unloaded_buffer_to_be_written));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
@@ -953,7 +952,7 @@ buf_write(
|
||||
{
|
||||
--no_wait_return;
|
||||
msg_scroll = msg_save;
|
||||
emsg(_("E204: Autocommand changed number of lines in unexpected way"));
|
||||
emsg(_(e_autocommands_changed_number_of_lines_in_unexpected_way));
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
@@ -995,7 +994,7 @@ buf_write(
|
||||
else
|
||||
{
|
||||
errnum = (char_u *)"E656: ";
|
||||
errmsg = (char_u *)_("NetBeans disallows writes of unmodified buffers");
|
||||
errmsg = (char_u *)_(e_netbeans_disallows_writes_of_unmodified_buffers);
|
||||
buffer = NULL;
|
||||
goto fail;
|
||||
}
|
||||
@@ -1003,7 +1002,7 @@ buf_write(
|
||||
else
|
||||
{
|
||||
errnum = (char_u *)"E657: ";
|
||||
errmsg = (char_u *)_("Partial writes disallowed for NetBeans buffers");
|
||||
errmsg = (char_u *)_(e_partial_writes_disallowed_for_netbeans_buffers);
|
||||
buffer = NULL;
|
||||
goto fail;
|
||||
}
|
||||
@@ -1050,13 +1049,13 @@ buf_write(
|
||||
if (S_ISDIR(st_old.st_mode))
|
||||
{
|
||||
errnum = (char_u *)"E502: ";
|
||||
errmsg = (char_u *)_("is a directory");
|
||||
errmsg = (char_u *)_(e_is_a_directory);
|
||||
goto fail;
|
||||
}
|
||||
if (mch_nodetype(fname) != NODE_WRITABLE)
|
||||
{
|
||||
errnum = (char_u *)"E503: ";
|
||||
errmsg = (char_u *)_("is not a file or writable device");
|
||||
errmsg = (char_u *)_(e_is_not_file_or_writable_device);
|
||||
goto fail;
|
||||
}
|
||||
// It's a device of some kind (or a fifo) which we can write to
|
||||
@@ -1072,7 +1071,7 @@ buf_write(
|
||||
if (c == NODE_OTHER)
|
||||
{
|
||||
errnum = (char_u *)"E503: ";
|
||||
errmsg = (char_u *)_("is not a file or writable device");
|
||||
errmsg = (char_u *)_(e_is_not_file_or_writable_device);
|
||||
goto fail;
|
||||
}
|
||||
if (c == NODE_WRITABLE)
|
||||
@@ -1083,7 +1082,7 @@ buf_write(
|
||||
if (!p_odev)
|
||||
{
|
||||
errnum = (char_u *)"E796: ";
|
||||
errmsg = (char_u *)_("writing to device disabled with 'opendevice' option");
|
||||
errmsg = (char_u *)_(e_writing_to_device_disabled_with_opendevice_option);
|
||||
goto fail;
|
||||
}
|
||||
# endif
|
||||
@@ -1099,7 +1098,7 @@ buf_write(
|
||||
else if (mch_isdir(fname))
|
||||
{
|
||||
errnum = (char_u *)"E502: ";
|
||||
errmsg = (char_u *)_("is a directory");
|
||||
errmsg = (char_u *)_(e_is_a_directory);
|
||||
goto fail;
|
||||
}
|
||||
if (overwriting)
|
||||
@@ -1118,12 +1117,12 @@ buf_write(
|
||||
if (vim_strchr(p_cpo, CPO_FWRITE) != NULL)
|
||||
{
|
||||
errnum = (char_u *)"E504: ";
|
||||
errmsg = (char_u *)_(err_readonly);
|
||||
errmsg = (char_u *)_(e_is_read_only_cannot_override_W_in_cpoptions);
|
||||
}
|
||||
else
|
||||
{
|
||||
errnum = (char_u *)"E505: ";
|
||||
errmsg = (char_u *)_("is read-only (add ! to override)");
|
||||
errmsg = (char_u *)_(e_is_read_only_add_bang_to_override);
|
||||
}
|
||||
goto fail;
|
||||
}
|
||||
@@ -1477,21 +1476,21 @@ buf_write(
|
||||
{
|
||||
if (buf_write_bytes(&write_info) == FAIL)
|
||||
{
|
||||
errmsg = (char_u *)_("E506: Can't write to backup file (add ! to override)");
|
||||
errmsg = (char_u *)_(e_canot_write_to_backup_file_add_bang_to_override);
|
||||
break;
|
||||
}
|
||||
ui_breakcheck();
|
||||
if (got_int)
|
||||
{
|
||||
errmsg = (char_u *)_(e_interr);
|
||||
errmsg = (char_u *)_(e_interrupted);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (close(bfd) < 0 && errmsg == NULL)
|
||||
errmsg = (char_u *)_("E507: Close error for backup file (add ! to override)");
|
||||
errmsg = (char_u *)_(e_close_error_for_backup_file_add_bang_to_write_anyway);
|
||||
if (write_info.bw_len < 0)
|
||||
errmsg = (char_u *)_("E508: Can't read file for backup (add ! to override)");
|
||||
errmsg = (char_u *)_(e_cant_read_file_for_backup_add_bang_to_write_anyway);
|
||||
#ifdef UNIX
|
||||
set_file_time(backup, st_old.st_atime, st_old.st_mtime);
|
||||
#endif
|
||||
@@ -1513,7 +1512,7 @@ buf_write(
|
||||
vim_free(copybuf);
|
||||
|
||||
if (backup == NULL && errmsg == NULL)
|
||||
errmsg = (char_u *)_("E509: Cannot create backup file (add ! to override)");
|
||||
errmsg = (char_u *)_(e_cannot_create_backup_file_add_bang_to_write_anyway);
|
||||
// ignore errors when forceit is TRUE
|
||||
if ((some_error || errmsg != NULL) && !forceit)
|
||||
{
|
||||
@@ -1536,7 +1535,7 @@ buf_write(
|
||||
if (file_readonly && vim_strchr(p_cpo, CPO_FWRITE) != NULL)
|
||||
{
|
||||
errnum = (char_u *)"E504: ";
|
||||
errmsg = (char_u *)_(err_readonly);
|
||||
errmsg = (char_u *)_(e_is_read_only_cannot_override_W_in_cpoptions);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -1608,7 +1607,7 @@ buf_write(
|
||||
}
|
||||
if (backup == NULL && !forceit)
|
||||
{
|
||||
errmsg = (char_u *)_("E510: Can't make backup file (add ! to override)");
|
||||
errmsg = (char_u *)_(e_cant_make_backup_file_add_bang_to_write_anyway);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
@@ -1650,7 +1649,7 @@ buf_write(
|
||||
ml_preserve(buf, FALSE);
|
||||
if (got_int)
|
||||
{
|
||||
errmsg = (char_u *)_(e_interr);
|
||||
errmsg = (char_u *)_(e_interrupted);
|
||||
goto restore_backup;
|
||||
}
|
||||
}
|
||||
@@ -1746,7 +1745,7 @@ buf_write(
|
||||
wfname = vim_tempname('w', FALSE);
|
||||
if (wfname == NULL) // Can't write without a tempfile!
|
||||
{
|
||||
errmsg = (char_u *)_("E214: Can't find temp file for writing");
|
||||
errmsg = (char_u *)_(e_cant_find_temp_file_for_writing);
|
||||
goto restore_backup;
|
||||
}
|
||||
}
|
||||
@@ -1764,7 +1763,7 @@ buf_write(
|
||||
{
|
||||
if (!forceit)
|
||||
{
|
||||
errmsg = (char_u *)_("E213: Cannot convert (add ! to write without conversion)");
|
||||
errmsg = (char_u *)_(e_cannot_convert_add_bang_to_write_without_conversion);
|
||||
goto restore_backup;
|
||||
}
|
||||
notconverted = TRUE;
|
||||
@@ -1821,11 +1820,12 @@ buf_write(
|
||||
|| (mch_lstat((char *)fname, &st) == 0
|
||||
&& (st.st_dev != st_old.st_dev
|
||||
|| st.st_ino != st_old.st_ino)))
|
||||
errmsg = (char_u *)_("E166: Can't open linked file for writing");
|
||||
errmsg =
|
||||
(char_u *)_(e_cant_open_linked_file_for_writing);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
errmsg = (char_u *)_("E212: Can't open file for writing");
|
||||
errmsg = (char_u *)_(e_cant_open_file_for_writing);
|
||||
if (forceit && vim_strchr(p_cpo, CPO_FWRITE) == NULL
|
||||
&& perm >= 0)
|
||||
{
|
||||
@@ -1902,7 +1902,7 @@ restore_backup:
|
||||
&& st.st_ino != st_old.st_ino)
|
||||
{
|
||||
close(fd);
|
||||
errmsg = (char_u *)_("E949: File changed while writing");
|
||||
errmsg = (char_u *)_(e_file_changed_while_writing);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
@@ -2178,7 +2178,7 @@ restore_backup:
|
||||
// If the 'fsync' option is FALSE, don't fsync(). Useful for laptops.
|
||||
if (p_fs && vim_fsync(fd) != 0 && !device)
|
||||
{
|
||||
errmsg = (char_u *)_(e_fsync);
|
||||
errmsg = (char_u *)_(e_fsync_failed);
|
||||
end = 0;
|
||||
}
|
||||
#endif
|
||||
@@ -2228,7 +2228,7 @@ restore_backup:
|
||||
#endif
|
||||
if (close(fd) != 0)
|
||||
{
|
||||
errmsg = (char_u *)_("E512: Close failed");
|
||||
errmsg = (char_u *)_(e_close_failed);
|
||||
end = 0;
|
||||
}
|
||||
|
||||
@@ -2285,19 +2285,19 @@ restore_backup:
|
||||
if (write_info.bw_conv_error)
|
||||
{
|
||||
if (write_info.bw_conv_error_lnum == 0)
|
||||
errmsg = (char_u *)_("E513: write error, conversion failed (make 'fenc' empty to override)");
|
||||
errmsg = (char_u *)_(e_write_error_conversion_failed_make_fenc_empty_to_override);
|
||||
else
|
||||
{
|
||||
errmsg_allocated = TRUE;
|
||||
errmsg = alloc(300);
|
||||
vim_snprintf((char *)errmsg, 300, _("E513: write error, conversion failed in line %ld (make 'fenc' empty to override)"),
|
||||
vim_snprintf((char *)errmsg, 300, _(e_write_error_conversion_failed_in_line_nr_make_fenc_empty_to_override),
|
||||
(long)write_info.bw_conv_error_lnum);
|
||||
}
|
||||
}
|
||||
else if (got_int)
|
||||
errmsg = (char_u *)_(e_interr);
|
||||
errmsg = (char_u *)_(e_interrupted);
|
||||
else
|
||||
errmsg = (char_u *)_("E514: write error (file system full?)");
|
||||
errmsg = (char_u *)_(e_write_error_file_system_full);
|
||||
}
|
||||
|
||||
// If we have a backup file, try to put it in place of the new file,
|
||||
@@ -2315,7 +2315,7 @@ restore_backup:
|
||||
// know we got the message.
|
||||
if (got_int)
|
||||
{
|
||||
msg(_(e_interr));
|
||||
msg(_(e_interrupted));
|
||||
out_flush();
|
||||
}
|
||||
if ((fd = mch_open((char *)backup, O_RDONLY | O_EXTRA, 0)) >= 0)
|
||||
@@ -2453,7 +2453,7 @@ restore_backup:
|
||||
// If the original file does not exist yet
|
||||
// the current backup file becomes the original file
|
||||
if (org == NULL)
|
||||
emsg(_("E205: Patchmode: can't save original file"));
|
||||
emsg(_(e_patchmode_cant_save_original_file));
|
||||
else if (mch_stat(org, &st) < 0)
|
||||
{
|
||||
vim_rename(backup, (char_u *)org);
|
||||
@@ -2473,7 +2473,7 @@ restore_backup:
|
||||
|| (empty_fd = mch_open(org,
|
||||
O_CREAT | O_EXTRA | O_EXCL | O_NOFOLLOW,
|
||||
perm < 0 ? 0666 : (perm & 0777))) < 0)
|
||||
emsg(_("E206: patchmode: can't touch empty original file"));
|
||||
emsg(_(e_patchmode_cant_touch_empty_original_file));
|
||||
else
|
||||
close(empty_fd);
|
||||
}
|
||||
@@ -2488,7 +2488,7 @@ restore_backup:
|
||||
// conversion error.
|
||||
if (!p_bk && backup != NULL && !write_info.bw_conv_error
|
||||
&& mch_remove(backup) != 0)
|
||||
emsg(_("E207: Can't delete backup file"));
|
||||
emsg(_(e_cant_delete_backup_file));
|
||||
|
||||
goto nofail;
|
||||
|
||||
|
||||
64
src/change.c
64
src/change.c
@@ -469,11 +469,9 @@ changed_common(
|
||||
win_T *wp;
|
||||
tabpage_T *tp;
|
||||
int i;
|
||||
#ifdef FEAT_JUMPLIST
|
||||
int cols;
|
||||
pos_T *p;
|
||||
int add;
|
||||
#endif
|
||||
|
||||
// mark the buffer as modified
|
||||
changed();
|
||||
@@ -492,7 +490,6 @@ changed_common(
|
||||
curbuf->b_last_change.lnum = lnum;
|
||||
curbuf->b_last_change.col = col;
|
||||
|
||||
#ifdef FEAT_JUMPLIST
|
||||
// Create a new entry if a new undo-able change was started or we
|
||||
// don't have an entry yet.
|
||||
if (curbuf->b_new_change || curbuf->b_changelistlen == 0)
|
||||
@@ -552,7 +549,6 @@ changed_common(
|
||||
// The current window is always after the last change, so that "g,"
|
||||
// takes you back to it.
|
||||
curwin->w_changelistidx = curbuf->b_changelistlen;
|
||||
#endif
|
||||
}
|
||||
|
||||
FOR_ALL_TAB_WINDOWS(tp, wp)
|
||||
@@ -1251,7 +1247,7 @@ del_bytes(
|
||||
// If "count" is negative the caller must be doing something wrong.
|
||||
if (count < 1)
|
||||
{
|
||||
siemsg("E292: Invalid count for del_bytes(): %ld", count);
|
||||
siemsg(e_invalid_count_for_del_bytes_nr, count);
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
@@ -1356,6 +1352,8 @@ del_bytes(
|
||||
*
|
||||
* "second_line_indent": indent for after ^^D in Insert mode or if flag
|
||||
* OPENLINE_COM_LIST
|
||||
* "did_do_comment" is set to TRUE when intentionally putting the comment
|
||||
* leader in fromt of the new line.
|
||||
*
|
||||
* Return OK for success, FAIL for failure
|
||||
*/
|
||||
@@ -1363,7 +1361,8 @@ del_bytes(
|
||||
open_line(
|
||||
int dir, // FORWARD or BACKWARD
|
||||
int flags,
|
||||
int second_line_indent)
|
||||
int second_line_indent,
|
||||
int *did_do_comment UNUSED)
|
||||
{
|
||||
char_u *saved_line; // copy of the original line
|
||||
char_u *next_line = NULL; // copy of the next line
|
||||
@@ -1378,12 +1377,16 @@ open_line(
|
||||
int retval = FAIL; // return value
|
||||
int extra_len = 0; // length of p_extra string
|
||||
int lead_len; // length of comment leader
|
||||
int comment_start = 0; // start index of the comment leader
|
||||
char_u *lead_flags; // position in 'comments' for comment leader
|
||||
char_u *leader = NULL; // copy of comment leader
|
||||
char_u *allocated = NULL; // allocated memory
|
||||
char_u *p;
|
||||
int saved_char = NUL; // init for GCC
|
||||
pos_T *pos;
|
||||
#ifdef FEAT_CINDENT
|
||||
int do_cindent;
|
||||
#endif
|
||||
#ifdef FEAT_SMARTINDENT
|
||||
int do_si = (!p_paste && curbuf->b_p_si
|
||||
# ifdef FEAT_CINDENT
|
||||
@@ -1632,12 +1635,44 @@ open_line(
|
||||
did_ai = TRUE;
|
||||
}
|
||||
|
||||
#ifdef FEAT_CINDENT
|
||||
// May do indenting after opening a new line.
|
||||
do_cindent = !p_paste && (curbuf->b_p_cin
|
||||
# ifdef FEAT_EVAL
|
||||
|| *curbuf->b_p_inde != NUL
|
||||
# endif
|
||||
)
|
||||
&& in_cinkeys(dir == FORWARD
|
||||
? KEY_OPEN_FORW
|
||||
: KEY_OPEN_BACK, ' ', linewhite(curwin->w_cursor.lnum));
|
||||
#endif
|
||||
|
||||
// Find out if the current line starts with a comment leader.
|
||||
// This may then be inserted in front of the new line.
|
||||
end_comment_pending = NUL;
|
||||
if (flags & OPENLINE_DO_COM)
|
||||
{
|
||||
lead_len = get_leader_len(saved_line, &lead_flags,
|
||||
dir == BACKWARD, TRUE);
|
||||
#ifdef FEAT_CINDENT
|
||||
if (lead_len == 0 && do_cindent && dir == FORWARD)
|
||||
{
|
||||
// Check for a line comment after code.
|
||||
comment_start = check_linecomment(saved_line);
|
||||
if (comment_start != MAXCOL)
|
||||
{
|
||||
lead_len = get_leader_len(saved_line + comment_start,
|
||||
&lead_flags, FALSE, TRUE);
|
||||
if (lead_len != 0)
|
||||
{
|
||||
lead_len += comment_start;
|
||||
if (did_do_comment != NULL)
|
||||
*did_do_comment = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
lead_len = 0;
|
||||
if (lead_len > 0)
|
||||
@@ -1799,8 +1834,15 @@ open_line(
|
||||
lead_len = 0;
|
||||
else
|
||||
{
|
||||
int li;
|
||||
|
||||
vim_strncpy(leader, saved_line, lead_len);
|
||||
|
||||
// TODO: handle multi-byte and double width chars
|
||||
for (li = 0; li < comment_start; ++li)
|
||||
if (!VIM_ISWHITE(leader[li]))
|
||||
leader[li] = ' ';
|
||||
|
||||
// Replace leader with lead_repl, right or left adjusted
|
||||
if (lead_repl != NULL)
|
||||
{
|
||||
@@ -2247,15 +2289,7 @@ open_line(
|
||||
#endif
|
||||
#ifdef FEAT_CINDENT
|
||||
// May do indenting after opening a new line.
|
||||
if (!p_paste
|
||||
&& (curbuf->b_p_cin
|
||||
# ifdef FEAT_EVAL
|
||||
|| *curbuf->b_p_inde != NUL
|
||||
# endif
|
||||
)
|
||||
&& in_cinkeys(dir == FORWARD
|
||||
? KEY_OPEN_FORW
|
||||
: KEY_OPEN_BACK, ' ', linewhite(curwin->w_cursor.lnum)))
|
||||
if (do_cindent)
|
||||
{
|
||||
do_c_expr_indent();
|
||||
ai_col = (colnr_T)getwhitecols_curline();
|
||||
|
||||
@@ -161,7 +161,7 @@ ch_logfile(char_u *fname, char_u *opt)
|
||||
file = fopen((char *)fname, *opt == 'w' ? "w" : "a");
|
||||
if (file == NULL)
|
||||
{
|
||||
semsg(_(e_notopen), fname);
|
||||
semsg(_(e_cant_open_file_str), fname);
|
||||
return;
|
||||
}
|
||||
vim_free(log_name);
|
||||
@@ -1318,7 +1318,7 @@ channel_open_func(typval_T *argvars)
|
||||
if (argvars[1].v_type != VAR_UNKNOWN
|
||||
&& (argvars[1].v_type != VAR_DICT || argvars[1].vval.v_dict == NULL))
|
||||
{
|
||||
emsg(_(e_invarg));
|
||||
emsg(_(e_invalid_argument));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1330,7 +1330,7 @@ channel_open_func(typval_T *argvars)
|
||||
p = vim_strchr(address + 1, ']');
|
||||
if (p == NULL || *++p != ':')
|
||||
{
|
||||
semsg(_(e_invarg2), address);
|
||||
semsg(_(e_invalid_argument_str), address);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -1339,14 +1339,14 @@ channel_open_func(typval_T *argvars)
|
||||
p = vim_strchr(address, ':');
|
||||
if (p == NULL)
|
||||
{
|
||||
semsg(_(e_invarg2), address);
|
||||
semsg(_(e_invalid_argument_str), address);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
port = strtol((char *)(p + 1), &rest, 10);
|
||||
if (*address == NUL || port <= 0 || port >= 65536 || *rest != NUL)
|
||||
{
|
||||
semsg(_(e_invarg2), address);
|
||||
semsg(_(e_invalid_argument_str), address);
|
||||
return NULL;
|
||||
}
|
||||
if (is_ipv6)
|
||||
@@ -1367,7 +1367,7 @@ channel_open_func(typval_T *argvars)
|
||||
goto theend;
|
||||
if (opt.jo_timeout < 0)
|
||||
{
|
||||
emsg(_(e_invarg));
|
||||
emsg(_(e_invalid_argument));
|
||||
goto theend;
|
||||
}
|
||||
|
||||
@@ -3833,7 +3833,7 @@ get_channel_arg(typval_T *tv, int check_open, int reading, ch_part_T part)
|
||||
}
|
||||
else
|
||||
{
|
||||
semsg(_(e_invarg2), tv_get_string(tv));
|
||||
semsg(_(e_invalid_argument_str), tv_get_string(tv));
|
||||
return NULL;
|
||||
}
|
||||
if (channel != NULL && reading)
|
||||
|
||||
@@ -1240,10 +1240,15 @@ getvcol(
|
||||
posptr = NULL; // continue until the NUL
|
||||
else
|
||||
{
|
||||
// Special check for an empty line, which can happen on exit, when
|
||||
// ml_get_buf() always returns an empty string.
|
||||
if (*ptr == NUL)
|
||||
pos->col = 0;
|
||||
colnr_T i;
|
||||
|
||||
// In a few cases the position can be beyond the end of the line.
|
||||
for (i = 0; i < pos->col; ++i)
|
||||
if (ptr[i] == NUL)
|
||||
{
|
||||
pos->col = i;
|
||||
break;
|
||||
}
|
||||
posptr = ptr + pos->col;
|
||||
if (has_mbyte)
|
||||
// always start on the first byte
|
||||
@@ -1459,14 +1464,27 @@ getvcols(
|
||||
}
|
||||
|
||||
/*
|
||||
* skipwhite: skip over ' ' and '\t'.
|
||||
* Skip over ' ' and '\t'.
|
||||
*/
|
||||
char_u *
|
||||
skipwhite(char_u *q)
|
||||
{
|
||||
char_u *p = q;
|
||||
|
||||
while (VIM_ISWHITE(*p)) // skip to next non-white
|
||||
while (VIM_ISWHITE(*p))
|
||||
++p;
|
||||
return p;
|
||||
}
|
||||
|
||||
/*
|
||||
* skip over ' ', '\t' and '\n'.
|
||||
*/
|
||||
char_u *
|
||||
skipwhite_and_nl(char_u *q)
|
||||
{
|
||||
char_u *p = q;
|
||||
|
||||
while (VIM_ISWHITE(*p) || *p == NL)
|
||||
++p;
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -66,8 +66,6 @@ cin_is_cinword(char_u *line)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_CINDENT) || defined(FEAT_SYN_HL)
|
||||
|
||||
/*
|
||||
* Skip to the end of a "string" and a 'c' character.
|
||||
* If there is no string or character, return argument unmodified.
|
||||
@@ -137,6 +135,21 @@ skip_string(char_u *p)
|
||||
return p;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "line[col]" is inside a C string.
|
||||
*/
|
||||
int
|
||||
is_pos_in_string(char_u *line, colnr_T col)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
for (p = line; *p && (colnr_T)(p - line) < col; ++p)
|
||||
p = skip_string(p);
|
||||
return !((colnr_T)(p - line) <= col);
|
||||
}
|
||||
|
||||
#if defined(FEAT_CINDENT) || defined(FEAT_SYN_HL)
|
||||
|
||||
/*
|
||||
* Find the start of a comment, not knowing if we are in a comment right now.
|
||||
* Search starts at w_cursor.lnum and goes backwards.
|
||||
@@ -152,8 +165,6 @@ ind_find_start_comment(void) // XXX
|
||||
find_start_comment(int ind_maxcomment) // XXX
|
||||
{
|
||||
pos_T *pos;
|
||||
char_u *line;
|
||||
char_u *p;
|
||||
int cur_maxcomment = ind_maxcomment;
|
||||
|
||||
for (;;)
|
||||
@@ -164,10 +175,7 @@ find_start_comment(int ind_maxcomment) // XXX
|
||||
|
||||
// Check if the comment start we found is inside a string.
|
||||
// If it is then restrict the search to below this line and try again.
|
||||
line = ml_get(pos->lnum);
|
||||
for (p = line; *p && (colnr_T)(p - line) < pos->col; ++p)
|
||||
p = skip_string(p);
|
||||
if ((colnr_T)(p - line) <= pos->col)
|
||||
if (!is_pos_in_string(ml_get(pos->lnum), pos->col))
|
||||
break;
|
||||
cur_maxcomment = curwin->w_cursor.lnum - pos->lnum - 1;
|
||||
if (cur_maxcomment <= 0)
|
||||
@@ -188,8 +196,6 @@ find_start_comment(int ind_maxcomment) // XXX
|
||||
find_start_rawstring(int ind_maxcomment) // XXX
|
||||
{
|
||||
pos_T *pos;
|
||||
char_u *line;
|
||||
char_u *p;
|
||||
int cur_maxcomment = ind_maxcomment;
|
||||
|
||||
for (;;)
|
||||
@@ -200,10 +206,7 @@ find_start_rawstring(int ind_maxcomment) // XXX
|
||||
|
||||
// Check if the raw string start we found is inside a string.
|
||||
// If it is then restrict the search to below this line and try again.
|
||||
line = ml_get(pos->lnum);
|
||||
for (p = line; *p && (colnr_T)(p - line) < pos->col; ++p)
|
||||
p = skip_string(p);
|
||||
if ((colnr_T)(p - line) <= pos->col)
|
||||
if (!is_pos_in_string(ml_get(pos->lnum), pos->col))
|
||||
break;
|
||||
cur_maxcomment = curwin->w_cursor.lnum - pos->lnum - 1;
|
||||
if (cur_maxcomment <= 0)
|
||||
@@ -755,6 +758,10 @@ cin_is_cpp_namespace(char_u *s)
|
||||
int has_name_start = FALSE;
|
||||
|
||||
s = cin_skipcomment(s);
|
||||
|
||||
if (STRNCMP(s, "inline", 6) == 0 && (s[6] == NUL || !vim_iswordc(s[6])))
|
||||
s = cin_skipcomment(skipwhite(s + 6));
|
||||
|
||||
if (STRNCMP(s, "namespace", 9) == 0 && (s[9] == NUL || !vim_iswordc(s[9])))
|
||||
{
|
||||
p = cin_skipcomment(skipwhite(s + 9));
|
||||
@@ -1219,7 +1226,7 @@ cin_isfuncdecl(
|
||||
if (*s == ')' && cin_nocode(s + 1))
|
||||
{
|
||||
// ')' at the end: may have found a match
|
||||
// Check for he previous line not to end in a backslash:
|
||||
// Check for the previous line not to end in a backslash:
|
||||
// #if defined(x) && {backslash}
|
||||
// defined(y)
|
||||
lnum = first_lnum - 1;
|
||||
@@ -1788,7 +1795,7 @@ parse_cino(buf_T *buf)
|
||||
buf->b_ind_unclosed2 = sw;
|
||||
|
||||
// Suppress ignoring spaces from the indent of a line starting with an
|
||||
// unclosed parentheses.
|
||||
// unclosed parenthesis.
|
||||
buf->b_ind_unclosed_noignore = 0;
|
||||
|
||||
// If the opening paren is the last nonwhite character on the line, and
|
||||
@@ -1800,11 +1807,11 @@ parse_cino(buf_T *buf)
|
||||
// an unclosed parenthesis.
|
||||
buf->b_ind_unclosed_whiteok = 0;
|
||||
|
||||
// Indent a closing parentheses under the line start of the matching
|
||||
// opening parentheses.
|
||||
// Indent a closing parenthesis under the line start of the matching
|
||||
// opening parenthesis.
|
||||
buf->b_ind_matching_paren = 0;
|
||||
|
||||
// Indent a closing parentheses under the previous line.
|
||||
// Indent a closing parenthesis under the previous line.
|
||||
buf->b_ind_paren_prev = 0;
|
||||
|
||||
// Extra indent for comments.
|
||||
@@ -2144,13 +2151,30 @@ get_c_indent(void)
|
||||
|
||||
// If we're inside a "//" comment and there is a "//" comment in a
|
||||
// previous line, lineup with that one.
|
||||
if (cin_islinecomment(theline)
|
||||
&& (trypos = find_line_comment()) != NULL) // XXX
|
||||
if (cin_islinecomment(theline))
|
||||
{
|
||||
// find how indented the line beginning the comment is
|
||||
getvcol(curwin, trypos, &col, NULL, NULL);
|
||||
amount = col;
|
||||
goto theend;
|
||||
pos_T linecomment_pos;
|
||||
|
||||
trypos = find_line_comment(); // XXX
|
||||
if (trypos == NULL && curwin->w_cursor.lnum > 1)
|
||||
{
|
||||
// There may be a statement before the comment, search from the end
|
||||
// of the line for a comment start.
|
||||
linecomment_pos.col =
|
||||
check_linecomment(ml_get(curwin->w_cursor.lnum - 1));
|
||||
if (linecomment_pos.col != MAXCOL)
|
||||
{
|
||||
trypos = &linecomment_pos;
|
||||
trypos->lnum = curwin->w_cursor.lnum - 1;
|
||||
}
|
||||
}
|
||||
if (trypos != NULL)
|
||||
{
|
||||
// find how indented the line beginning the comment is
|
||||
getvcol(curwin, trypos, &col, NULL, NULL);
|
||||
amount = col;
|
||||
goto theend;
|
||||
}
|
||||
}
|
||||
|
||||
// If we're inside a comment and not looking at the start of the
|
||||
|
||||
@@ -119,7 +119,7 @@ sendToLocalVim(char_u *cmd, int asExpr, char_u **result)
|
||||
{
|
||||
if (ret == NULL)
|
||||
{
|
||||
char *err = _(e_invexprmsg);
|
||||
char *err = _(e_invalid_expression_received);
|
||||
size_t len = STRLEN(cmd) + STRLEN(err) + 5;
|
||||
char_u *msg;
|
||||
|
||||
@@ -709,7 +709,7 @@ check_connection(void)
|
||||
make_connection();
|
||||
if (X_DISPLAY == NULL)
|
||||
{
|
||||
emsg(_("E240: No connection to the X server"));
|
||||
emsg(_(e_no_connection_to_x_server));
|
||||
return FAIL;
|
||||
}
|
||||
return OK;
|
||||
@@ -759,7 +759,7 @@ remote_common(typval_T *argvars, typval_T *rettv, int expr)
|
||||
vim_free(r);
|
||||
}
|
||||
else
|
||||
semsg(_("E241: Unable to send to %s"), server_name);
|
||||
semsg(_(e_unable_to_send_to_str), server_name);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -929,7 +929,7 @@ f_remote_read(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
|| serverReadReply(X_DISPLAY, serverStrToWin(serverid),
|
||||
&r, FALSE, timeout) < 0)
|
||||
# endif
|
||||
emsg(_("E277: Unable to read a server reply"));
|
||||
emsg(_(e_unable_to_read_server_reply));
|
||||
}
|
||||
#endif
|
||||
rettv->v_type = VAR_STRING;
|
||||
@@ -1016,7 +1016,7 @@ f_server2client(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
|
||||
if (serverSendReply(server, reply) < 0)
|
||||
{
|
||||
emsg(_("E258: Unable to send to client"));
|
||||
emsg(_(e_unable_to_send_to_client));
|
||||
return;
|
||||
}
|
||||
rettv->vval.v_number = 0;
|
||||
|
||||
@@ -567,7 +567,7 @@ clip_get_word_boundaries(Clipboard_T *cb, int row, int col)
|
||||
return;
|
||||
|
||||
p = ScreenLines + LineOffset[row];
|
||||
// Correct for starting in the right halve of a double-wide char
|
||||
// Correct for starting in the right half of a double-wide char
|
||||
if (enc_dbcs != 0)
|
||||
col -= dbcs_screen_head_off(p, p + col);
|
||||
else if (enc_utf8 && p[col] == 0)
|
||||
@@ -1030,7 +1030,7 @@ clip_copy_modeless_selection(int both UNUSED)
|
||||
if (row2 > clip_star.max_row)
|
||||
row2 = clip_star.max_row;
|
||||
#endif
|
||||
// correct starting point for being on right halve of double-wide char
|
||||
// correct starting point for being on right half of double-wide char
|
||||
p = ScreenLines + LineOffset[row1];
|
||||
if (enc_dbcs != 0)
|
||||
col1 -= (*mb_head_off)(p, p + col1);
|
||||
@@ -1140,7 +1140,7 @@ clip_copy_modeless_selection(int both UNUSED)
|
||||
bufp);
|
||||
}
|
||||
}
|
||||
// Skip right halve of double-wide character.
|
||||
// Skip right half of double-wide character.
|
||||
if (ScreenLines[off + i + 1] == 0)
|
||||
++i;
|
||||
}
|
||||
@@ -1305,12 +1305,12 @@ check_clipboard_option(void)
|
||||
p += 8;
|
||||
new_exclude_prog = vim_regcomp(p, RE_MAGIC);
|
||||
if (new_exclude_prog == NULL)
|
||||
errmsg = e_invarg;
|
||||
errmsg = e_invalid_argument;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
errmsg = e_invarg;
|
||||
errmsg = e_invalid_argument;
|
||||
break;
|
||||
}
|
||||
if (*p == ',')
|
||||
|
||||
@@ -366,13 +366,13 @@ ExpandOne(
|
||||
// are wildcards, the real problem is that there was no match,
|
||||
// causing the pattern to be added, which has illegal characters.
|
||||
if (!(options & WILD_SILENT) && (options & WILD_LIST_NOTFOUND))
|
||||
semsg(_(e_nomatch2), str);
|
||||
semsg(_(e_no_match_str_2), str);
|
||||
#endif
|
||||
}
|
||||
else if (xp->xp_numfiles == 0)
|
||||
{
|
||||
if (!(options & WILD_SILENT))
|
||||
semsg(_(e_nomatch2), str);
|
||||
semsg(_(e_no_match_str_2), str);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2903,7 +2903,7 @@ f_getcompletion(typval_T *argvars, typval_T *rettv)
|
||||
pat = tv_get_string(&argvars[0]);
|
||||
if (argvars[1].v_type != VAR_STRING)
|
||||
{
|
||||
semsg(_(e_invarg2), "type must be a string");
|
||||
semsg(_(e_invalid_argument_str), "type must be a string");
|
||||
return;
|
||||
}
|
||||
type = tv_get_string(&argvars[1]);
|
||||
@@ -2933,7 +2933,7 @@ f_getcompletion(typval_T *argvars, typval_T *rettv)
|
||||
xpc.xp_context = cmdcomplete_str_to_type(type);
|
||||
if (xpc.xp_context == EXPAND_NOTHING)
|
||||
{
|
||||
semsg(_(e_invarg2), type);
|
||||
semsg(_(e_invalid_argument_str), type);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -724,7 +724,7 @@ ex_history(exarg_T *eap)
|
||||
else
|
||||
{
|
||||
*end = i;
|
||||
semsg(_(e_trailing_arg), arg);
|
||||
semsg(_(e_trailing_characters_str), arg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -736,7 +736,7 @@ ex_history(exarg_T *eap)
|
||||
end = arg;
|
||||
if (!get_list_range(&end, &hisidx1, &hisidx2) || *end != NUL)
|
||||
{
|
||||
semsg(_(e_trailing_arg), end);
|
||||
semsg(_(e_trailing_characters_str), end);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ LUA_LIBS = @LUA_LIBS@
|
||||
LUA_SRC = @LUA_SRC@
|
||||
LUA_OBJ = @LUA_OBJ@
|
||||
LUA_CFLAGS = @LUA_CFLAGS@
|
||||
LUA_CFLAGS_EXTRA = @LUA_CFLAGS_EXTRA@
|
||||
LUA_PRO = @LUA_PRO@
|
||||
|
||||
MZSCHEME_LIBS = @MZSCHEME_LIBS@
|
||||
@@ -60,15 +61,18 @@ PERL_SRC = @PERL_SRC@
|
||||
PERL_OBJ = @PERL_OBJ@
|
||||
PERL_PRO = @PERL_PRO@
|
||||
PERL_CFLAGS = @PERL_CFLAGS@
|
||||
PERL_CFLAGS_EXTRA = @PERL_CFLAGS_EXTRA@
|
||||
|
||||
PYTHON_SRC = @PYTHON_SRC@
|
||||
PYTHON_OBJ = @PYTHON_OBJ@
|
||||
PYTHON_CFLAGS = @PYTHON_CFLAGS@
|
||||
PYTHON_CFLAGS_EXTRA = @PYTHON_CFLAGS_EXTRA@
|
||||
PYTHON_LIBS = @PYTHON_LIBS@
|
||||
|
||||
PYTHON3_SRC = @PYTHON3_SRC@
|
||||
PYTHON3_OBJ = @PYTHON3_OBJ@
|
||||
PYTHON3_CFLAGS = @PYTHON3_CFLAGS@
|
||||
PYTHON3_CFLAGS_EXTRA = @PYTHON3_CFLAGS_EXTRA@
|
||||
PYTHON3_LIBS = @PYTHON3_LIBS@
|
||||
|
||||
TCL = @vi_cv_path_tcl@
|
||||
@@ -76,6 +80,7 @@ TCL_SRC = @TCL_SRC@
|
||||
TCL_OBJ = @TCL_OBJ@
|
||||
TCL_PRO = @TCL_PRO@
|
||||
TCL_CFLAGS = @TCL_CFLAGS@
|
||||
TCL_CFLAGS_EXTRA = @TCL_CFLAGS_EXTRA@
|
||||
TCL_LIBS = @TCL_LIBS@
|
||||
|
||||
NETBEANS_SRC = @NETBEANS_SRC@
|
||||
@@ -91,6 +96,7 @@ RUBY_SRC = @RUBY_SRC@
|
||||
RUBY_OBJ = @RUBY_OBJ@
|
||||
RUBY_PRO = @RUBY_PRO@
|
||||
RUBY_CFLAGS = @RUBY_CFLAGS@
|
||||
RUBY_CFLAGS_EXTRA = @RUBY_CFLAGS_EXTRA@
|
||||
RUBY_LIBS = @RUBY_LIBS@
|
||||
|
||||
AWK = @AWK@
|
||||
|
||||
@@ -159,8 +159,34 @@ fi
|
||||
|
||||
OS_EXTRA_SRC=""; OS_EXTRA_OBJ=""
|
||||
|
||||
dnl When cross-compiling set $vim_cv_uname_output, $vim_cv_uname_r_output and
|
||||
dnl $vim_cv_uname_m_output to the desired value for the target system
|
||||
AC_MSG_CHECKING(uname)
|
||||
if test "x$vim_cv_uname_output" = "x" ; then
|
||||
vim_cv_uname_output=`(uname) 2>/dev/null`
|
||||
AC_MSG_RESULT($vim_cv_uname_output)
|
||||
else
|
||||
AC_MSG_RESULT([$vim_cv_uname_output (cached)])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(uname -r)
|
||||
if test "x$vim_cv_uname_r_output" = "x" ; then
|
||||
vim_cv_uname_r_output=`(uname -r) 2>/dev/null`
|
||||
AC_MSG_RESULT($vim_cv_uname_r_output)
|
||||
else
|
||||
AC_MSG_RESULT([$vim_cv_uname_r_output (cached)])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(uname -m)
|
||||
if test "x$vim_cv_uname_m_output" = "x" ; then
|
||||
vim_cv_uname_m_output=`(uname -m) 2>/dev/null`
|
||||
AC_MSG_RESULT($vim_cv_uname_m_output)
|
||||
else
|
||||
AC_MSG_RESULT([$vim_cv_uname_m_output (cached)])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for Haiku)
|
||||
case `uname` in
|
||||
case $vim_cv_uname_output in
|
||||
Haiku) HAIKU=yes; AC_MSG_RESULT(yes);;
|
||||
*) HAIKU=no; AC_MSG_RESULT(no);;
|
||||
esac
|
||||
@@ -168,7 +194,7 @@ esac
|
||||
dnl If QNX is found, assume we don't want to use Xphoton
|
||||
dnl unless it was specifically asked for (--with-x)
|
||||
AC_MSG_CHECKING(for QNX)
|
||||
case `uname` in
|
||||
case $vim_cv_uname_output in
|
||||
QNX) OS_EXTRA_SRC=os_qnx.c; OS_EXTRA_OBJ=objects/os_qnx.o
|
||||
test -z "$with_x" && with_x=no
|
||||
QNX=yes; AC_MSG_RESULT(yes);;
|
||||
@@ -179,7 +205,7 @@ dnl Check for Darwin and MacOS X
|
||||
dnl We do a check for MacOS X in the very beginning because there
|
||||
dnl are a lot of other things we need to change besides GUI stuff
|
||||
AC_MSG_CHECKING([for Darwin (Mac OS X)])
|
||||
if test "`(uname) 2>/dev/null`" = Darwin; then
|
||||
if test "$vim_cv_uname_output" = Darwin; then
|
||||
AC_MSG_RESULT(yes)
|
||||
MACOS_X=yes
|
||||
CPPFLAGS="$CPPFLAGS -DMACOS_X"
|
||||
@@ -395,7 +421,7 @@ AC_SUBST(line_break)
|
||||
if test "$cf_cv_ebcdic" = "yes"; then
|
||||
dnl If we have EBCDIC we most likely have z/OS Unix, let's test it!
|
||||
AC_MSG_CHECKING(for z/OS Unix)
|
||||
case `uname` in
|
||||
case $vim_cv_uname_output in
|
||||
OS/390) zOSUnix="yes";
|
||||
dnl If using cc the environment variable _CC_CCMODE must be
|
||||
dnl set to "1", so that some compiler extensions are enabled.
|
||||
@@ -742,7 +768,7 @@ if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then
|
||||
fi
|
||||
if test "X$LUA_CFLAGS$LUA_LIBS" != "X" && \
|
||||
test "x$MACOS_X" = "xyes" && test "x$vi_cv_with_luajit" != "xno" && \
|
||||
test "`(uname -m) 2>/dev/null`" = "x86_64"; then
|
||||
test "$vim_cv_uname_m_output" = "x86_64"; then
|
||||
dnl OSX/x64 requires these flags. See http://luajit.org/install.html
|
||||
LUA_LIBS="-pagezero_size 10000 -image_base 100000000 $LUA_LIBS"
|
||||
fi
|
||||
@@ -755,6 +781,7 @@ if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then
|
||||
AC_SUBST(LUA_PRO)
|
||||
AC_SUBST(LUA_LIBS)
|
||||
AC_SUBST(LUA_CFLAGS)
|
||||
AC_SUBST(LUA_CFLAGS_EXTRA)
|
||||
fi
|
||||
|
||||
|
||||
@@ -910,8 +937,8 @@ if test "$enable_mzschemeinterp" = "yes"; then
|
||||
dnl Make Vim remember the path to the library. For when it's not in
|
||||
dnl $LD_LIBRARY_PATH.
|
||||
MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${path}"
|
||||
elif test "`(uname) 2>/dev/null`" = SunOS &&
|
||||
uname -r | grep '^5' >/dev/null; then
|
||||
elif test "$vim_cv_uname_output" = SunOS &&
|
||||
echo $vim_cv_uname_r_output | grep '^5' >/dev/null; then
|
||||
MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${path}"
|
||||
fi
|
||||
fi
|
||||
@@ -1175,6 +1202,7 @@ AC_SUBST(PERL_SRC)
|
||||
AC_SUBST(PERL_OBJ)
|
||||
AC_SUBST(PERL_PRO)
|
||||
AC_SUBST(PERL_CFLAGS)
|
||||
AC_SUBST(PERL_CFLAGS_EXTRA)
|
||||
AC_SUBST(PERL_LIBS)
|
||||
|
||||
AC_MSG_CHECKING(--enable-pythoninterp argument)
|
||||
@@ -1349,13 +1377,13 @@ eof
|
||||
threadsafe_flag=
|
||||
thread_lib=
|
||||
dnl if test "x$MACOS_X" != "xyes"; then
|
||||
if test "`(uname) 2>/dev/null`" != Darwin; then
|
||||
if test "$vim_cv_uname_output" != Darwin; then
|
||||
test "$GCC" = yes && threadsafe_flag="-pthread"
|
||||
if test "`(uname) 2>/dev/null`" = FreeBSD; then
|
||||
if test "$vim_cv_uname_output" = FreeBSD; then
|
||||
threadsafe_flag="-D_THREAD_SAFE"
|
||||
thread_lib="-pthread"
|
||||
fi
|
||||
if test "`(uname) 2>/dev/null`" = SunOS; then
|
||||
if test "$vim_cv_uname_output" = SunOS; then
|
||||
threadsafe_flag="-pthreads"
|
||||
fi
|
||||
fi
|
||||
@@ -1407,6 +1435,7 @@ fi
|
||||
|
||||
AC_SUBST(PYTHON_LIBS)
|
||||
AC_SUBST(PYTHON_CFLAGS)
|
||||
AC_SUBST(PYTHON_CFLAGS_EXTRA)
|
||||
AC_SUBST(PYTHON_SRC)
|
||||
AC_SUBST(PYTHON_OBJ)
|
||||
|
||||
@@ -1567,13 +1596,13 @@ eof
|
||||
threadsafe_flag=
|
||||
thread_lib=
|
||||
dnl if test "x$MACOS_X" != "xyes"; then
|
||||
if test "`(uname) 2>/dev/null`" != Darwin; then
|
||||
if test "$vim_cv_uname_output" != Darwin; then
|
||||
test "$GCC" = yes && threadsafe_flag="-pthread"
|
||||
if test "`(uname) 2>/dev/null`" = FreeBSD; then
|
||||
if test "$vim_cv_uname_output" = FreeBSD; then
|
||||
threadsafe_flag="-D_THREAD_SAFE"
|
||||
thread_lib="-pthread"
|
||||
fi
|
||||
if test "`(uname) 2>/dev/null`" = SunOS; then
|
||||
if test "$vim_cv_uname_output" = SunOS; then
|
||||
threadsafe_flag="-pthreads"
|
||||
fi
|
||||
fi
|
||||
@@ -1624,6 +1653,7 @@ fi
|
||||
|
||||
AC_SUBST(PYTHON3_LIBS)
|
||||
AC_SUBST(PYTHON3_CFLAGS)
|
||||
AC_SUBST(PYTHON3_CFLAGS_EXTRA)
|
||||
AC_SUBST(PYTHON3_SRC)
|
||||
AC_SUBST(PYTHON3_OBJ)
|
||||
|
||||
@@ -1880,8 +1910,8 @@ if test "$enable_tclinterp" = "yes" -o "$enable_tclinterp" = "dynamic"; then
|
||||
if test -f "$try/lib$trylib" ; then
|
||||
AC_MSG_RESULT($try/lib$trylib)
|
||||
TCL_LIBS="-L\"$try\" -ltcl$ver -ldl -lm"
|
||||
if test "`(uname) 2>/dev/null`" = SunOS &&
|
||||
uname -r | grep '^5' >/dev/null; then
|
||||
if test "$vim_cv_uname_output" = SunOS &&
|
||||
echo $vim_cv_uname_r_output | grep '^5' >/dev/null; then
|
||||
TCL_LIBS="$TCL_LIBS -R $try"
|
||||
fi
|
||||
break 3
|
||||
@@ -1920,6 +1950,7 @@ AC_SUBST(TCL_SRC)
|
||||
AC_SUBST(TCL_OBJ)
|
||||
AC_SUBST(TCL_PRO)
|
||||
AC_SUBST(TCL_CFLAGS)
|
||||
AC_SUBST(TCL_CFLAGS_EXTRA)
|
||||
AC_SUBST(TCL_LIBS)
|
||||
|
||||
AC_MSG_CHECKING(--enable-rubyinterp argument)
|
||||
@@ -2024,6 +2055,7 @@ AC_SUBST(RUBY_SRC)
|
||||
AC_SUBST(RUBY_OBJ)
|
||||
AC_SUBST(RUBY_PRO)
|
||||
AC_SUBST(RUBY_CFLAGS)
|
||||
AC_SUBST(RUBY_CFLAGS_EXTRA)
|
||||
AC_SUBST(RUBY_LIBS)
|
||||
|
||||
AC_MSG_CHECKING(--enable-cscope argument)
|
||||
@@ -2281,8 +2313,8 @@ else
|
||||
x_libraries=`echo "$x_includes" | sed s/include/lib/`
|
||||
AC_MSG_RESULT(Corrected X libraries to $x_libraries)
|
||||
X_LIBS="$X_LIBS -L$x_libraries"
|
||||
if test "`(uname) 2>/dev/null`" = SunOS &&
|
||||
uname -r | grep '^5' >/dev/null; then
|
||||
if test "$vim_cv_uname_output" = SunOS &&
|
||||
echo $vim_cv_uname_r_output | grep '^5' >/dev/null; then
|
||||
X_LIBS="$X_LIBS -R $x_libraries"
|
||||
fi
|
||||
fi
|
||||
@@ -2719,7 +2751,7 @@ AC_DEFUN([GNOME_INIT_HOOK],
|
||||
dnl On FreeBSD we need -pthread but pkg-config doesn't include it.
|
||||
dnl This might not be the right way but it works for me...
|
||||
AC_MSG_CHECKING(for FreeBSD)
|
||||
if test "`(uname) 2>/dev/null`" = FreeBSD; then
|
||||
if test "$vim_cv_uname_output" = FreeBSD; then
|
||||
AC_MSG_RESULT(yes, adding -pthread)
|
||||
GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE"
|
||||
GNOME_LIBS="$GNOME_LIBS -pthread"
|
||||
@@ -2971,8 +3003,8 @@ if test -z "$SKIP_MOTIF"; then
|
||||
else
|
||||
if test -n "$GUI_LIB_LOC"; then
|
||||
AC_MSG_RESULT($GUI_LIB_LOC)
|
||||
if test "`(uname) 2>/dev/null`" = SunOS &&
|
||||
uname -r | grep '^5' >/dev/null; then
|
||||
if test "$vim_cv_uname_output" = SunOS &&
|
||||
echo $vim_cv_uname_r_output | grep '^5' >/dev/null; then
|
||||
GUI_LIB_LOC="$GUI_LIB_LOC -R $GUI_LIB_LOC"
|
||||
fi
|
||||
fi
|
||||
@@ -3215,7 +3247,7 @@ fi
|
||||
|
||||
dnl Check for Cygwin, which needs an extra source file if not using X11
|
||||
AC_MSG_CHECKING(for CYGWIN or MSYS environment)
|
||||
case `uname` in
|
||||
case $vim_cv_uname_output in
|
||||
CYGWIN*|MSYS*) CYGWIN=yes; AC_MSG_RESULT(yes)
|
||||
AC_MSG_CHECKING(for CYGWIN clipboard support)
|
||||
if test "x$with_x" = "xno" ; then
|
||||
@@ -3446,7 +3478,7 @@ else
|
||||
dnl Older versions of ncurses have bugs, get a new one!
|
||||
dnl Digital Unix (OSF1) should use curses (Ronald Schild).
|
||||
dnl On SCO Openserver should prefer termlib (Roger Cornelius).
|
||||
case "`uname -s 2>/dev/null`" in
|
||||
case "$vim_cv_uname_output" in
|
||||
OSF1|SCO_SV) tlibs="tinfo ncurses curses termlib termcap";;
|
||||
*) tlibs="tinfo ncurses termlib termcap curses";;
|
||||
esac
|
||||
|
||||
@@ -594,7 +594,7 @@ dbg_parsearg(
|
||||
bp->dbg_type = DBG_EXPR;
|
||||
else
|
||||
{
|
||||
semsg(_(e_invarg2), p);
|
||||
semsg(_(e_invalid_argument_str), p);
|
||||
return FAIL;
|
||||
}
|
||||
p = skipwhite(p + 4);
|
||||
@@ -619,7 +619,7 @@ dbg_parsearg(
|
||||
|| (here && *p != NUL)
|
||||
|| (bp->dbg_type == DBG_FUNC && strstr((char *)p, "()") != NULL))
|
||||
{
|
||||
semsg(_(e_invarg2), arg);
|
||||
semsg(_(e_invalid_argument_str), arg);
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
@@ -815,7 +815,7 @@ ex_breakdel(exarg_T *eap)
|
||||
}
|
||||
|
||||
if (todel < 0)
|
||||
semsg(_("E161: Breakpoint not found: %s"), eap->arg);
|
||||
semsg(_(e_breakpoint_not_found_str), eap->arg);
|
||||
else
|
||||
{
|
||||
while (gap->ga_len > 0)
|
||||
|
||||
306
src/dict.c
306
src/dict.c
@@ -222,11 +222,12 @@ dict_free_items(int copyID)
|
||||
dictitem_alloc(char_u *key)
|
||||
{
|
||||
dictitem_T *di;
|
||||
size_t len = STRLEN(key);
|
||||
|
||||
di = alloc(offsetof(dictitem_T, di_key) + STRLEN(key) + 1);
|
||||
di = alloc(offsetof(dictitem_T, di_key) + len + 1);
|
||||
if (di != NULL)
|
||||
{
|
||||
STRCPY(di->di_key, key);
|
||||
mch_memmove(di->di_key, key, len + 1);
|
||||
di->di_flags = DI_FLAGS_ALLOC;
|
||||
di->di_tv.v_lock = 0;
|
||||
di->di_tv.v_type = VAR_UNKNOWN;
|
||||
@@ -719,7 +720,7 @@ dict_get_number_check(dict_T *d, char_u *key)
|
||||
return 0;
|
||||
if (di->di_tv.v_type != VAR_NUMBER)
|
||||
{
|
||||
semsg(_(e_invarg2), tv_get_string(&di->di_tv));
|
||||
semsg(_(e_invalid_argument_str), tv_get_string(&di->di_tv));
|
||||
return 0;
|
||||
}
|
||||
return tv_get_number(&di->di_tv);
|
||||
@@ -896,13 +897,11 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
|
||||
int vim9script = in_vim9script();
|
||||
int had_comma;
|
||||
|
||||
/*
|
||||
* First check if it's not a curly-braces thing: {expr}.
|
||||
* Must do this without evaluating, otherwise a function may be called
|
||||
* twice. Unfortunately this means we need to call eval1() twice for the
|
||||
* first item.
|
||||
* But {} is an empty Dictionary.
|
||||
*/
|
||||
// First check if it's not a curly-braces thing: {expr}.
|
||||
// Must do this without evaluating, otherwise a function may be called
|
||||
// twice. Unfortunately this means we need to call eval1() twice for the
|
||||
// first item.
|
||||
// But {} is an empty Dictionary.
|
||||
if (!vim9script
|
||||
&& *curly_expr != '}'
|
||||
&& eval1(&curly_expr, &tv, NULL) == OK
|
||||
@@ -963,7 +962,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
|
||||
if (*skipwhite(*arg) == ':')
|
||||
semsg(_(e_no_white_space_allowed_before_str_str), ":", *arg);
|
||||
else
|
||||
semsg(_(e_missing_dict_colon), *arg);
|
||||
semsg(_(e_missing_colon_in_dictionary), *arg);
|
||||
clear_tv(&tvkey);
|
||||
goto failret;
|
||||
}
|
||||
@@ -1003,7 +1002,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
|
||||
item = dict_find(d, key, -1);
|
||||
if (item != NULL)
|
||||
{
|
||||
semsg(_(e_duplicate_key), key);
|
||||
semsg(_(e_duplicate_key_in_dicitonary), key);
|
||||
clear_tv(&tvkey);
|
||||
clear_tv(&tv);
|
||||
goto failret;
|
||||
@@ -1043,7 +1042,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
|
||||
if (**arg == ',')
|
||||
semsg(_(e_no_white_space_allowed_before_str_str), ",", *arg);
|
||||
else
|
||||
semsg(_(e_missing_dict_comma), *arg);
|
||||
semsg(_(e_missing_comma_in_dictionary), *arg);
|
||||
goto failret;
|
||||
}
|
||||
}
|
||||
@@ -1183,6 +1182,251 @@ dict_equal(
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Count the number of times item "needle" occurs in Dict "d". Case is ignored
|
||||
* if "ic" is TRUE.
|
||||
*/
|
||||
long
|
||||
dict_count(dict_T *d, typval_T *needle, int ic)
|
||||
{
|
||||
int todo;
|
||||
hashitem_T *hi;
|
||||
long n = 0;
|
||||
|
||||
if (d == NULL)
|
||||
return 0;
|
||||
|
||||
todo = (int)d->dv_hashtab.ht_used;
|
||||
for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi)
|
||||
{
|
||||
if (!HASHITEM_EMPTY(hi))
|
||||
{
|
||||
--todo;
|
||||
if (tv_equal(&HI2DI(hi)->di_tv, needle, ic, FALSE))
|
||||
++n;
|
||||
}
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
* extend() a Dict. Append Dict argvars[1] to Dict argvars[0] and return the
|
||||
* resulting Dict in "rettv". "is_new" is TRUE for extendnew().
|
||||
*/
|
||||
void
|
||||
dict_extend_func(
|
||||
typval_T *argvars,
|
||||
type_T *type,
|
||||
char *func_name,
|
||||
char_u *arg_errmsg,
|
||||
int is_new,
|
||||
typval_T *rettv)
|
||||
{
|
||||
dict_T *d1, *d2;
|
||||
char_u *action;
|
||||
int i;
|
||||
|
||||
d1 = argvars[0].vval.v_dict;
|
||||
if (d1 == NULL)
|
||||
{
|
||||
emsg(_(e_cannot_extend_null_dict));
|
||||
return;
|
||||
}
|
||||
d2 = argvars[1].vval.v_dict;
|
||||
if ((is_new || !value_check_lock(d1->dv_lock, arg_errmsg, TRUE))
|
||||
&& d2 != NULL)
|
||||
{
|
||||
if (is_new)
|
||||
{
|
||||
d1 = dict_copy(d1, FALSE, get_copyID());
|
||||
if (d1 == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
// Check the third argument.
|
||||
if (argvars[2].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
static char *(av[]) = {"keep", "force", "error"};
|
||||
|
||||
action = tv_get_string_chk(&argvars[2]);
|
||||
if (action == NULL)
|
||||
return;
|
||||
for (i = 0; i < 3; ++i)
|
||||
if (STRCMP(action, av[i]) == 0)
|
||||
break;
|
||||
if (i == 3)
|
||||
{
|
||||
semsg(_(e_invalid_argument_str), action);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
action = (char_u *)"force";
|
||||
|
||||
if (type != NULL && check_typval_arg_type(type, &argvars[1],
|
||||
func_name, 2) == FAIL)
|
||||
return;
|
||||
dict_extend(d1, d2, action, func_name);
|
||||
|
||||
if (is_new)
|
||||
{
|
||||
rettv->v_type = VAR_DICT;
|
||||
rettv->vval.v_dict = d1;
|
||||
rettv->v_lock = FALSE;
|
||||
}
|
||||
else
|
||||
copy_tv(&argvars[0], rettv);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Implementation of map() and filter() for a Dict. Apply "expr" to every
|
||||
* item in Dict "d" and return the result in "rettv".
|
||||
*/
|
||||
void
|
||||
dict_filter_map(
|
||||
dict_T *d,
|
||||
filtermap_T filtermap,
|
||||
type_T *argtype,
|
||||
char *func_name,
|
||||
char_u *arg_errmsg,
|
||||
typval_T *expr,
|
||||
typval_T *rettv)
|
||||
{
|
||||
int prev_lock;
|
||||
dict_T *d_ret = NULL;
|
||||
hashtab_T *ht;
|
||||
hashitem_T *hi;
|
||||
dictitem_T *di;
|
||||
int todo;
|
||||
int rem;
|
||||
|
||||
if (filtermap == FILTERMAP_MAPNEW)
|
||||
{
|
||||
rettv->v_type = VAR_DICT;
|
||||
rettv->vval.v_dict = NULL;
|
||||
}
|
||||
if (d == NULL
|
||||
|| (filtermap == FILTERMAP_FILTER
|
||||
&& value_check_lock(d->dv_lock, arg_errmsg, TRUE)))
|
||||
return;
|
||||
|
||||
prev_lock = d->dv_lock;
|
||||
|
||||
if (filtermap == FILTERMAP_MAPNEW)
|
||||
{
|
||||
if (rettv_dict_alloc(rettv) == FAIL)
|
||||
return;
|
||||
d_ret = rettv->vval.v_dict;
|
||||
}
|
||||
|
||||
if (filtermap != FILTERMAP_FILTER && d->dv_lock == 0)
|
||||
d->dv_lock = VAR_LOCKED;
|
||||
ht = &d->dv_hashtab;
|
||||
hash_lock(ht);
|
||||
todo = (int)ht->ht_used;
|
||||
for (hi = ht->ht_array; todo > 0; ++hi)
|
||||
{
|
||||
if (!HASHITEM_EMPTY(hi))
|
||||
{
|
||||
int r;
|
||||
typval_T newtv;
|
||||
|
||||
--todo;
|
||||
di = HI2DI(hi);
|
||||
if (filtermap == FILTERMAP_MAP
|
||||
&& (value_check_lock(di->di_tv.v_lock,
|
||||
arg_errmsg, TRUE)
|
||||
|| var_check_ro(di->di_flags,
|
||||
arg_errmsg, TRUE)))
|
||||
break;
|
||||
set_vim_var_string(VV_KEY, di->di_key, -1);
|
||||
newtv.v_type = VAR_UNKNOWN;
|
||||
r = filter_map_one(&di->di_tv, expr, filtermap,
|
||||
&newtv, &rem);
|
||||
clear_tv(get_vim_var_tv(VV_KEY));
|
||||
if (r == FAIL || did_emsg)
|
||||
{
|
||||
clear_tv(&newtv);
|
||||
break;
|
||||
}
|
||||
if (filtermap == FILTERMAP_MAP)
|
||||
{
|
||||
if (argtype != NULL && check_typval_arg_type(
|
||||
argtype->tt_member, &newtv,
|
||||
func_name, 0) == FAIL)
|
||||
{
|
||||
clear_tv(&newtv);
|
||||
break;
|
||||
}
|
||||
// map(): replace the dict item value
|
||||
clear_tv(&di->di_tv);
|
||||
newtv.v_lock = 0;
|
||||
di->di_tv = newtv;
|
||||
}
|
||||
else if (filtermap == FILTERMAP_MAPNEW)
|
||||
{
|
||||
// mapnew(): add the item value to the new dict
|
||||
r = dict_add_tv(d_ret, (char *)di->di_key, &newtv);
|
||||
clear_tv(&newtv);
|
||||
if (r == FAIL)
|
||||
break;
|
||||
}
|
||||
else if (filtermap == FILTERMAP_FILTER && rem)
|
||||
{
|
||||
// filter(false): remove the item from the dict
|
||||
if (var_check_fixed(di->di_flags, arg_errmsg, TRUE)
|
||||
|| var_check_ro(di->di_flags, arg_errmsg, TRUE))
|
||||
break;
|
||||
dictitem_remove(d, di);
|
||||
}
|
||||
}
|
||||
}
|
||||
hash_unlock(ht);
|
||||
d->dv_lock = prev_lock;
|
||||
}
|
||||
|
||||
/*
|
||||
* "remove({dict})" function
|
||||
*/
|
||||
void
|
||||
dict_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg)
|
||||
{
|
||||
dict_T *d;
|
||||
char_u *key;
|
||||
dictitem_T *di;
|
||||
|
||||
if (argvars[2].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
semsg(_(e_too_many_arguments_for_function_str), "remove()");
|
||||
return;
|
||||
}
|
||||
|
||||
d = argvars[0].vval.v_dict;
|
||||
if (d == NULL || value_check_lock(d->dv_lock, arg_errmsg, TRUE))
|
||||
return;
|
||||
|
||||
key = tv_get_string_chk(&argvars[1]);
|
||||
if (key == NULL)
|
||||
return;
|
||||
|
||||
di = dict_find(d, key, -1);
|
||||
if (di == NULL)
|
||||
{
|
||||
semsg(_(e_key_not_present_in_dictionary), key);
|
||||
return;
|
||||
}
|
||||
|
||||
if (var_check_fixed(di->di_flags, arg_errmsg, TRUE)
|
||||
|| var_check_ro(di->di_flags, arg_errmsg, TRUE))
|
||||
return;
|
||||
|
||||
*rettv = di->di_tv;
|
||||
init_tv(&di->di_tv);
|
||||
dictitem_remove(d, di);
|
||||
}
|
||||
|
||||
/*
|
||||
* Turn a dict into a list:
|
||||
* "what" == 0: list of keys
|
||||
@@ -1205,7 +1449,7 @@ dict_list(typval_T *argvars, typval_T *rettv, int what)
|
||||
|
||||
if (argvars[0].v_type != VAR_DICT)
|
||||
{
|
||||
emsg(_(e_dictreq));
|
||||
emsg(_(e_dictionary_required));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1328,7 +1572,7 @@ f_has_key(typval_T *argvars, typval_T *rettv)
|
||||
|
||||
if (argvars[0].v_type != VAR_DICT)
|
||||
{
|
||||
emsg(_(e_dictreq));
|
||||
emsg(_(e_dictionary_required));
|
||||
return;
|
||||
}
|
||||
if (argvars[0].vval.v_dict == NULL)
|
||||
@@ -1338,36 +1582,4 @@ f_has_key(typval_T *argvars, typval_T *rettv)
|
||||
tv_get_string(&argvars[1]), -1) != NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* "remove({dict})" function
|
||||
*/
|
||||
void
|
||||
dict_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg)
|
||||
{
|
||||
dict_T *d;
|
||||
char_u *key;
|
||||
dictitem_T *di;
|
||||
|
||||
if (argvars[2].v_type != VAR_UNKNOWN)
|
||||
semsg(_(e_toomanyarg), "remove()");
|
||||
else if ((d = argvars[0].vval.v_dict) != NULL
|
||||
&& !value_check_lock(d->dv_lock, arg_errmsg, TRUE))
|
||||
{
|
||||
key = tv_get_string_chk(&argvars[1]);
|
||||
if (key != NULL)
|
||||
{
|
||||
di = dict_find(d, key, -1);
|
||||
if (di == NULL)
|
||||
semsg(_(e_dictkey), key);
|
||||
else if (!var_check_fixed(di->di_flags, arg_errmsg, TRUE)
|
||||
&& !var_check_ro(di->di_flags, arg_errmsg, TRUE))
|
||||
{
|
||||
*rettv = di->di_tv;
|
||||
init_tv(&di->di_tv);
|
||||
dictitem_remove(d, di);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // defined(FEAT_EVAL)
|
||||
|
||||
302
src/diff.c
302
src/diff.c
@@ -64,6 +64,14 @@ typedef struct {
|
||||
garray_T dout_ga; // used for internal diff
|
||||
} diffout_T;
|
||||
|
||||
// used for recording hunks from xdiff
|
||||
typedef struct {
|
||||
linenr_T lnum_orig;
|
||||
long count_orig;
|
||||
linenr_T lnum_new;
|
||||
long count_new;
|
||||
} diffhunk_T;
|
||||
|
||||
// two diff inputs and one result
|
||||
typedef struct {
|
||||
diffin_T dio_orig; // original file input
|
||||
@@ -84,12 +92,12 @@ static int diff_cmp(char_u *s1, char_u *s2);
|
||||
#ifdef FEAT_FOLDING
|
||||
static void diff_fold_update(diff_T *dp, int skip_idx);
|
||||
#endif
|
||||
static void diff_read(int idx_orig, int idx_new, diffout_T *fname);
|
||||
static void diff_read(int idx_orig, int idx_new, diffio_T *dio);
|
||||
static void diff_copy_entry(diff_T *dprev, diff_T *dp, int idx_orig, int idx_new);
|
||||
static diff_T *diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp);
|
||||
static int parse_diff_ed(char_u *line, linenr_T *lnum_orig, long *count_orig, linenr_T *lnum_new, long *count_new);
|
||||
static int parse_diff_unified(char_u *line, linenr_T *lnum_orig, long *count_orig, linenr_T *lnum_new, long *count_new);
|
||||
static int xdiff_out(void *priv, mmbuffer_t *mb, int nbuf);
|
||||
static int parse_diff_ed(char_u *line, diffhunk_T *hunk);
|
||||
static int parse_diff_unified(char_u *line, diffhunk_T *hunk);
|
||||
static int xdiff_out(long start_a, long count_a, long start_b, long count_b, void *priv);
|
||||
|
||||
#define FOR_ALL_DIFFBLOCKS_IN_TAB(tp, dp) \
|
||||
for ((dp) = (tp)->tp_first_diff; (dp) != NULL; (dp) = (dp)->df_next)
|
||||
@@ -173,7 +181,7 @@ diff_buf_add(buf_T *buf)
|
||||
return;
|
||||
}
|
||||
|
||||
semsg(_("E96: Cannot diff more than %d buffers"), DB_COUNT);
|
||||
semsg(_(e_cannot_diff_more_than_nr_buffers), DB_COUNT);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -693,11 +701,11 @@ diff_redraw(
|
||||
if (wp_other != NULL && curwin->w_p_scb)
|
||||
{
|
||||
if (used_max_fill_curwin)
|
||||
// The current window was set to used the maximum number of filler
|
||||
// The current window was set to use the maximum number of filler
|
||||
// lines, may need to reduce them.
|
||||
diff_set_topline(wp_other, curwin);
|
||||
else if (used_max_fill_other)
|
||||
// The other window was set to used the maximum number of filler
|
||||
// The other window was set to use the maximum number of filler
|
||||
// lines, may need to reduce them.
|
||||
diff_set_topline(curwin, wp_other);
|
||||
}
|
||||
@@ -769,9 +777,14 @@ diff_write_buffer(buf_T *buf, diffin_T *din)
|
||||
int orig_len;
|
||||
char_u cbuf[MB_MAXBYTES + 1];
|
||||
|
||||
// xdiff doesn't support ignoring case, fold-case the text.
|
||||
c = PTR2CHAR(s);
|
||||
c = MB_CASEFOLD(c);
|
||||
if (*s == NL)
|
||||
c = NUL;
|
||||
else
|
||||
{
|
||||
// xdiff doesn't support ignoring case, fold-case the text.
|
||||
c = PTR2CHAR(s);
|
||||
c = MB_CASEFOLD(c);
|
||||
}
|
||||
orig_len = mb_ptr2len(s);
|
||||
if (mb_char2bytes(c, cbuf) != orig_len)
|
||||
// TODO: handle byte length difference
|
||||
@@ -783,7 +796,10 @@ diff_write_buffer(buf_T *buf, diffin_T *din)
|
||||
len += orig_len;
|
||||
}
|
||||
else
|
||||
ptr[len++] = *s++;
|
||||
{
|
||||
ptr[len++] = *s == NL ? NUL : *s;
|
||||
s++;
|
||||
}
|
||||
}
|
||||
ptr[len++] = NL;
|
||||
}
|
||||
@@ -880,7 +896,7 @@ diff_try_update(
|
||||
continue;
|
||||
|
||||
// Read the diff output and add each entry to the diff list.
|
||||
diff_read(idx_orig, idx_new, &dio->dio_diff);
|
||||
diff_read(idx_orig, idx_new, dio);
|
||||
|
||||
clear_diffin(&dio->dio_new);
|
||||
clear_diffout(&dio->dio_diff);
|
||||
@@ -1081,7 +1097,7 @@ check_external_diff(diffio_T *diffio)
|
||||
{
|
||||
if (io_error)
|
||||
emsg(_("E810: Cannot read or write temp files"));
|
||||
emsg(_("E97: Cannot create diffs"));
|
||||
emsg(_(e_cannot_create_diffs));
|
||||
diff_a_works = MAYBE;
|
||||
#if defined(MSWIN)
|
||||
diff_bin_works = MAYBE;
|
||||
@@ -1118,7 +1134,7 @@ diff_file_internal(diffio_T *diffio)
|
||||
|
||||
emit_cfg.ctxlen = 0; // don't need any diff_context here
|
||||
emit_cb.priv = &diffio->dio_diff;
|
||||
emit_cb.out_line = xdiff_out;
|
||||
emit_cfg.hunk_func = xdiff_out;
|
||||
if (xdl_diff(&diffio->dio_orig.din_mmfile,
|
||||
&diffio->dio_new.din_mmfile,
|
||||
¶m, &emit_cfg, &emit_cb) < 0)
|
||||
@@ -1303,7 +1319,7 @@ ex_diffpatch(exarg_T *eap)
|
||||
if (dirbuf[0] != NUL)
|
||||
{
|
||||
if (mch_chdir((char *)dirbuf) != 0)
|
||||
emsg(_(e_prev_dir));
|
||||
emsg(_(e_cannot_go_back_to_previous_directory));
|
||||
shorten_fnames(TRUE);
|
||||
}
|
||||
#endif
|
||||
@@ -1482,9 +1498,9 @@ diff_win_options(
|
||||
wp->w_p_crb = TRUE;
|
||||
if (!(diff_flags & DIFF_FOLLOWWRAP))
|
||||
{
|
||||
if (!wp->w_p_diff)
|
||||
if (!wp->w_p_diff)
|
||||
wp->w_p_wrap_save = wp->w_p_wrap;
|
||||
wp->w_p_wrap = FALSE;
|
||||
wp->w_p_wrap = FALSE;
|
||||
}
|
||||
# ifdef FEAT_FOLDING
|
||||
if (!wp->w_p_diff)
|
||||
@@ -1549,7 +1565,7 @@ ex_diffoff(exarg_T *eap)
|
||||
if (!(diff_flags & DIFF_FOLLOWWRAP))
|
||||
{
|
||||
if (!wp->w_p_wrap)
|
||||
wp->w_p_wrap = wp->w_p_wrap_save;
|
||||
wp->w_p_wrap = wp->w_p_wrap_save;
|
||||
}
|
||||
#ifdef FEAT_FOLDING
|
||||
free_string_option(wp->w_p_fdm);
|
||||
@@ -1595,7 +1611,7 @@ ex_diffoff(exarg_T *eap)
|
||||
diff_clear(curtab);
|
||||
}
|
||||
|
||||
// Remove "hor" from from 'scrollopt' if there are no diff windows left.
|
||||
// Remove "hor" from 'scrollopt' if there are no diff windows left.
|
||||
if (!diffwin && vim_strchr(p_sbo, 'h') != NULL)
|
||||
do_cmdline_cmd((char_u *)"set sbo-=hor");
|
||||
}
|
||||
@@ -1607,20 +1623,21 @@ ex_diffoff(exarg_T *eap)
|
||||
diff_read(
|
||||
int idx_orig, // idx of original file
|
||||
int idx_new, // idx of new file
|
||||
diffout_T *dout) // diff output
|
||||
diffio_T *dio) // diff output
|
||||
{
|
||||
FILE *fd = NULL;
|
||||
int line_idx = 0;
|
||||
diff_T *dprev = NULL;
|
||||
diff_T *dp = curtab->tp_first_diff;
|
||||
diff_T *dn, *dpl;
|
||||
diffout_T *dout = &dio->dio_diff;
|
||||
char_u linebuf[LBUFLEN]; // only need to hold the diff line
|
||||
char_u *line;
|
||||
long off;
|
||||
int i;
|
||||
linenr_T lnum_orig, lnum_new;
|
||||
long count_orig, count_new;
|
||||
int notset = TRUE; // block "*dp" not set yet
|
||||
diffhunk_T *hunk = NULL; // init to avoid gcc warning
|
||||
|
||||
enum {
|
||||
DIFF_ED,
|
||||
DIFF_UNIFIED,
|
||||
@@ -1636,80 +1653,96 @@ diff_read(
|
||||
fd = mch_fopen((char *)dout->dout_fname, "r");
|
||||
if (fd == NULL)
|
||||
{
|
||||
emsg(_("E98: Cannot read diff output"));
|
||||
emsg(_(e_cannot_read_diff_output));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!dio->dio_internal)
|
||||
{
|
||||
hunk = ALLOC_ONE(diffhunk_T);
|
||||
if (hunk == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (fd == NULL)
|
||||
if (dio->dio_internal)
|
||||
{
|
||||
if (line_idx >= dout->dout_ga.ga_len)
|
||||
break; // did last line
|
||||
line = ((char_u **)dout->dout_ga.ga_data)[line_idx++];
|
||||
if (line_idx >= dout->dout_ga.ga_len) {
|
||||
break; // did last line
|
||||
}
|
||||
hunk = ((diffhunk_T **)dout->dout_ga.ga_data)[line_idx++];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (vim_fgets(linebuf, LBUFLEN, fd))
|
||||
break; // end of file
|
||||
line = linebuf;
|
||||
}
|
||||
|
||||
if (diffstyle == DIFF_NONE)
|
||||
{
|
||||
// Determine diff style.
|
||||
// ed like diff looks like this:
|
||||
// {first}[,{last}]c{first}[,{last}]
|
||||
// {first}a{first}[,{last}]
|
||||
// {first}[,{last}]d{first}
|
||||
//
|
||||
// unified diff looks like this:
|
||||
// --- file1 2018-03-20 13:23:35.783153140 +0100
|
||||
// +++ file2 2018-03-20 13:23:41.183156066 +0100
|
||||
// @@ -1,3 +1,5 @@
|
||||
if (isdigit(*line))
|
||||
diffstyle = DIFF_ED;
|
||||
else if ((STRNCMP(line, "@@ ", 3) == 0))
|
||||
diffstyle = DIFF_UNIFIED;
|
||||
else if ((STRNCMP(line, "--- ", 4) == 0)
|
||||
&& (vim_fgets(linebuf, LBUFLEN, fd) == 0)
|
||||
&& (STRNCMP(line, "+++ ", 4) == 0)
|
||||
&& (vim_fgets(linebuf, LBUFLEN, fd) == 0)
|
||||
&& (STRNCMP(line, "@@ ", 3) == 0))
|
||||
diffstyle = DIFF_UNIFIED;
|
||||
if (fd == NULL)
|
||||
{
|
||||
if (line_idx >= dout->dout_ga.ga_len)
|
||||
break; // did last line
|
||||
line = ((char_u **)dout->dout_ga.ga_data)[line_idx++];
|
||||
}
|
||||
else
|
||||
// Format not recognized yet, skip over this line. Cygwin diff
|
||||
// may put a warning at the start of the file.
|
||||
continue;
|
||||
}
|
||||
{
|
||||
if (vim_fgets(linebuf, LBUFLEN, fd))
|
||||
break; // end of file
|
||||
line = linebuf;
|
||||
}
|
||||
|
||||
if (diffstyle == DIFF_ED)
|
||||
{
|
||||
if (!isdigit(*line))
|
||||
continue; // not the start of a diff block
|
||||
if (parse_diff_ed(line, &lnum_orig, &count_orig,
|
||||
&lnum_new, &count_new) == FAIL)
|
||||
continue;
|
||||
}
|
||||
else if (diffstyle == DIFF_UNIFIED)
|
||||
{
|
||||
if (STRNCMP(line, "@@ ", 3) != 0)
|
||||
continue; // not the start of a diff block
|
||||
if (parse_diff_unified(line, &lnum_orig, &count_orig,
|
||||
&lnum_new, &count_new) == FAIL)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
emsg(_("E959: Invalid diff format."));
|
||||
break;
|
||||
if (diffstyle == DIFF_NONE)
|
||||
{
|
||||
// Determine diff style.
|
||||
// ed like diff looks like this:
|
||||
// {first}[,{last}]c{first}[,{last}]
|
||||
// {first}a{first}[,{last}]
|
||||
// {first}[,{last}]d{first}
|
||||
//
|
||||
// unified diff looks like this:
|
||||
// --- file1 2018-03-20 13:23:35.783153140 +0100
|
||||
// +++ file2 2018-03-20 13:23:41.183156066 +0100
|
||||
// @@ -1,3 +1,5 @@
|
||||
if (isdigit(*line))
|
||||
diffstyle = DIFF_ED;
|
||||
else if ((STRNCMP(line, "@@ ", 3) == 0))
|
||||
diffstyle = DIFF_UNIFIED;
|
||||
else if ((STRNCMP(line, "--- ", 4) == 0)
|
||||
&& (vim_fgets(linebuf, LBUFLEN, fd) == 0)
|
||||
&& (STRNCMP(line, "+++ ", 4) == 0)
|
||||
&& (vim_fgets(linebuf, LBUFLEN, fd) == 0)
|
||||
&& (STRNCMP(line, "@@ ", 3) == 0))
|
||||
diffstyle = DIFF_UNIFIED;
|
||||
else
|
||||
// Format not recognized yet, skip over this line. Cygwin
|
||||
// diff may put a warning at the start of the file.
|
||||
continue;
|
||||
}
|
||||
|
||||
if (diffstyle == DIFF_ED)
|
||||
{
|
||||
if (!isdigit(*line))
|
||||
continue; // not the start of a diff block
|
||||
if (parse_diff_ed(line, hunk) == FAIL)
|
||||
continue;
|
||||
}
|
||||
else if (diffstyle == DIFF_UNIFIED)
|
||||
{
|
||||
if (STRNCMP(line, "@@ ", 3) != 0)
|
||||
continue; // not the start of a diff block
|
||||
if (parse_diff_unified(line, hunk) == FAIL)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
emsg(_("E959: Invalid diff format."));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Go over blocks before the change, for which orig and new are equal.
|
||||
// Copy blocks from orig to new.
|
||||
while (dp != NULL
|
||||
&& lnum_orig > dp->df_lnum[idx_orig] + dp->df_count[idx_orig])
|
||||
&& hunk->lnum_orig > dp->df_lnum[idx_orig]
|
||||
+ dp->df_count[idx_orig])
|
||||
{
|
||||
if (notset)
|
||||
diff_copy_entry(dprev, dp, idx_orig, idx_new);
|
||||
@@ -1719,41 +1752,43 @@ diff_read(
|
||||
}
|
||||
|
||||
if (dp != NULL
|
||||
&& lnum_orig <= dp->df_lnum[idx_orig] + dp->df_count[idx_orig]
|
||||
&& lnum_orig + count_orig >= dp->df_lnum[idx_orig])
|
||||
&& hunk->lnum_orig <= dp->df_lnum[idx_orig]
|
||||
+ dp->df_count[idx_orig]
|
||||
&& hunk->lnum_orig + hunk->count_orig >= dp->df_lnum[idx_orig])
|
||||
{
|
||||
// New block overlaps with existing block(s).
|
||||
// First find last block that overlaps.
|
||||
for (dpl = dp; dpl->df_next != NULL; dpl = dpl->df_next)
|
||||
if (lnum_orig + count_orig < dpl->df_next->df_lnum[idx_orig])
|
||||
if (hunk->lnum_orig + hunk->count_orig
|
||||
< dpl->df_next->df_lnum[idx_orig])
|
||||
break;
|
||||
|
||||
// If the newly found block starts before the old one, set the
|
||||
// start back a number of lines.
|
||||
off = dp->df_lnum[idx_orig] - lnum_orig;
|
||||
off = dp->df_lnum[idx_orig] - hunk->lnum_orig;
|
||||
if (off > 0)
|
||||
{
|
||||
for (i = idx_orig; i < idx_new; ++i)
|
||||
if (curtab->tp_diffbuf[i] != NULL)
|
||||
dp->df_lnum[i] -= off;
|
||||
dp->df_lnum[idx_new] = lnum_new;
|
||||
dp->df_count[idx_new] = count_new;
|
||||
dp->df_lnum[idx_new] = hunk->lnum_new;
|
||||
dp->df_count[idx_new] = hunk->count_new;
|
||||
}
|
||||
else if (notset)
|
||||
{
|
||||
// new block inside existing one, adjust new block
|
||||
dp->df_lnum[idx_new] = lnum_new + off;
|
||||
dp->df_count[idx_new] = count_new - off;
|
||||
dp->df_lnum[idx_new] = hunk->lnum_new + off;
|
||||
dp->df_count[idx_new] = hunk->count_new - off;
|
||||
}
|
||||
else
|
||||
// second overlap of new block with existing block
|
||||
dp->df_count[idx_new] += count_new - count_orig
|
||||
dp->df_count[idx_new] += hunk->count_new - hunk->count_orig
|
||||
+ dpl->df_lnum[idx_orig] + dpl->df_count[idx_orig]
|
||||
- (dp->df_lnum[idx_orig] + dp->df_count[idx_orig]);
|
||||
|
||||
// Adjust the size of the block to include all the lines to the
|
||||
// end of the existing block or the new diff, whatever ends last.
|
||||
off = (lnum_orig + count_orig)
|
||||
off = (hunk->lnum_orig + hunk->count_orig)
|
||||
- (dpl->df_lnum[idx_orig] + dpl->df_count[idx_orig]);
|
||||
if (off < 0)
|
||||
{
|
||||
@@ -1785,10 +1820,10 @@ diff_read(
|
||||
if (dp == NULL)
|
||||
goto done;
|
||||
|
||||
dp->df_lnum[idx_orig] = lnum_orig;
|
||||
dp->df_count[idx_orig] = count_orig;
|
||||
dp->df_lnum[idx_new] = lnum_new;
|
||||
dp->df_count[idx_new] = count_new;
|
||||
dp->df_lnum[idx_orig] = hunk->lnum_orig;
|
||||
dp->df_count[idx_orig] = hunk->count_orig;
|
||||
dp->df_lnum[idx_new] = hunk->lnum_new;
|
||||
dp->df_count[idx_new] = hunk->count_new;
|
||||
|
||||
// Set values for other buffers, these must be equal to the
|
||||
// original buffer, otherwise there would have been a change
|
||||
@@ -1811,6 +1846,9 @@ diff_read(
|
||||
}
|
||||
|
||||
done:
|
||||
if (!dio->dio_internal)
|
||||
vim_free(hunk);
|
||||
|
||||
if (fd != NULL)
|
||||
fclose(fd);
|
||||
}
|
||||
@@ -2625,7 +2663,7 @@ ex_diffgetput(exarg_T *eap)
|
||||
idx_cur = diff_buf_idx(curbuf);
|
||||
if (idx_cur == DB_COUNT)
|
||||
{
|
||||
emsg(_("E99: Current buffer is not in diff mode"));
|
||||
emsg(_(e_current_buffer_is_not_in_diff_mode));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2646,7 +2684,7 @@ ex_diffgetput(exarg_T *eap)
|
||||
if (found_not_ma)
|
||||
emsg(_("E793: No other buffer in diff mode is modifiable"));
|
||||
else
|
||||
emsg(_("E100: No other buffer in diff mode"));
|
||||
emsg(_(e_no_other_buffer_in_diff_mode));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2656,7 +2694,7 @@ ex_diffgetput(exarg_T *eap)
|
||||
&& curtab->tp_diffbuf[i] != NULL
|
||||
&& (eap->cmdidx != CMD_diffput || curtab->tp_diffbuf[i]->b_p_ma))
|
||||
{
|
||||
emsg(_("E101: More than two buffers in diff mode, don't know which one to use"));
|
||||
emsg(_(e_more_than_two_buffers_in_diff_mode_dont_know_which_one_to_use));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -2679,7 +2717,7 @@ ex_diffgetput(exarg_T *eap)
|
||||
buf = buflist_findnr(i);
|
||||
if (buf == NULL)
|
||||
{
|
||||
semsg(_("E102: Can't find buffer \"%s\""), eap->arg);
|
||||
semsg(_(e_cant_find_buffer_str), eap->arg);
|
||||
return;
|
||||
}
|
||||
if (buf == curbuf)
|
||||
@@ -2687,7 +2725,7 @@ ex_diffgetput(exarg_T *eap)
|
||||
idx_other = diff_buf_idx(buf);
|
||||
if (idx_other == DB_COUNT)
|
||||
{
|
||||
semsg(_("E103: Buffer \"%s\" is not in diff mode"), eap->arg);
|
||||
semsg(_(e_buffer_str_is_not_in_diff_mode), eap->arg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -3137,10 +3175,7 @@ diff_lnum_win(linenr_T lnum, win_T *wp)
|
||||
static int
|
||||
parse_diff_ed(
|
||||
char_u *line,
|
||||
linenr_T *lnum_orig,
|
||||
long *count_orig,
|
||||
linenr_T *lnum_new,
|
||||
long *count_new)
|
||||
diffhunk_T *hunk)
|
||||
{
|
||||
char_u *p;
|
||||
long f1, l1, f2, l2;
|
||||
@@ -3175,23 +3210,23 @@ parse_diff_ed(
|
||||
|
||||
if (difftype == 'a')
|
||||
{
|
||||
*lnum_orig = f1 + 1;
|
||||
*count_orig = 0;
|
||||
hunk->lnum_orig = f1 + 1;
|
||||
hunk->count_orig = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
*lnum_orig = f1;
|
||||
*count_orig = l1 - f1 + 1;
|
||||
hunk->lnum_orig = f1;
|
||||
hunk->count_orig = l1 - f1 + 1;
|
||||
}
|
||||
if (difftype == 'd')
|
||||
{
|
||||
*lnum_new = f2 + 1;
|
||||
*count_new = 0;
|
||||
hunk->lnum_new = f2 + 1;
|
||||
hunk->count_new = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
*lnum_new = f2;
|
||||
*count_new = l2 - f2 + 1;
|
||||
hunk->lnum_new = f2;
|
||||
hunk->count_new = l2 - f2 + 1;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
@@ -3203,10 +3238,7 @@ parse_diff_ed(
|
||||
static int
|
||||
parse_diff_unified(
|
||||
char_u *line,
|
||||
linenr_T *lnum_orig,
|
||||
long *count_orig,
|
||||
linenr_T *lnum_new,
|
||||
long *count_new)
|
||||
diffhunk_T *hunk)
|
||||
{
|
||||
char_u *p;
|
||||
long oldline, oldcount, newline, newcount;
|
||||
@@ -3245,10 +3277,10 @@ parse_diff_unified(
|
||||
if (newline == 0)
|
||||
newline = 1;
|
||||
|
||||
*lnum_orig = oldline;
|
||||
*count_orig = oldcount;
|
||||
*lnum_new = newline;
|
||||
*count_new = newcount;
|
||||
hunk->lnum_orig = oldline;
|
||||
hunk->count_orig = oldcount;
|
||||
hunk->lnum_new = newline;
|
||||
hunk->count_new = newcount;
|
||||
|
||||
return OK;
|
||||
}
|
||||
@@ -3261,26 +3293,30 @@ parse_diff_unified(
|
||||
* Stores the diff output in a grow array.
|
||||
*/
|
||||
static int
|
||||
xdiff_out(void *priv, mmbuffer_t *mb, int nbuf)
|
||||
xdiff_out(
|
||||
long start_a,
|
||||
long count_a,
|
||||
long start_b,
|
||||
long count_b,
|
||||
void *priv)
|
||||
{
|
||||
diffout_T *dout = (diffout_T *)priv;
|
||||
char_u *p;
|
||||
diffhunk_T *p = ALLOC_ONE(diffhunk_T);
|
||||
|
||||
// The header line always comes by itself, text lines in at least two
|
||||
// parts. We drop the text part.
|
||||
if (nbuf > 1)
|
||||
return 0;
|
||||
|
||||
// sanity check
|
||||
if (STRNCMP(mb[0].ptr, "@@ ", 3) != 0)
|
||||
return 0;
|
||||
|
||||
if (ga_grow(&dout->dout_ga, 1) == FAIL)
|
||||
return -1;
|
||||
p = vim_strnsave((char_u *)mb[0].ptr, mb[0].size);
|
||||
if (p == NULL)
|
||||
return -1;
|
||||
((char_u **)dout->dout_ga.ga_data)[dout->dout_ga.ga_len++] = p;
|
||||
|
||||
if (ga_grow(&dout->dout_ga, 1) == FAIL)
|
||||
{
|
||||
vim_free(p);
|
||||
return -1;
|
||||
}
|
||||
|
||||
p->lnum_orig = start_a + 1;
|
||||
p->count_orig = count_a;
|
||||
p->lnum_new = start_b + 1;
|
||||
p->count_new = count_b;
|
||||
((diffhunk_T **)dout->dout_ga.ga_data)[dout->dout_ga.ga_len++] = p;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -2043,7 +2043,7 @@ check_digraph_chars_valid(int char1, int char2)
|
||||
}
|
||||
if (char1 == ESC || char2 == ESC)
|
||||
{
|
||||
emsg(_("E104: Escape not allowed in digraph"));
|
||||
emsg(_(e_escape_not_allowed_in_digraph));
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
@@ -2622,7 +2622,7 @@ ex_loadkeymap(exarg_T *eap)
|
||||
|
||||
if (!getline_equal(eap->getline, eap->cookie, getsourceline))
|
||||
{
|
||||
emsg(_("E105: Using :loadkeymap not in a sourced file"));
|
||||
emsg(_(e_using_loadkeymap_not_in_sourced_file));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -377,6 +377,7 @@ win_line(
|
||||
#ifdef FEAT_SIGNS
|
||||
int sign_present = FALSE;
|
||||
sign_attrs_T sattr;
|
||||
int num_attr = 0; // attribute for the number column
|
||||
#endif
|
||||
#ifdef FEAT_ARABIC
|
||||
int prev_c = 0; // previous Arabic character
|
||||
@@ -699,6 +700,8 @@ win_line(
|
||||
|
||||
#ifdef FEAT_SIGNS
|
||||
sign_present = buf_get_signattrs(wp, lnum, &sattr);
|
||||
if (sign_present)
|
||||
num_attr = sattr.sat_numhl;
|
||||
#endif
|
||||
|
||||
#ifdef LINE_ATTR
|
||||
@@ -1206,6 +1209,10 @@ win_line(
|
||||
char_attr = hl_combine_attr(wcr_attr,
|
||||
HL_ATTR(HLF_LNB));
|
||||
}
|
||||
#ifdef FEAT_SIGNS
|
||||
if (num_attr)
|
||||
char_attr = num_attr;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2251,7 +2258,7 @@ win_line(
|
||||
|
||||
// Make sure, the highlighting for the tab char will be
|
||||
// correctly set further below (effectively reverts the
|
||||
// FIX_FOR_BOGSUCOLS macro
|
||||
// FIX_FOR_BOGSUCOLS macro).
|
||||
if (n_extra == tab_len + vc_saved && wp->w_p_list
|
||||
&& wp->w_lcs_chars.tab1)
|
||||
tab_len += vc_saved;
|
||||
@@ -2931,7 +2938,7 @@ win_line(
|
||||
#if defined(FEAT_RIGHTLEFT)
|
||||
if (has_mbyte && wp->w_p_rl && (*mb_char2cells)(mb_c) > 1)
|
||||
{
|
||||
// A double-wide character is: put first halve in left cell.
|
||||
// A double-wide character is: put first half in left cell.
|
||||
--off;
|
||||
--col;
|
||||
}
|
||||
|
||||
@@ -342,6 +342,13 @@ update_screen(int type_arg)
|
||||
update_popups(win_update);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_TERMINAL
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
// If this window contains a terminal, after redrawing all windows, the
|
||||
// dirty row range can be reset.
|
||||
term_did_update_window(wp);
|
||||
#endif
|
||||
|
||||
after_updating_screen(TRUE);
|
||||
|
||||
// Clear or redraw the command line. Done last, because scrolling may
|
||||
|
||||
33
src/edit.c
33
src/edit.c
@@ -175,7 +175,7 @@ edit(
|
||||
if (textwinlock != 0 || textlock != 0
|
||||
|| ins_compl_active() || compl_busy || pum_visible())
|
||||
{
|
||||
emsg(_(e_textwinlock));
|
||||
emsg(_(e_not_allowed_to_change_text_or_change_window));
|
||||
return FALSE;
|
||||
}
|
||||
ins_compl_clear(); // clear stuff for CTRL-X mode
|
||||
@@ -598,9 +598,14 @@ edit(
|
||||
{
|
||||
c = safe_vgetc();
|
||||
|
||||
if (stop_insert_mode)
|
||||
if (stop_insert_mode
|
||||
#ifdef FEAT_TERMINAL
|
||||
|| (c == K_IGNORE && term_use_loop())
|
||||
#endif
|
||||
)
|
||||
{
|
||||
// Insert mode ended, possibly from a callback.
|
||||
// Insert mode ended, possibly from a callback, or a timer
|
||||
// must have opened a terminal window.
|
||||
if (c != K_IGNORE && c != K_NOP)
|
||||
vungetc(c);
|
||||
count = 0;
|
||||
@@ -1652,8 +1657,8 @@ decodeModifyOtherKeys(int c)
|
||||
*/
|
||||
static int pc_status;
|
||||
#define PC_STATUS_UNSET 0 // pc_bytes was not set
|
||||
#define PC_STATUS_RIGHT 1 // right halve of double-wide char
|
||||
#define PC_STATUS_LEFT 2 // left halve of double-wide char
|
||||
#define PC_STATUS_RIGHT 1 // right half of double-wide char
|
||||
#define PC_STATUS_LEFT 2 // left half of double-wide char
|
||||
#define PC_STATUS_SET 3 // pc_bytes was filled
|
||||
static char_u pc_bytes[MB_MAXBYTES + 1]; // saved bytes
|
||||
static int pc_attr;
|
||||
@@ -3975,6 +3980,9 @@ ins_bs(
|
||||
int in_indent;
|
||||
int oldState;
|
||||
int cpc[MAX_MCO]; // composing characters
|
||||
#if defined(FEAT_LISP) || defined(FEAT_CINDENT)
|
||||
int call_fix_indent = FALSE;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* can't delete anything in an empty file
|
||||
@@ -4156,7 +4164,13 @@ ins_bs(
|
||||
save_col = curwin->w_cursor.col;
|
||||
beginline(BL_WHITE);
|
||||
if (curwin->w_cursor.col < save_col)
|
||||
{
|
||||
mincol = curwin->w_cursor.col;
|
||||
#if defined(FEAT_LISP) || defined(FEAT_CINDENT)
|
||||
// should now fix the indent to match with the previous line
|
||||
call_fix_indent = TRUE;
|
||||
#endif
|
||||
}
|
||||
curwin->w_cursor.col = save_col;
|
||||
}
|
||||
|
||||
@@ -4328,6 +4342,12 @@ ins_bs(
|
||||
#endif
|
||||
if (curwin->w_cursor.col <= 1)
|
||||
did_ai = FALSE;
|
||||
|
||||
#if defined(FEAT_LISP) || defined(FEAT_CINDENT)
|
||||
if (call_fix_indent)
|
||||
fix_indent();
|
||||
#endif
|
||||
|
||||
/*
|
||||
* It's a little strange to put backspaces into the redo
|
||||
* buffer, but it makes auto-indent a lot easier to deal
|
||||
@@ -5147,7 +5167,8 @@ ins_eol(int c)
|
||||
|
||||
AppendToRedobuff(NL_STR);
|
||||
i = open_line(FORWARD,
|
||||
has_format_option(FO_RET_COMS) ? OPENLINE_DO_COM : 0, old_indent);
|
||||
has_format_option(FO_RET_COMS) ? OPENLINE_DO_COM : 0, old_indent,
|
||||
NULL);
|
||||
old_indent = 0;
|
||||
#ifdef FEAT_CINDENT
|
||||
can_cindent = TRUE;
|
||||
|
||||
885
src/errors.h
885
src/errors.h
@@ -10,6 +10,9 @@
|
||||
* Definition of error messages, sorted on error number.
|
||||
*/
|
||||
|
||||
EXTERN char e_interrupted[]
|
||||
INIT(= N_("Interrupted"));
|
||||
|
||||
EXTERN char e_backslash_should_be_followed_by[]
|
||||
INIT(= N_("E10: \\ should be followed by /, ? or &"));
|
||||
#ifdef FEAT_CMDWIN
|
||||
@@ -105,6 +108,8 @@ EXTERN char e_corrupted_regexp_program[]
|
||||
EXTERN char e_readonly_option_is_set_add_bang_to_override[]
|
||||
INIT(= N_("E45: 'readonly' option is set (add ! to override)"));
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_cannot_change_readonly_variable[]
|
||||
INIT(= N_("E46: Cannot change read-only variable"));
|
||||
EXTERN char e_cannot_change_readonly_variable_str[]
|
||||
INIT(= N_("E46: Cannot change read-only variable \"%s\""));
|
||||
#endif
|
||||
@@ -196,49 +201,905 @@ EXTERN char e_no_write_since_last_change_for_buffer_nr_add_bang_to_override[]
|
||||
INIT(= N_("E89: No write since last change for buffer %d (add ! to override)"));
|
||||
EXTERN char e_cannot_unload_last_buffer[]
|
||||
INIT(= N_("E90: Cannot unload last buffer"));
|
||||
|
||||
EXTERN char e_shell_option_is_empty[]
|
||||
INIT(= N_("E91: 'shell' option is empty"));
|
||||
EXTERN char e_buffer_nr_not_found[]
|
||||
INIT(= N_("E92: Buffer %d not found"));
|
||||
EXTERN char e_more_than_one_match_for_str[]
|
||||
INIT(= N_("E93: More than one match for %s"));
|
||||
EXTERN char e_no_matching_buffer_for_str[]
|
||||
INIT(= N_("E94: No matching buffer for %s"));
|
||||
EXTERN char e_buffer_with_this_name_already_exists[]
|
||||
INIT(= N_("E95: Buffer with this name already exists"));
|
||||
#if defined(FEAT_DIFF)
|
||||
EXTERN char e_cannot_diff_more_than_nr_buffers[]
|
||||
INIT(= N_("E96: Cannot diff more than %d buffers"));
|
||||
EXTERN char e_cannot_create_diffs[]
|
||||
INIT(= N_("E97: Cannot create diffs"));
|
||||
EXTERN char e_cannot_read_diff_output[]
|
||||
INIT(= N_("E98: Cannot read diff output"));
|
||||
EXTERN char e_current_buffer_is_not_in_diff_mode[]
|
||||
INIT(= N_("E99: Current buffer is not in diff mode"));
|
||||
EXTERN char e_no_other_buffer_in_diff_mode[]
|
||||
INIT(= N_("E100: No other buffer in diff mode"));
|
||||
EXTERN char e_more_than_two_buffers_in_diff_mode_dont_know_which_one_to_use[]
|
||||
INIT(= N_("E101: More than two buffers in diff mode, don't know which one to use"));
|
||||
EXTERN char e_cant_find_buffer_str[]
|
||||
INIT(= N_("E102: Can't find buffer \"%s\""));
|
||||
EXTERN char e_buffer_str_is_not_in_diff_mode[]
|
||||
INIT(= N_("E103: Buffer \"%s\" is not in diff mode"));
|
||||
#endif
|
||||
EXTERN char e_escape_not_allowed_in_digraph[]
|
||||
INIT(= N_("E104: Escape not allowed in digraph"));
|
||||
EXTERN char e_using_loadkeymap_not_in_sourced_file[]
|
||||
INIT(= N_("E105: Using :loadkeymap not in a sourced file"));
|
||||
// E106 unused
|
||||
EXTERN char e_missing_parenthesis_str[]
|
||||
INIT(= N_("E107: Missing parentheses: %s"));
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_no_such_variable_str[]
|
||||
INIT(= N_("E108: No such variable: \"%s\""));
|
||||
EXTERN char e_missing_colon_after_questionmark[]
|
||||
INIT(= N_("E109: Missing ':' after '?'"));
|
||||
EXTERN char e_missing_closing_paren[]
|
||||
INIT(= N_("E110: Missing ')'"));
|
||||
EXTERN char e_missing_closing_square_brace[]
|
||||
INIT(= N_("E111: Missing ']'"));
|
||||
#endif
|
||||
EXTERN char e_option_name_missing_str[]
|
||||
INIT(= N_("E112: Option name missing: %s"));
|
||||
EXTERN char e_unknown_option_str[]
|
||||
INIT(= N_("E113: Unknown option: %s"));
|
||||
EXTERN char e_missing_double_quote_str[]
|
||||
INIT(= N_("E114: Missing double quote: %s"));
|
||||
EXTERN char e_missing_single_quote_str[]
|
||||
INIT(= N_("E115: Missing single quote: %s"));
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_invalid_arguments_for_function_str[]
|
||||
INIT(= N_("E116: Invalid arguments for function %s"));
|
||||
EXTERN char e_unknown_function_str[]
|
||||
INIT(= N_("E117: Unknown function: %s"));
|
||||
EXTERN char e_too_many_arguments_for_function_str[]
|
||||
INIT(= N_("E118: Too many arguments for function: %s"));
|
||||
EXTERN char e_not_enough_arguments_for_function_str[]
|
||||
INIT(= N_("E119: Not enough arguments for function: %s"));
|
||||
EXTERN char e_using_sid_not_in_script_context_str[]
|
||||
INIT(= N_("E120: Using <SID> not in a script context: %s"));
|
||||
EXTERN char e_undefined_variable_str[]
|
||||
INIT(= N_("E121: Undefined variable: %s"));
|
||||
EXTERN char e_undefined_variable_char_str[]
|
||||
INIT(= N_("E121: Undefined variable: %c:%s"));
|
||||
EXTERN char e_function_str_already_exists_add_bang_to_replace[]
|
||||
INIT(= N_("E122: Function %s already exists, add ! to replace it"));
|
||||
EXTERN char e_undefined_function_str[]
|
||||
INIT(= N_("E123: Undefined function: %s"));
|
||||
EXTERN char e_missing_paren_str[]
|
||||
INIT(= N_("E124: Missing '(': %s"));
|
||||
EXTERN char e_illegal_argument_str[]
|
||||
INIT(= N_("E125: Illegal argument: %s"));
|
||||
EXTERN char e_missing_endfunction[]
|
||||
INIT(= N_("E126: Missing :endfunction"));
|
||||
EXTERN char e_cannot_redefine_function_str_it_is_in_use[]
|
||||
INIT(= N_("E127: Cannot redefine function %s: It is in use"));
|
||||
EXTERN char e_function_name_must_start_with_capital_or_s_str[]
|
||||
INIT(= N_("E128: Function name must start with a capital or \"s:\": %s"));
|
||||
EXTERN char e_function_name_required[]
|
||||
INIT(= N_("E129: Function name required"));
|
||||
// E130 unused
|
||||
EXTERN char e_cannot_delete_function_str_it_is_in_use[]
|
||||
INIT(= N_("E131: Cannot delete function %s: It is in use"));
|
||||
EXTERN char e_function_call_depth_is_higher_than_macfuncdepth[]
|
||||
INIT(= N_("E132: Function call depth is higher than 'maxfuncdepth'"));
|
||||
EXTERN char e_return_not_inside_function[]
|
||||
INIT(= N_("E133: :return not inside a function"));
|
||||
#endif
|
||||
EXTERN char e_cannot_move_range_of_lines_into_itself[]
|
||||
INIT(= N_("E134: Cannot move a range of lines into itself"));
|
||||
EXTERN char e_filter_autocommands_must_not_change_current_buffer[]
|
||||
INIT(= N_("E135: *Filter* Autocommands must not change current buffer"));
|
||||
#if defined(FEAT_VIMINFO)
|
||||
EXTERN char e_viminfo_too_many_errors_skipping_rest_of_file[]
|
||||
INIT(= N_("E136: viminfo: Too many errors, skipping rest of file"));
|
||||
EXTERN char e_viminfo_file_is_not_writable_str[]
|
||||
INIT(= N_("E137: Viminfo file is not writable: %s"));
|
||||
EXTERN char e_cant_write_viminfo_file_str[]
|
||||
INIT(= N_("E138: Can't write viminfo file %s!"));
|
||||
#endif
|
||||
EXTERN char e_file_is_loaded_in_another_buffer[]
|
||||
INIT(= N_("E139: File is loaded in another buffer"));
|
||||
EXTERN char e_use_bang_to_write_partial_buffer[]
|
||||
INIT(= N_("E140: Use ! to write partial buffer"));
|
||||
EXTERN char e_no_file_name_for_buffer_nr[]
|
||||
INIT(= N_("E141: No file name for buffer %ld"));
|
||||
EXTERN char e_file_not_written_writing_is_disabled_by_write_option[]
|
||||
INIT(= N_("E142: File not written: Writing is disabled by 'write' option"));
|
||||
EXTERN char e_autocommands_unexpectedly_deleted_new_buffer_str[]
|
||||
INIT(= N_("E143: Autocommands unexpectedly deleted new buffer %s"));
|
||||
EXTERN char e_non_numeric_argument_to_z[]
|
||||
INIT(= N_("E144: non-numeric argument to :z"));
|
||||
EXTERN char e_shell_commands_and_some_functionality_not_allowed_in_rvim[]
|
||||
INIT(= N_("E145: Shell commands and some functionality not allowed in rvim"));
|
||||
EXTERN char e_regular_expressions_cant_be_delimited_by_letters[]
|
||||
INIT(= N_("E146: Regular expressions can't be delimited by letters"));
|
||||
EXTERN char e_cannot_do_global_recursive_with_range[]
|
||||
INIT(= N_("E147: Cannot do :global recursive with a range"));
|
||||
EXTERN char e_regular_expression_missing_from_global[]
|
||||
INIT(= N_("E148: Regular expression missing from :global"));
|
||||
EXTERN char e_sorry_no_help_for_str[]
|
||||
INIT(= N_("E149: Sorry, no help for %s"));
|
||||
EXTERN char e_not_a_directory_str[]
|
||||
INIT(= N_("E150: Not a directory: %s"));
|
||||
EXTERN char e_no_match_str_1[]
|
||||
INIT(= N_("E151: No match: %s"));
|
||||
EXTERN char e_cannot_open_str_for_writing_1[]
|
||||
INIT(= N_("E152: Cannot open %s for writing"));
|
||||
EXTERN char e_unable_to_open_str_for_reading[]
|
||||
INIT(= N_("E153: Unable to open %s for reading"));
|
||||
EXTERN char e_duplicate_tag_str_in_file_str_str[]
|
||||
INIT(= N_("E154: Duplicate tag \"%s\" in file %s/%s"));
|
||||
EXTERN char e_unknown_sign_str[]
|
||||
INIT(= N_("E155: Unknown sign: %s"));
|
||||
EXTERN char e_missing_sign_name[]
|
||||
INIT(= N_("E156: Missing sign name"));
|
||||
EXTERN char e_invalid_sign_id_nr[]
|
||||
INIT(= N_("E157: Invalid sign ID: %d"));
|
||||
EXTERN char e_invalid_buffer_name_str[]
|
||||
INIT(= N_("E158: Invalid buffer name: %s"));
|
||||
EXTERN char e_missing_sign_number[]
|
||||
INIT(= N_("E159: Missing sign number"));
|
||||
EXTERN char e_unknown_sign_command_str[]
|
||||
INIT(= N_("E160: Unknown sign command: %s"));
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_breakpoint_not_found_str[]
|
||||
INIT(= N_("E161: Breakpoint not found: %s"));
|
||||
#endif
|
||||
EXTERN char e_no_write_since_last_change_for_buffer_str[]
|
||||
INIT(= N_("E162: No write since last change for buffer \"%s\""));
|
||||
EXTERN char e_there_is_only_one_file_to_edit[]
|
||||
INIT(= N_("E163: There is only one file to edit"));
|
||||
EXTERN char e_cannot_go_before_first_file[]
|
||||
INIT(= N_("E164: Cannot go before first file"));
|
||||
EXTERN char e_cannot_go_beyond_last_file[]
|
||||
INIT(= N_("E165: Cannot go beyond last file"));
|
||||
EXTERN char e_cant_open_linked_file_for_writing[]
|
||||
INIT(= N_("E166: Can't open linked file for writing"));
|
||||
EXTERN char e_scriptencoding_used_outside_of_sourced_file[]
|
||||
INIT(= N_("E167: :scriptencoding used outside of a sourced file"));
|
||||
EXTERN char e_finish_used_outside_of_sourced_file[]
|
||||
INIT(= N_("E168: :finish used outside of a sourced file"));
|
||||
EXTERN char e_command_too_recursive[]
|
||||
INIT(= N_("E169: Command too recursive"));
|
||||
EXTERN char e_missing_endwhile[]
|
||||
INIT(= N_("E170: Missing :endwhile"));
|
||||
EXTERN char e_missing_endfor[]
|
||||
INIT(= N_("E170: Missing :endfor"));
|
||||
EXTERN char e_missing_endif[]
|
||||
INIT(= N_("E171: Missing :endif"));
|
||||
EXTERN char e_missing_marker[]
|
||||
INIT(= N_("E172: Missing marker"));
|
||||
EXTERN char e_nr_more_file_to_edit[]
|
||||
INIT(= N_("E173: %d more file to edit"));
|
||||
EXTERN char e_nr_more_files_to_edit[]
|
||||
INIT(= N_("E173: %d more files to edit"));
|
||||
EXTERN char e_command_already_exists_add_bang_to_replace_it_str[]
|
||||
INIT(= N_("E174: Command already exists: add ! to replace it: %s"));
|
||||
EXTERN char e_no_attribute_specified[]
|
||||
INIT(= N_("E175: No attribute specified"));
|
||||
EXTERN char e_invalid_number_of_arguments[]
|
||||
INIT(= N_("E176: Invalid number of arguments"));
|
||||
EXTERN char e_count_cannot_be_specified_twice[]
|
||||
INIT(= N_("E177: Count cannot be specified twice"));
|
||||
EXTERN char e_invalid_default_value_for_count[]
|
||||
INIT(= N_("E178: Invalid default value for count"));
|
||||
EXTERN char e_argument_required_for_str[]
|
||||
INIT(= N_("E179: argument required for %s"));
|
||||
EXTERN char e_invalid_complete_value_str[]
|
||||
INIT(= N_("E180: Invalid complete value: %s"));
|
||||
EXTERN char e_invalid_attribute_str[]
|
||||
INIT(= N_("E181: Invalid attribute: %s"));
|
||||
EXTERN char e_invalid_command_name[]
|
||||
INIT(= N_("E182: Invalid command name"));
|
||||
EXTERN char e_user_defined_commands_must_start_with_an_uppercase_letter[]
|
||||
INIT(= N_("E183: User defined commands must start with an uppercase letter"));
|
||||
EXTERN char e_no_such_user_defined_command_str[]
|
||||
INIT(= N_("E184: No such user-defined command: %s"));
|
||||
EXTERN char e_cannot_find_color_scheme_str[]
|
||||
INIT(= N_("E185: Cannot find color scheme '%s'"));
|
||||
EXTERN char e_no_previous_directory[]
|
||||
INIT(= N_("E186: No previous directory"));
|
||||
EXTERN char e_directory_unknown[]
|
||||
INIT(= N_("E187: Directory unknown"));
|
||||
EXTERN char e_obtaining_window_position_not_implemented_for_this_platform[]
|
||||
INIT(= N_("E188: Obtaining window position not implemented for this platform"));
|
||||
EXTERN char e_str_exists_add_bang_to_override[]
|
||||
INIT(= N_("E189: \"%s\" exists (add ! to override)"));
|
||||
EXTERN char e_cannot_open_str_for_writing_2[]
|
||||
INIT(= N_("E190: Cannot open \"%s\" for writing"));
|
||||
EXTERN char e_argument_must_be_letter_or_forward_backward_quote[]
|
||||
INIT(= N_("E191: Argument must be a letter or forward/backward quote"));
|
||||
EXTERN char e_recursive_use_of_normal_too_deep[]
|
||||
INIT(= N_("E192: Recursive use of :normal too deep"));
|
||||
EXTERN char e_str_not_inside_function[]
|
||||
INIT(= N_("E193: %s not inside a function"));
|
||||
EXTERN char e_no_alternate_file_name_to_substitute_for_hash[]
|
||||
INIT(= N_("E194: No alternate file name to substitute for '#'"));
|
||||
EXTERN char e_cannot_open_viminfo_file_for_reading[]
|
||||
INIT(= N_("E195: Cannot open viminfo file for reading"));
|
||||
#ifndef FEAT_DIGRAPHS
|
||||
EXTERN char e_no_digraphs_version[]
|
||||
INIT(= N_("E196: No digraphs in this version"));
|
||||
#endif
|
||||
EXTERN char e_cannot_set_language_to_str[]
|
||||
INIT(= N_("E197: Cannot set language to \"%s\""));
|
||||
// E198 unused
|
||||
EXTERN char e_active_window_or_buffer_deleted[]
|
||||
INIT(= N_("E199: Active window or buffer deleted"));
|
||||
EXTERN char e_readpre_autocommands_made_file_unreadable[]
|
||||
INIT(= N_("E200: *ReadPre autocommands made the file unreadable"));
|
||||
EXTERN char e_readpre_autocommands_must_not_change_current_buffer[]
|
||||
INIT(= N_("E201: *ReadPre autocommands must not change current buffer"));
|
||||
EXTERN char e_conversion_mad_file_unreadable[]
|
||||
INIT(= N_("E202: Conversion made file unreadable!"));
|
||||
EXTERN char e_autocommands_deleted_or_unloaded_buffer_to_be_written[]
|
||||
INIT(= N_("E203: Autocommands deleted or unloaded buffer to be written"));
|
||||
EXTERN char e_autocommands_changed_number_of_lines_in_unexpected_way[]
|
||||
INIT(= N_("E204: Autocommand changed number of lines in unexpected way"));
|
||||
EXTERN char e_patchmode_cant_save_original_file[]
|
||||
INIT(= N_("E205: Patchmode: can't save original file"));
|
||||
EXTERN char e_patchmode_cant_touch_empty_original_file[]
|
||||
INIT(= N_("E206: patchmode: can't touch empty original file"));
|
||||
EXTERN char e_cant_delete_backup_file[]
|
||||
INIT(= N_("E207: Can't delete backup file"));
|
||||
EXTERN char e_error_writing_to_str[]
|
||||
INIT(= N_("E208: Error writing to \"%s\""));
|
||||
EXTERN char e_error_closing_str[]
|
||||
INIT(= N_("E209: Error closing \"%s\""));
|
||||
EXTERN char e_error_reading_str[]
|
||||
INIT(= N_("E210: Error reading \"%s\""));
|
||||
EXTERN char e_file_str_no_longer_available[]
|
||||
INIT(= N_("E211: File \"%s\" no longer available"));
|
||||
EXTERN char e_cant_open_file_for_writing[]
|
||||
INIT(= N_("E212: Can't open file for writing"));
|
||||
EXTERN char e_cannot_convert_add_bang_to_write_without_conversion[]
|
||||
INIT(= N_("E213: Cannot convert (add ! to write without conversion)"));
|
||||
EXTERN char e_cant_find_temp_file_for_writing[]
|
||||
INIT(= N_("E214: Can't find temp file for writing"));
|
||||
EXTERN char e_illegal_character_after_star_str[]
|
||||
INIT(= N_("E215: Illegal character after *: %s"));
|
||||
EXTERN char e_no_such_event_str[]
|
||||
INIT(= N_("E216: No such event: %s"));
|
||||
EXTERN char e_no_such_group_or_event_str[]
|
||||
INIT(= N_("E216: No such group or event: %s"));
|
||||
EXTERN char e_cant_execute_autocommands_for_all_events[]
|
||||
INIT(= N_("E217: Can't execute autocommands for ALL events"));
|
||||
EXTERN char e_autocommand_nesting_too_deep[]
|
||||
INIT(= N_("E218: autocommand nesting too deep"));
|
||||
EXTERN char e_missing_open_curly[]
|
||||
INIT(= N_("E219: Missing {."));
|
||||
EXTERN char e_missing_close_curly[]
|
||||
INIT(= N_("E220: Missing }."));
|
||||
EXTERN char e_marker_cannot_start_with_lower_case_letter[]
|
||||
INIT(= N_("E221: Marker cannot start with lower case letter"));
|
||||
EXTERN char e_add_to_internal_buffer_that_was_already_read_from[]
|
||||
INIT(= N_("E222: Add to internal buffer that was already read from"));
|
||||
EXTERN char e_recursive_mapping[]
|
||||
INIT(= N_("E223: recursive mapping"));
|
||||
EXTERN char e_global_abbreviation_already_exists_for_str[]
|
||||
INIT(= N_("E224: global abbreviation already exists for %s"));
|
||||
EXTERN char e_global_mapping_already_exists_for_str[]
|
||||
INIT(= N_("E225: global mapping already exists for %s"));
|
||||
EXTERN char e_abbreviation_already_exists_for_str[]
|
||||
INIT(= N_("E226: abbreviation already exists for %s"));
|
||||
EXTERN char e_mapping_already_exists_for_str[]
|
||||
INIT(= N_("E227: mapping already exists for %s"));
|
||||
EXTERN char e_makemap_illegal_mode[]
|
||||
INIT(= N_("E228: makemap: Illegal mode"));
|
||||
#ifdef FEAT_GUI
|
||||
EXTERN char e_cannot_start_the_GUI[]
|
||||
INIT(= N_("E229: Cannot start the GUI"));
|
||||
EXTERN char e_cannot_read_from_str[]
|
||||
INIT(= N_("E230: Cannot read from \"%s\""));
|
||||
EXTERN char e_guifontwide_invalid[]
|
||||
INIT(= N_("E231: 'guifontwide' invalid"));
|
||||
EXTERN char e_cannot_create_ballooneval_with_both_message_and_callback[]
|
||||
INIT(= N_("E232: Cannot create BalloonEval with both message and callback"));
|
||||
# if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
|
||||
EXTERN char e_cannot_open_display[]
|
||||
INIT(= N_("E233: cannot open display"));
|
||||
# endif
|
||||
# if defined(FEAT_XFONTSET)
|
||||
EXTERN char e_unknown_fontset_str[]
|
||||
INIT(= N_("E234: Unknown fontset: %s"));
|
||||
# endif
|
||||
# if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) \
|
||||
|| defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_HAIKU)
|
||||
EXTERN char e_unknown_font_str[]
|
||||
INIT(= N_("E235: Unknown font: %s"));
|
||||
# endif
|
||||
# if defined(FEAT_GUI_X11) && !defined(FEAT_GUI_GTK)
|
||||
EXTERN char e_font_str_is_not_fixed_width[]
|
||||
INIT(= N_("E236: Font \"%s\" is not fixed-width"));
|
||||
# endif
|
||||
#endif
|
||||
#ifdef MSWIN
|
||||
EXTERN char e_printer_selection_failed[]
|
||||
INIT(= N_("E237: Printer selection failed"));
|
||||
EXTERN char e_print_error_str[]
|
||||
INIT(= N_("E238: Print error: %s"));
|
||||
#endif
|
||||
EXTERN char e_invalid_sign_text_str[]
|
||||
INIT(= N_("E239: Invalid sign text: %s"));
|
||||
#if defined(FEAT_CLIENTSERVER) && defined(FEAT_X11)
|
||||
EXTERN char e_no_connection_to_x_server[]
|
||||
INIT(= N_("E240: No connection to the X server"));
|
||||
#endif
|
||||
#ifdef FEAT_CLIENTSERVER
|
||||
EXTERN char e_unable_to_send_to_str[]
|
||||
INIT(= N_("E241: Unable to send to %s"));
|
||||
#endif
|
||||
EXTERN char e_cant_split_window_while_closing_another[]
|
||||
INIT(= N_("E242: Can't split a window while closing another"));
|
||||
#if defined(FEAT_GUI_MSWIN) && !defined(FEAT_OLE)
|
||||
EXTERN char e_argument_not_supported_str_use_ole_version[]
|
||||
INIT(= N_("E243: Argument not supported: \"-%s\"; Use the OLE version."));
|
||||
#endif
|
||||
#ifdef MSWIN
|
||||
EXTERN char e_illegal_str_name_str_in_font_name_str[]
|
||||
INIT(= N_("E244: Illegal %s name \"%s\" in font name \"%s\""));
|
||||
EXTERN char e_illegal_char_nr_in_font_name_str[]
|
||||
INIT(= N_("E245: Illegal char '%c' in font name \"%s\""));
|
||||
#endif
|
||||
EXTERN char e_filechangedshell_autocommand_deleted_buffer[]
|
||||
INIT(= N_("E246: FileChangedShell autocommand deleted buffer"));
|
||||
#ifdef FEAT_CLIENTSERVER
|
||||
EXTERN char e_no_registered_server_named_str[]
|
||||
INIT(= N_("E247: no registered server named \"%s\""));
|
||||
EXTERN char e_failed_to_send_command_to_destination_program[]
|
||||
INIT(= N_("E248: Failed to send command to the destination program"));
|
||||
#endif
|
||||
EXTERN char e_window_layout_changed_unexpectedly[]
|
||||
INIT(= N_("E249: window layout changed unexpectedly"));
|
||||
#ifdef FEAT_XFONTSET
|
||||
EXTERN char e_fonts_for_the_following_charsets_are_missing_in_fontset[]
|
||||
INIT(= N_("E250: Fonts for the following charsets are missing in fontset %s:"));
|
||||
#endif
|
||||
#ifdef FEAT_CLIENTSERVER
|
||||
EXTERN char e_vim_instance_registry_property_is_badly_formed_deleted[]
|
||||
INIT(= N_("E251: VIM instance registry property is badly formed. Deleted!"));
|
||||
#endif
|
||||
#ifdef FEAT_GUI_X11
|
||||
EXTERN char e_fontsent_name_str_font_str_is_not_fixed_width[]
|
||||
INIT(= N_("E252: Fontset name: %s - Font '%s' is not fixed-width"));
|
||||
EXTERN char e_fontset_name_str[]
|
||||
INIT(= N_("E253: Fontset name: %s"));
|
||||
#endif
|
||||
#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
|
||||
EXTERN char e_cannot_allocate_color_str[]
|
||||
INIT(= N_("E254: Cannot allocate color %s"));
|
||||
#endif
|
||||
#if defined(FEAT_SIGN_ICONS) && !defined(FEAT_GUI_GTK)
|
||||
EXTERN char e_couldnt_read_in_sign_data[]
|
||||
INIT(= N_("E255: Couldn't read in sign data"));
|
||||
#endif
|
||||
// E256 unused
|
||||
EXTERN char e_cstag_tag_not_founc[]
|
||||
INIT(= N_("E257: cstag: tag not found"));
|
||||
#ifdef FEAT_CLIENTSERVER
|
||||
EXTERN char e_unable_to_send_to_client[]
|
||||
INIT(= N_("E258: Unable to send to client"));
|
||||
#endif
|
||||
#ifdef FEAT_CSCOPE
|
||||
EXTERN char e_no_matches_found_for_cscope_query_str_of_str[]
|
||||
INIT(= N_("E259: no matches found for cscope query %s of %s"));
|
||||
#endif
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_missing_name_after_method[]
|
||||
INIT(= N_("E260: Missing name after ->"));
|
||||
#endif
|
||||
#ifdef FEAT_CSCOPE
|
||||
EXTERN char e_cscope_connection_str_not_founc[]
|
||||
INIT(= N_("E261: cscope connection %s not found"));
|
||||
EXTERN char e_error_reading_cscope_connection_nr[]
|
||||
INIT(= N_("E262: error reading cscope connection %d"));
|
||||
#endif
|
||||
#if defined(DYNAMIC_PYTHON) || defined(DYNAMIC_PYTHON3)
|
||||
EXTERN char e_sorry_this_command_is_disabled_python_library_could_not_be_found[]
|
||||
INIT(= N_("E263: Sorry, this command is disabled, the Python library could not be loaded."));
|
||||
#endif
|
||||
#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
|
||||
EXTERN char e_python_error_initialising_io_object[]
|
||||
INIT(= N_("E264: Python: Error initialising I/O objects"));
|
||||
#endif
|
||||
#ifdef FEAT_RUBY
|
||||
EXTERN char e_dollar_must_be_an_instance_of_string[]
|
||||
INIT(= N_("E265: $_ must be an instance of String"));
|
||||
#endif
|
||||
#ifdef DYNAMIC_RUBY
|
||||
EXTERN char e_sorry_this_command_is_disabled_the_ruby_library_could_not_be_loaded[]
|
||||
INIT(= N_("E266: Sorry, this command is disabled, the Ruby library could not be loaded."));
|
||||
#endif
|
||||
#ifdef FEAT_RUBY
|
||||
EXTERN char e_unexpected_return[]
|
||||
INIT(= N_("E267: unexpected return"));
|
||||
EXTERN char e_unexpected_next[]
|
||||
INIT(= N_("E268: unexpected next"));
|
||||
EXTERN char e_unexpected_break[]
|
||||
INIT(= N_("E269: unexpected break"));
|
||||
EXTERN char e_unexpected_redo[]
|
||||
INIT(= N_("E270: unexpected redo"));
|
||||
EXTERN char e_retry_outside_of_rescue_clause[]
|
||||
INIT(= N_("E271: retry outside of rescue clause"));
|
||||
EXTERN char e_unhandled_exception[]
|
||||
INIT(= N_("E272: unhandled exception"));
|
||||
EXTERN char e_unknown_longjmp_status_nr[]
|
||||
INIT(= N_("E273: unknown longjmp status %d"));
|
||||
#endif
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_no_white_space_allowed_before_parenthesis[]
|
||||
INIT(= N_("E274: No white space allowed before parenthesis"));
|
||||
#endif
|
||||
#ifdef FEAT_PROP_POPUP
|
||||
EXTERN char e_cannot_add_text_property_to_unloaded_buffer[]
|
||||
INIT(= N_("E275: Cannot add text property to unloaded buffer"));
|
||||
#endif
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_cannot_use_function_as_method_str[]
|
||||
INIT(= N_("E276: Cannot use function as a method: %s"));
|
||||
#endif
|
||||
#ifdef FEAT_CLIENTSERVER
|
||||
EXTERN char e_unable_to_read_server_reply[]
|
||||
INIT(= N_("E277: Unable to read a server reply"));
|
||||
#endif
|
||||
#ifdef FEAT_TERMINAL
|
||||
EXTERN char e_sorry_plusplusshell_not_supported_on_this_system[]
|
||||
INIT(= N_("E279: Sorry, ++shell is not supported on this system"));
|
||||
#endif
|
||||
#ifdef FEAT_TCL
|
||||
EXTERN char e_tcl_fatal_error_reflist_corrupt_please_report_this[]
|
||||
INIT(= N_("E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim.org"));
|
||||
#endif
|
||||
// E281 unused
|
||||
EXTERN char e_cannot_read_from_str_2[]
|
||||
INIT(= N_("E282: Cannot read from \"%s\""));
|
||||
EXTERN char e_no_marks_matching_str[]
|
||||
INIT(= N_("E283: No marks matching \"%s\""));
|
||||
#ifdef FEAT_XIM
|
||||
EXTERN char e_cannot_set_ic_values[]
|
||||
INIT(= N_("E284: Cannot set IC values"));
|
||||
# if defined(FEAT_GUI_X11)
|
||||
EXTERN char e_failed_to_create_input_context[]
|
||||
INIT(= N_("E285: Failed to create input context"));
|
||||
# endif
|
||||
EXTERN char e_failed_to_open_input_method[]
|
||||
INIT(= N_("E286: Failed to open input method"));
|
||||
EXTERN char e_warning_could_not_set_destroy_callback_to_im[]
|
||||
INIT(= N_("E287: Warning: Could not set destroy callback to IM"));
|
||||
EXTERN char e_input_method_doesnt_support_any_style[]
|
||||
INIT(= N_("E288: input method doesn't support any style"));
|
||||
EXTERN char e_input_method_doesnt_support_my_preedit_type[]
|
||||
INIT(= N_("E289: input method doesn't support my preedit type"));
|
||||
#endif
|
||||
#ifdef FEAT_SEARCH_EXTRA
|
||||
EXTERN char e_list_or_number_required[]
|
||||
INIT(= N_("E290: List or number required"));
|
||||
#endif
|
||||
// E291 unused
|
||||
EXTERN char e_invalid_count_for_del_bytes_nr[]
|
||||
INIT(= N_("E292: Invalid count for del_bytes(): %ld"));
|
||||
EXTERN char e_block_was_not_locked[]
|
||||
INIT(= N_("E293: block was not locked"));
|
||||
EXTERN char e_seek_error_in_swap_file_read[]
|
||||
INIT(= N_("E294: Seek error in swap file read"));
|
||||
EXTERN char e_read_error_in_swap_file[]
|
||||
INIT(= N_("E295: Read error in swap file"));
|
||||
EXTERN char e_seek_error_in_swap_file_write[]
|
||||
INIT(= N_("E296: Seek error in swap file write"));
|
||||
EXTERN char e_write_error_in_swap_file[]
|
||||
INIT(= N_("E297: Write error in swap file"));
|
||||
EXTERN char e_didnt_get_block_nr_zero[]
|
||||
INIT(= N_("E298: Didn't get block nr 0?"));
|
||||
EXTERN char e_didnt_get_block_nr_one[]
|
||||
INIT(= N_("E298: Didn't get block nr 1?"));
|
||||
EXTERN char e_didnt_get_block_nr_two[]
|
||||
INIT(= N_("E298: Didn't get block nr 2?"));
|
||||
// E299 unused
|
||||
|
||||
#ifdef FEAT_MENU
|
||||
EXTERN char e_menu_only_exists_in_another_mode[]
|
||||
INIT(= N_("E328: Menu only exists in another mode"));
|
||||
#endif
|
||||
EXTERN char e_internal_error_lalloc_zero[]
|
||||
INIT(= N_("E341: Internal error: lalloc(0, )"));
|
||||
EXTERN char e_out_of_memory_allocating_nr_bytes[]
|
||||
INIT(= N_("E342: Out of memory! (allocating %lu bytes)"));
|
||||
#if defined(AMIGA) || defined(MACOS_X) || defined(MSWIN) \
|
||||
|| defined(UNIX) || defined(VMS)
|
||||
EXTERN char e_screen_mode_setting_not_supported[]
|
||||
INIT(= N_("E359: Screen mode setting not supported"));
|
||||
#endif
|
||||
EXTERN char e_pattern_uses_more_memory_than_maxmempattern[]
|
||||
INIT(= N_("E363: pattern uses more memory than 'maxmempattern'"));
|
||||
#ifdef FEAT_LIBCALL
|
||||
EXTERN char e_library_call_failed_for_str[]
|
||||
INIT(= N_("E364: Library call failed for \"%s()\""));
|
||||
#endif
|
||||
EXTERN char e_no_such_group_str[]
|
||||
INIT(= N_("E367: No such group: \"%s\""));
|
||||
#ifdef USING_LOAD_LIBRARY
|
||||
EXTERN char e_could_not_load_library_str_str[]
|
||||
INIT(= N_("E370: Could not load library %s: %s"));
|
||||
#endif
|
||||
EXTERN char e_cannot_write_buftype_option_is_set[]
|
||||
INIT(= N_("E382: Cannot write, 'buftype' option is set"));
|
||||
|
||||
#ifdef USING_LOAD_LIBRARY
|
||||
EXTERN char e_could_not_load_library_function_str[]
|
||||
INIT(= N_("E448: Could not load library function %s"));
|
||||
#endif
|
||||
#ifdef FEAT_CLIENTSERVER
|
||||
EXTERN char e_invalid_expression_received[]
|
||||
INIT(= N_("E449: Invalid expression received"));
|
||||
#endif
|
||||
#if defined(UNIX) || defined(FEAT_SESSION)
|
||||
EXTERN char e_cannot_go_back_to_previous_directory[]
|
||||
INIT(= N_("E459: Cannot go back to previous directory"));
|
||||
#endif
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_illegal_variable_name_str[]
|
||||
INIT(= N_("E461: Illegal variable name: %s"));
|
||||
#endif
|
||||
#ifdef FEAT_NETBEANS_INTG
|
||||
EXTERN char e_region_is_guarded_cannot_modify[]
|
||||
INIT(= N_("E463: Region is guarded, cannot modify"));
|
||||
#endif
|
||||
EXTERN char e_ambiguous_use_of_user_defined_command[]
|
||||
INIT(= N_("E464: Ambiguous use of user-defined command"));
|
||||
EXTERN char e_command_aborted[]
|
||||
INIT(= N_("E470: Command aborted"));
|
||||
EXTERN char e_argument_required[]
|
||||
INIT(= N_("E471: Argument required"));
|
||||
EXTERN char e_command_failed[]
|
||||
INIT(= N_("E472: Command failed"));
|
||||
EXTERN char e_internal_error_in_regexp[]
|
||||
INIT(= N_("E473: Internal error in regexp"));
|
||||
EXTERN char e_invalid_argument[]
|
||||
INIT(= N_("E474: Invalid argument"));
|
||||
EXTERN char e_invalid_argument_str[]
|
||||
INIT(= N_("E475: Invalid argument: %s"));
|
||||
EXTERN char e_invalid_value_for_argument_str[]
|
||||
INIT(= N_("E475: Invalid value for argument %s"));
|
||||
EXTERN char e_invalid_value_for_argument_str_str[]
|
||||
INIT(= N_("E475: Invalid value for argument %s: %s"));
|
||||
EXTERN char e_invalid_command[]
|
||||
INIT(= N_("E476: Invalid command"));
|
||||
EXTERN char e_no_bang_allowed[]
|
||||
INIT(= N_("E477: No ! allowed"));
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_invalid_command_str[]
|
||||
INIT(= N_("E476: Invalid command: %s"));
|
||||
#endif
|
||||
EXTERN char e_cant_create_file_str[]
|
||||
INIT(= N_("E482: Can't create file %s"));
|
||||
EXTERN char e_cant_get_temp_file_name[]
|
||||
INIT(= N_("E483: Can't get temp file name"));
|
||||
EXTERN char e_cant_open_file_str[]
|
||||
INIT(= N_("E484: Can't open file %s"));
|
||||
EXTERN char e_cant_read_file_str[]
|
||||
INIT(= N_("E485: Can't read file %s"));
|
||||
EXTERN char e_pattern_not_found[]
|
||||
INIT(= N_("E486: Pattern not found"));
|
||||
EXTERN char e_pattern_not_found_str[]
|
||||
INIT(= N_("E486: Pattern not found: %s"));
|
||||
EXTERN char e_argument_must_be_positive[]
|
||||
INIT(= N_("E487: Argument must be positive"));
|
||||
EXTERN char e_no_match[]
|
||||
INIT(= N_("E479: No match"));
|
||||
EXTERN char e_no_match_str_2[]
|
||||
INIT(= N_("E480: No match: %s"));
|
||||
EXTERN char e_no_range_allowed[]
|
||||
INIT(= N_("E481: No range allowed"));
|
||||
EXTERN char e_trailing_characters[]
|
||||
INIT(= N_("E488: Trailing characters"));
|
||||
EXTERN char e_trailing_characters_str[]
|
||||
INIT(= N_("E488: Trailing characters: %s"));
|
||||
|
||||
// E502
|
||||
EXTERN char e_is_a_directory[]
|
||||
INIT(= N_("is a directory"));
|
||||
// E503
|
||||
EXTERN char e_is_not_file_or_writable_device[]
|
||||
INIT(= N_("is not a file or writable device"));
|
||||
|
||||
// E504
|
||||
EXTERN char e_is_read_only_cannot_override_W_in_cpoptions[]
|
||||
INIT(= N_("is read-only (cannot override: \"W\" in 'cpoptions')"));
|
||||
// E505
|
||||
EXTERN char e_is_read_only_add_bang_to_override[]
|
||||
INIT(= N_("is read-only (add ! to override)"));
|
||||
EXTERN char e_canot_write_to_backup_file_add_bang_to_override[]
|
||||
INIT(= N_("E506: Can't write to backup file (add ! to override)"));
|
||||
EXTERN char e_close_error_for_backup_file_add_bang_to_write_anyway[]
|
||||
INIT(= N_("E507: Close error for backup file (add ! to write anyway)"));
|
||||
EXTERN char e_cant_read_file_for_backup_add_bang_to_write_anyway[]
|
||||
INIT(= N_("E508: Can't read file for backup (add ! to write anyway)"));
|
||||
EXTERN char e_cannot_create_backup_file_add_bang_to_write_anyway[]
|
||||
INIT(= N_("E509: Cannot create backup file (add ! to override)"));
|
||||
EXTERN char e_cant_make_backup_file_add_bang_to_write_anyway[]
|
||||
INIT(= N_("E510: Can't make backup file (add ! to write anyway)"));
|
||||
EXTERN char e_close_failed[]
|
||||
INIT(= N_("E512: Close failed"));
|
||||
EXTERN char e_write_error_conversion_failed_make_fenc_empty_to_override[]
|
||||
INIT(= N_("E513: write error, conversion failed (make 'fenc' empty to override)"));
|
||||
EXTERN char e_write_error_conversion_failed_in_line_nr_make_fenc_empty_to_override[]
|
||||
INIT(= N_("E513: write error, conversion failed in line %ld (make 'fenc' empty to override)"));
|
||||
EXTERN char e_write_error_file_system_full[]
|
||||
INIT(= N_("E514: write error (file system full?)"));
|
||||
EXTERN char e_no_buffers_were_unloaded[]
|
||||
INIT(= N_("E515: No buffers were unloaded"));
|
||||
EXTERN char e_no_buffers_were_deleted[]
|
||||
INIT(= N_("E516: No buffers were deleted"));
|
||||
EXTERN char e_no_buffers_were_wiped_out[]
|
||||
INIT(= N_("E517: No buffers were wiped out"));
|
||||
EXTERN char e_not_allowed_here[]
|
||||
INIT(= N_("E523: Not allowed here"));
|
||||
EXTERN char e_not_allowed_to_change_text_or_change_window[]
|
||||
INIT(= N_("E565: Not allowed to change text or change window"));
|
||||
EXTERN char e_not_allowed_to_change_text_here[]
|
||||
INIT(= N_("E578: Not allowed to change text here"));
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_endif_without_if[]
|
||||
INIT(= N_("E580: :endif without :if"));
|
||||
EXTERN char e_else_without_if[]
|
||||
INIT(= N_("E581: :else without :if"));
|
||||
EXTERN char e_elseif_without_if[]
|
||||
INIT(= N_("E582: :elseif without :if"));
|
||||
EXTERN char e_continue_without_while_or_for[]
|
||||
INIT(= N_("E586: :continue without :while or :for"));
|
||||
EXTERN char e_break_without_while_or_for[]
|
||||
INIT(= N_("E587: :break without :while or :for"));
|
||||
EXTERN char e_endwhile_without_while[]
|
||||
INIT(= N_("E588: :endwhile without :while"));
|
||||
EXTERN char e_endfor_without_for[]
|
||||
INIT(= N_("E588: :endfor without :for"));
|
||||
#endif
|
||||
EXTERN char e_winheight_cannot_be_smaller_than_winminheight[]
|
||||
INIT(= N_("E591: 'winheight' cannot be smaller than 'winminheight'"));
|
||||
EXTERN char e_winwidth_cannot_be_smaller_than_winminwidth[]
|
||||
INIT(= N_("E592: 'winwidth' cannot be smaller than 'winminwidth'"));
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_missing_endtry[]
|
||||
INIT(= N_("E600: Missing :endtry"));
|
||||
EXTERN char e_endtry_without_try[]
|
||||
INIT(= N_("E602: :endtry without :try"));
|
||||
EXTERN char e_catch_without_try[]
|
||||
INIT(= N_("E603: :catch without :try"));
|
||||
EXTERN char e_finally_without_try[]
|
||||
INIT(= N_("E606: :finally without :try"));
|
||||
EXTERN char e_multiple_finally[]
|
||||
INIT(= N_("E607: multiple :finally"));
|
||||
#endif
|
||||
|
||||
EXTERN char e_no_argument_to_delete[]
|
||||
INIT(= N_("E610: No argument to delete"));
|
||||
#ifdef FEAT_NETBEANS_INTG
|
||||
// E656
|
||||
EXTERN char e_netbeans_disallows_writes_of_unmodified_buffers[]
|
||||
INIT(= N_("NetBeans disallows writes of unmodified buffers"));
|
||||
// E657
|
||||
EXTERN char e_partial_writes_disallowed_for_netbeans_buffers[]
|
||||
INIT(= N_("Partial writes disallowed for NetBeans buffers"));
|
||||
#endif
|
||||
#ifdef HAVE_FSYNC
|
||||
EXTERN char e_fsync_failed[]
|
||||
INIT(= N_("E667: Fsync failed"));
|
||||
#endif
|
||||
EXTERN char e_no_matching_autocommands_for_acwrite_buffer[]
|
||||
INIT(= N_("E676: No matching autocommands for acwrite buffer"));
|
||||
EXTERN char e_buffer_nr_invalid_buffer_number[]
|
||||
INIT(= N_("E680: <buffer=%d>: invalid buffer number"));
|
||||
EXTERN char e_invalid_search_pattern_or_delimiter[]
|
||||
INIT(= N_("E682: Invalid search pattern or delimiter"));
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_list_index_out_of_range_nr[]
|
||||
INIT(= N_("E684: list index out of range: %ld"));
|
||||
#endif
|
||||
EXTERN char e_internal_error_str[]
|
||||
INIT(= N_("E685: Internal error: %s"));
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_argument_of_str_must_be_list[]
|
||||
INIT(= N_("E686: Argument of %s must be a List"));
|
||||
EXTERN char e_missing_in_after_for[]
|
||||
INIT(= N_("E690: Missing \"in\" after :for"));
|
||||
// E693 unused
|
||||
EXTERN char e_cannot_index_a_funcref[]
|
||||
INIT(= N_("E695: Cannot index a Funcref"));
|
||||
EXTERN char e_missing_end_of_list_rsb_str[]
|
||||
INIT(= N_("E697: Missing end of List ']': %s"));
|
||||
|
||||
// E706 unused
|
||||
EXTERN char e_list_value_has_more_items_than_targets[]
|
||||
INIT(= N_("E710: List value has more items than targets"));
|
||||
EXTERN char e_list_value_does_not_have_enough_items[]
|
||||
INIT(= N_("E711: List value does not have enough items"));
|
||||
EXTERN char e_argument_of_str_must_be_list_or_dictionary[]
|
||||
INIT(= N_("E712: Argument of %s must be a List or Dictionary"));
|
||||
EXTERN char e_cannot_use_empty_key_for_dictionary[]
|
||||
INIT(= N_("E713: Cannot use empty key for Dictionary"));
|
||||
EXTERN char e_list_required[]
|
||||
INIT(= N_("E714: List required"));
|
||||
EXTERN char e_dictionary_required[]
|
||||
INIT(= N_("E715: Dictionary required"));
|
||||
EXTERN char e_key_not_present_in_dictionary[]
|
||||
INIT(= N_("E716: Key not present in Dictionary: \"%s\""));
|
||||
EXTERN char e_cannot_slice_dictionary[]
|
||||
INIT(= N_("E719: Cannot slice a Dictionary"));
|
||||
EXTERN char e_missing_colon_in_dictionary[]
|
||||
INIT(= N_("E720: Missing colon in Dictionary: %s"));
|
||||
EXTERN char e_duplicate_key_in_dicitonary[]
|
||||
INIT(= N_("E721: Duplicate key in Dictionary: \"%s\""));
|
||||
EXTERN char e_missing_comma_in_dictionary[]
|
||||
INIT(= N_("E722: Missing comma in Dictionary: %s"));
|
||||
EXTERN char e_missing_dict_end[]
|
||||
INIT(= N_("E723: Missing end of Dictionary '}': %s"));
|
||||
EXTERN char e_wrong_variable_type_for_str_equal[]
|
||||
INIT(= N_("E734: Wrong variable type for %s="));
|
||||
EXTERN char e_value_is_locked[]
|
||||
INIT(= N_("E741: Value is locked"));
|
||||
EXTERN char e_value_is_locked_str[]
|
||||
INIT(= N_("E741: Value is locked: %s"));
|
||||
EXTERN char e_cannot_change_value[]
|
||||
INIT(= N_("E742: Cannot change value"));
|
||||
EXTERN char e_cannot_change_value_of_str[]
|
||||
INIT(= N_("E742: Cannot change value of %s"));
|
||||
#endif
|
||||
#ifdef FEAT_NETBEANS_INTG
|
||||
EXTERN char e_netbeans_does_not_allow_changes_in_read_only_files[]
|
||||
INIT(= N_("E744: NetBeans does not allow changes in read-only files"));
|
||||
#endif
|
||||
EXTERN char e_empty_buffer[]
|
||||
INIT(= N_("E749: empty buffer"));
|
||||
#ifdef FEAT_SPELL
|
||||
EXTERN char e_spell_checking_is_not_possible[]
|
||||
INIT(= N_("E756: Spell checking is not possible"));
|
||||
#endif
|
||||
#if defined(FEAT_SYN_HL) || defined(FEAT_COMPL_FUNC)
|
||||
EXTERN char e_option_str_is_not_set[]
|
||||
INIT(= N_("E764: Option '%s' is not set"));
|
||||
#endif
|
||||
#ifdef FEAT_QUICKFIX
|
||||
EXTERN char e_no_location_list[]
|
||||
INIT(= N_("E776: No location list"));
|
||||
#endif
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_cannot_set_variable_in_sandbox[]
|
||||
INIT(= N_("E794: Cannot set variable in the sandbox"));
|
||||
EXTERN char e_cannot_set_variable_in_sandbox_str[]
|
||||
INIT(= N_("E794: Cannot set variable in the sandbox: \"%s\""));
|
||||
EXTERN char e_cannot_delete_variable[]
|
||||
INIT(= N_("E795: Cannot delete variable"));
|
||||
// E796
|
||||
EXTERN char e_writing_to_device_disabled_with_opendevice_option[]
|
||||
INIT(= N_("writing to device disabled with 'opendevice' option"));
|
||||
EXTERN char e_cannot_delete_variable_str[]
|
||||
INIT(= N_("E795: Cannot delete variable %s"));
|
||||
#endif
|
||||
|
||||
#ifndef FEAT_ARABIC
|
||||
EXTERN char e_arabic_cannot_be_used_not_enabled_at_compile_time[]
|
||||
INIT(= N_("E800: Arabic cannot be used: Not enabled at compile time\n"));
|
||||
#endif
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_cannot_use_percent_with_float[]
|
||||
INIT(= N_("E804: Cannot use '%' with Float"));
|
||||
#endif
|
||||
#ifdef FEAT_FLOAT
|
||||
EXTERN char e_using_float_as_string[]
|
||||
INIT(= N_("E806: using Float as a String"));
|
||||
#endif
|
||||
EXTERN char e_cannot_close_autocmd_or_popup_window[]
|
||||
INIT(= N_("E813: Cannot close autocmd or popup window"));
|
||||
EXTERN char e_blowfish_big_little_endian_use_wrong[]
|
||||
INIT(= N_("E817: Blowfish big/little endian use wrong"));
|
||||
EXTERN char e_sha256_test_failed[]
|
||||
INIT(= N_("E818: sha256 test failed"));
|
||||
EXTERN char e_blowfish_test_failed[]
|
||||
INIT(= N_("E819: Blowfish test failed"));
|
||||
EXTERN char e_sizeof_uint32_isnot_four[]
|
||||
INIT(= N_("E820: sizeof(uint32_t) != 4"));
|
||||
EXTERN char e_bf_key_init_called_with_empty_password[]
|
||||
INIT(= N_("E831: bf_key_init() called with empty password"));
|
||||
EXTERN char e_conflicts_with_value_of_listchars[]
|
||||
INIT(= N_("E834: Conflicts with value of 'listchars'"));
|
||||
EXTERN char e_conflicts_with_value_of_fillchars[]
|
||||
INIT(= N_("E835: Conflicts with value of 'fillchars'"));
|
||||
// E839 unused
|
||||
#ifndef FEAT_CLIPBOARD
|
||||
EXTERN char e_invalid_register_name[]
|
||||
INIT(= N_("E850: Invalid register name"));
|
||||
#endif
|
||||
EXTERN char e_autocommands_caused_command_to_abort[]
|
||||
INIT(= N_("E855: Autocommands caused command to abort"));
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_assert_fails_second_arg[]
|
||||
INIT(= N_("E856: \"assert_fails()\" second argument must be a string or a list with one or two strings"));
|
||||
EXTERN char e_dictionary_key_str_required[]
|
||||
INIT(= N_("E857: Dictionary key \"%s\" required"));
|
||||
#endif
|
||||
#ifdef FEAT_PROP_POPUP
|
||||
EXTERN char e_number_required[]
|
||||
INIT(= N_("E889: Number required"));
|
||||
#endif
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_argument_of_str_must_be_list_dictionary_or_blob[]
|
||||
INIT(= N_("E896: Argument of %s must be a List, Dictionary or Blob"));
|
||||
EXTERN char e_list_or_blob_required[]
|
||||
INIT(= N_("E897: List or Blob required"));
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_using_invalid_value_as_string_str[]
|
||||
INIT(= N_("E908: using an invalid value as a String: %s"));
|
||||
EXTERN char e_cannot_index_special_variable[]
|
||||
INIT(= N_("E909: Cannot index a special variable"));
|
||||
#endif
|
||||
EXTERN char e_directory_not_found_in_str_str[]
|
||||
INIT(= N_("E919: Directory not found in '%s': \"%s\""));
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_string_required[]
|
||||
INIT(= N_("E928: String required"));
|
||||
#endif
|
||||
EXTERN char e_buffer_cannot_be_registered[]
|
||||
INIT(= N_("E931: Buffer cannot be registered"));
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_function_was_deleted_str[]
|
||||
INIT(= N_("E933: Function was deleted: %s"));
|
||||
#endif
|
||||
EXTERN char e_cannot_delete_current_group[]
|
||||
INIT(= N_("E936: Cannot delete the current group"));
|
||||
EXTERN char e_attempt_to_delete_buffer_that_is_in_use_str[]
|
||||
INIT(= N_("E937: Attempt to delete a buffer that is in use: %s"));
|
||||
EXTERN char e_positive_count_required[]
|
||||
INIT(= N_("E939: Positive count required"));
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_cannot_lock_or_unlock_variable_str[]
|
||||
INIT(= N_("E940: Cannot lock or unlock variable %s"));
|
||||
#endif
|
||||
#ifdef FEAT_TERMINAL
|
||||
EXTERN char e_job_still_running[]
|
||||
INIT(= N_("E948: Job still running"));
|
||||
EXTERN char e_job_still_running_add_bang_to_end_the_job[]
|
||||
INIT(= N_("E948: Job still running (add ! to end the job)"));
|
||||
#endif
|
||||
EXTERN char e_file_changed_while_writing[]
|
||||
INIT(= N_("E949: File changed while writing"));
|
||||
EXTERN char e_autocommand_caused_recursive_behavior[]
|
||||
INIT(= N_("E952: Autocommand caused recursive behavior"));
|
||||
EXTERN char e_invalid_window_number[]
|
||||
INIT(= N_("E957: Invalid window number"));
|
||||
EXTERN char_u e_invalid_column_number_nr[]
|
||||
INIT(= N_("E964: Invalid column number: %ld"));
|
||||
EXTERN char_u e_invalid_line_number_nr[]
|
||||
INIT(= N_("E966: Invalid line number: %ld"));
|
||||
EXTERN char e_blob_value_does_not_have_right_number_of_bytes[]
|
||||
INIT(= N_("E972: Blob value does not have the right number of bytes"));
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_invalid_operation_for_blob[]
|
||||
INIT(= N_("E978: Invalid operation for Blob"));
|
||||
EXTERN char e_blob_index_out_of_range_nr[]
|
||||
INIT(= N_("E979: Blob index out of range: %ld"));
|
||||
#endif
|
||||
EXTERN char e_duplicate_argument_str[]
|
||||
INIT(= N_("E983: Duplicate argument: %s"));
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_cannot_modify_existing_variable[]
|
||||
INIT(= N_("E995: Cannot modify existing variable"));
|
||||
EXTERN char e_cannot_lock_an_option[]
|
||||
INIT(= N_("E996: Cannot lock an option"));
|
||||
EXTERN char e_reduce_of_an_empty_str_with_no_initial_value[]
|
||||
INIT(= N_("E998: Reduce of an empty %s with no initial value"));
|
||||
#endif
|
||||
|
||||
EXTERN char e_command_not_supported_in_vim9_script_missing_var_str[]
|
||||
INIT(= N_("E1100: Command not supported in Vim9 script (missing :var?): %s"));
|
||||
#ifdef FEAT_EVAL
|
||||
@@ -519,10 +1380,8 @@ EXTERN char e_cannot_extend_null_list[]
|
||||
EXTERN char e_using_string_as_bool_str[]
|
||||
INIT(= N_("E1135: Using a String as a Bool: \"%s\""));
|
||||
#endif
|
||||
EXTERN char e_cmd_mapping_must_end_with_cr[]
|
||||
INIT(=N_("E1135: <Cmd> mapping must end with <CR>"));
|
||||
EXTERN char e_cmd_mapping_must_end_with_cr_before_second_cmd[]
|
||||
INIT(=N_("E1136: <Cmd> mapping must end with <CR> before second <Cmd>"));
|
||||
INIT(= N_("E1136: <Cmd> mapping must end with <CR> before second <Cmd>"));
|
||||
EXTERN char e_cmd_maping_must_not_include_str_key[]
|
||||
INIT(= N_("E1137: <Cmd> mapping must not include %s key"));
|
||||
EXTERN char e_using_bool_as_number[]
|
||||
@@ -597,8 +1456,8 @@ EXTERN char e_missing_end_block[]
|
||||
INIT(= N_("E1171: Missing } after inline function"));
|
||||
EXTERN char e_cannot_use_default_values_in_lambda[]
|
||||
INIT(= N_("E1172: Cannot use default values in a lambda"));
|
||||
EXTERN char e_text_found_after_enddef_str[]
|
||||
INIT(= N_("E1173: Text found after enddef: %s"));
|
||||
EXTERN char e_text_found_after_str_str[]
|
||||
INIT(= N_("E1173: Text found after %s: %s"));
|
||||
EXTERN char e_string_required_for_argument_nr[]
|
||||
INIT(= N_("E1174: String required for argument %d"));
|
||||
EXTERN char e_non_empty_string_required_for_argument_nr[]
|
||||
@@ -758,3 +1617,17 @@ EXTERN char e_closure_called_from_invalid_context[]
|
||||
INIT(= N_("E1248: Closure called from invalid context"));
|
||||
EXTERN char e_highlight_group_name_too_long[]
|
||||
INIT(= N_("E1249: Highlight group name too long"));
|
||||
EXTERN char e_argument_of_str_must_be_list_string_dictionary_or_blob[]
|
||||
INIT(= N_("E1250: Argument of %s must be a List, String, Dictionary or Blob"));
|
||||
EXTERN char e_list_dict_blob_or_string_required_for_argument_nr[]
|
||||
INIT(= N_("E1251: List, Dictionary, Blob or String required for argument %d"));
|
||||
EXTERN char e_string_list_or_blob_required_for_argument_nr[]
|
||||
INIT(= N_("E1252: String, List or Blob required for argument %d"));
|
||||
EXTERN char e_string_expected_for_argument_nr[]
|
||||
INIT(= N_("E1253: String expected for argument %d"));
|
||||
EXTERN char e_cannot_use_script_variable_in_for_loop[]
|
||||
INIT(= N_("E1254: Cannot use script variable in for loop"));
|
||||
EXTERN char e_cmd_mapping_must_end_with_cr[]
|
||||
INIT(= N_("E1255: <Cmd> mapping must end with <CR>"));
|
||||
EXTERN char e_string_or_function_required_for_argument_nr[]
|
||||
INIT(= N_("E1256: String or function required for argument %d"));
|
||||
|
||||
185
src/eval.c
185
src/eval.c
@@ -256,7 +256,7 @@ eval_expr_typval(typval_T *expr, typval_T *argv, int argc, typval_T *rettv)
|
||||
if (s == NULL || *s == NUL)
|
||||
return FAIL;
|
||||
CLEAR_FIELD(funcexe);
|
||||
funcexe.evaluate = TRUE;
|
||||
funcexe.fe_evaluate = TRUE;
|
||||
if (call_func(s, -1, rettv, argc, argv, &funcexe) == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
@@ -280,8 +280,8 @@ eval_expr_typval(typval_T *expr, typval_T *argv, int argc, typval_T *rettv)
|
||||
if (s == NULL || *s == NUL)
|
||||
return FAIL;
|
||||
CLEAR_FIELD(funcexe);
|
||||
funcexe.evaluate = TRUE;
|
||||
funcexe.partial = partial;
|
||||
funcexe.fe_evaluate = TRUE;
|
||||
funcexe.fe_partial = partial;
|
||||
if (call_func(s, -1, rettv, argc, argv, &funcexe) == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
@@ -644,9 +644,9 @@ call_vim_function(
|
||||
|
||||
rettv->v_type = VAR_UNKNOWN; // clear_tv() uses this
|
||||
CLEAR_FIELD(funcexe);
|
||||
funcexe.firstline = curwin->w_cursor.lnum;
|
||||
funcexe.lastline = curwin->w_cursor.lnum;
|
||||
funcexe.evaluate = TRUE;
|
||||
funcexe.fe_firstline = curwin->w_cursor.lnum;
|
||||
funcexe.fe_lastline = curwin->w_cursor.lnum;
|
||||
funcexe.fe_evaluate = TRUE;
|
||||
ret = call_func(func, -1, rettv, argc, argv, &funcexe);
|
||||
if (ret == FAIL)
|
||||
clear_tv(rettv);
|
||||
@@ -856,7 +856,7 @@ get_lval(
|
||||
if (unlet && !VIM_ISWHITE(*p) && !ends_excmd(*p)
|
||||
&& *p != '[' && *p != '.')
|
||||
{
|
||||
semsg(_(e_trailing_arg), p);
|
||||
semsg(_(e_trailing_characters_str), p);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -869,7 +869,7 @@ get_lval(
|
||||
if (!aborting() && !quiet)
|
||||
{
|
||||
emsg_severe = TRUE;
|
||||
semsg(_(e_invarg2), name);
|
||||
semsg(_(e_invalid_argument_str), name);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -997,7 +997,7 @@ get_lval(
|
||||
if (len == 0)
|
||||
{
|
||||
if (!quiet)
|
||||
emsg(_(e_emptykey));
|
||||
emsg(_(e_cannot_use_empty_key_for_dictionary));
|
||||
return NULL;
|
||||
}
|
||||
p = key + len;
|
||||
@@ -1071,7 +1071,7 @@ get_lval(
|
||||
if (*p != ']')
|
||||
{
|
||||
if (!quiet)
|
||||
emsg(_(e_missbrac));
|
||||
emsg(_(e_missing_closing_square_brace));
|
||||
clear_tv(&var1);
|
||||
clear_tv(&var2);
|
||||
return NULL;
|
||||
@@ -1148,7 +1148,7 @@ get_lval(
|
||||
if (lp->ll_dict == get_vimvar_dict()
|
||||
|| &lp->ll_dict->dv_hashtab == get_funccal_args_ht())
|
||||
{
|
||||
semsg(_(e_illvar), name);
|
||||
semsg(_(e_illegal_variable_name_str), name);
|
||||
clear_tv(&var1);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1157,7 +1157,7 @@ get_lval(
|
||||
if (*p == '[' || *p == '.' || unlet)
|
||||
{
|
||||
if (!quiet)
|
||||
semsg(_(e_dictkey), key);
|
||||
semsg(_(e_key_not_present_in_dictionary), key);
|
||||
clear_tv(&var1);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1306,7 +1306,7 @@ set_var_lval(
|
||||
|
||||
if (op != NULL && *op != '=')
|
||||
{
|
||||
semsg(_(e_letwrong), op);
|
||||
semsg(_(e_wrong_variable_type_for_str_equal), op);
|
||||
return;
|
||||
}
|
||||
if (value_check_lock(lp->ll_blob->bv_lock, lp->ll_name, FALSE))
|
||||
@@ -1335,7 +1335,7 @@ set_var_lval(
|
||||
if ((flags & (ASSIGN_CONST | ASSIGN_FINAL))
|
||||
&& (flags & ASSIGN_FOR_LOOP) == 0)
|
||||
{
|
||||
emsg(_(e_cannot_mod));
|
||||
emsg(_(e_cannot_modify_existing_variable));
|
||||
*endp = cc;
|
||||
return;
|
||||
}
|
||||
@@ -1401,7 +1401,7 @@ set_var_lval(
|
||||
{
|
||||
if (op != NULL && *op != '=')
|
||||
{
|
||||
semsg(_(e_dictkey), lp->ll_newkey);
|
||||
semsg(_(e_key_not_present_in_dictionary), lp->ll_newkey);
|
||||
return;
|
||||
}
|
||||
if (dict_wrong_func_name(lp->ll_tv->vval.v_dict, rettv,
|
||||
@@ -1590,7 +1590,7 @@ tv_op(typval_T *tv1, typval_T *tv2, char_u *op)
|
||||
}
|
||||
}
|
||||
|
||||
semsg(_(e_letwrong), op);
|
||||
semsg(_(e_wrong_variable_type_for_str_equal), op);
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
@@ -1632,7 +1632,7 @@ eval_for_line(
|
||||
if (in_vim9script() && *expr == ':' && expr != var_list_end)
|
||||
semsg(_(e_no_white_space_allowed_before_colon_str), expr);
|
||||
else
|
||||
emsg(_(e_missing_in));
|
||||
emsg(_(e_missing_in_after_for));
|
||||
return fi;
|
||||
}
|
||||
|
||||
@@ -1988,6 +1988,7 @@ eval_func(
|
||||
partial_T *partial;
|
||||
int ret = OK;
|
||||
type_T *type = NULL;
|
||||
int found_var = FALSE;
|
||||
|
||||
if (!evaluate)
|
||||
check_vars(s, len);
|
||||
@@ -1995,12 +1996,12 @@ eval_func(
|
||||
// If "s" is the name of a variable of type VAR_FUNC
|
||||
// use its contents.
|
||||
s = deref_func_name(s, &len, &partial,
|
||||
in_vim9script() ? &type : NULL, !evaluate);
|
||||
in_vim9script() ? &type : NULL, !evaluate, &found_var);
|
||||
|
||||
// Need to make a copy, in case evaluating the arguments makes
|
||||
// the name invalid.
|
||||
s = vim_strsave(s);
|
||||
if (s == NULL || (flags & EVAL_CONSTANT))
|
||||
if (s == NULL || (evaluate && (*s == NUL || (flags & EVAL_CONSTANT))))
|
||||
ret = FAIL;
|
||||
else
|
||||
{
|
||||
@@ -2008,12 +2009,13 @@ eval_func(
|
||||
|
||||
// Invoke the function.
|
||||
CLEAR_FIELD(funcexe);
|
||||
funcexe.firstline = curwin->w_cursor.lnum;
|
||||
funcexe.lastline = curwin->w_cursor.lnum;
|
||||
funcexe.evaluate = evaluate;
|
||||
funcexe.partial = partial;
|
||||
funcexe.basetv = basetv;
|
||||
funcexe.check_type = type;
|
||||
funcexe.fe_firstline = curwin->w_cursor.lnum;
|
||||
funcexe.fe_lastline = curwin->w_cursor.lnum;
|
||||
funcexe.fe_evaluate = evaluate;
|
||||
funcexe.fe_partial = partial;
|
||||
funcexe.fe_basetv = basetv;
|
||||
funcexe.fe_check_type = type;
|
||||
funcexe.fe_found_var = found_var;
|
||||
ret = get_func_tv(s, len, rettv, arg, evalarg, &funcexe);
|
||||
}
|
||||
vim_free(s);
|
||||
@@ -2148,7 +2150,7 @@ eval_next_line(evalarg_T *evalarg)
|
||||
skipwhite_and_linebreak(char_u *arg, evalarg_T *evalarg)
|
||||
{
|
||||
int getnext;
|
||||
char_u *p = skipwhite(arg);
|
||||
char_u *p = skipwhite_and_nl(arg);
|
||||
|
||||
if (evalarg == NULL)
|
||||
return skipwhite(arg);
|
||||
@@ -2220,16 +2222,35 @@ eval0(
|
||||
{
|
||||
int ret;
|
||||
char_u *p;
|
||||
char_u *expr_end;
|
||||
int did_emsg_before = did_emsg;
|
||||
int called_emsg_before = called_emsg;
|
||||
int flags = evalarg == NULL ? 0 : evalarg->eval_flags;
|
||||
int check_for_end = TRUE;
|
||||
int end_error = FALSE;
|
||||
|
||||
p = skipwhite(arg);
|
||||
ret = eval1(&p, rettv, evalarg);
|
||||
expr_end = p;
|
||||
p = skipwhite(p);
|
||||
|
||||
if (ret != FAIL)
|
||||
// In Vim9 script a command block is not split at NL characters for
|
||||
// commands using an expression argument. Skip over a '#' comment to check
|
||||
// for a following NL. Require white space before the '#'.
|
||||
if (in_vim9script() && p > expr_end)
|
||||
while (*p == '#')
|
||||
{
|
||||
char_u *nl = vim_strchr(p, NL);
|
||||
|
||||
if (nl == NULL)
|
||||
break;
|
||||
p = skipwhite(nl + 1);
|
||||
if (eap != NULL && *p != NUL)
|
||||
eap->nextcmd = p;
|
||||
check_for_end = FALSE;
|
||||
}
|
||||
|
||||
if (ret != FAIL && check_for_end)
|
||||
end_error = !ends_excmd2(arg, p);
|
||||
if (ret == FAIL || end_error)
|
||||
{
|
||||
@@ -2248,7 +2269,7 @@ eval0(
|
||||
&& (!in_vim9script() || !vim9_bad_comment(p)))
|
||||
{
|
||||
if (end_error)
|
||||
semsg(_(e_trailing_arg), p);
|
||||
semsg(_(e_trailing_characters_str), p);
|
||||
else
|
||||
semsg(_(e_invalid_expression_str), arg);
|
||||
}
|
||||
@@ -2261,7 +2282,7 @@ eval0(
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
if (eap != NULL)
|
||||
if (check_for_end && eap != NULL)
|
||||
set_nextcmd(eap, p);
|
||||
|
||||
return ret;
|
||||
@@ -2373,7 +2394,7 @@ eval1(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
|
||||
p = eval_next_non_blank(*arg, evalarg_used, &getnext);
|
||||
if (*p != ':')
|
||||
{
|
||||
emsg(_(e_missing_colon));
|
||||
emsg(_(e_missing_colon_after_questionmark));
|
||||
if (evaluate && result)
|
||||
clear_tv(rettv);
|
||||
evalarg_used->eval_flags = orig_flags;
|
||||
@@ -3227,7 +3248,7 @@ eval6(
|
||||
}
|
||||
else
|
||||
{
|
||||
emsg(_(e_modulus));
|
||||
emsg(_(e_cannot_use_percent_with_float));
|
||||
return FAIL;
|
||||
}
|
||||
rettv->v_type = VAR_FLOAT;
|
||||
@@ -3566,7 +3587,7 @@ eval7(
|
||||
++*arg;
|
||||
else if (ret == OK)
|
||||
{
|
||||
emsg(_(e_missing_close));
|
||||
emsg(_(e_missing_closing_paren));
|
||||
clear_tv(rettv);
|
||||
ret = FAIL;
|
||||
}
|
||||
@@ -3803,12 +3824,12 @@ call_func_rettv(
|
||||
s = (char_u *)"";
|
||||
|
||||
CLEAR_FIELD(funcexe);
|
||||
funcexe.firstline = curwin->w_cursor.lnum;
|
||||
funcexe.lastline = curwin->w_cursor.lnum;
|
||||
funcexe.evaluate = evaluate;
|
||||
funcexe.partial = pt;
|
||||
funcexe.selfdict = selfdict;
|
||||
funcexe.basetv = basetv;
|
||||
funcexe.fe_firstline = curwin->w_cursor.lnum;
|
||||
funcexe.fe_lastline = curwin->w_cursor.lnum;
|
||||
funcexe.fe_evaluate = evaluate;
|
||||
funcexe.fe_partial = pt;
|
||||
funcexe.fe_selfdict = selfdict;
|
||||
funcexe.fe_basetv = basetv;
|
||||
ret = get_func_tv(s, -1, rettv, arg, evalarg, &funcexe);
|
||||
|
||||
theend:
|
||||
@@ -3850,12 +3871,15 @@ eval_lambda(
|
||||
++*arg;
|
||||
ret = eval1(arg, rettv, evalarg);
|
||||
*arg = skipwhite_and_linebreak(*arg, evalarg);
|
||||
if (**arg != ')')
|
||||
if (**arg == ')')
|
||||
{
|
||||
emsg(_(e_missing_close));
|
||||
++*arg;
|
||||
}
|
||||
else
|
||||
{
|
||||
emsg(_(e_missing_closing_paren));
|
||||
ret = FAIL;
|
||||
}
|
||||
++*arg;
|
||||
}
|
||||
if (ret != OK)
|
||||
return FAIL;
|
||||
@@ -3864,9 +3888,9 @@ eval_lambda(
|
||||
if (verbose)
|
||||
{
|
||||
if (*skipwhite(*arg) == '(')
|
||||
emsg(_(e_nowhitespace));
|
||||
emsg(_(e_no_white_space_allowed_before_parenthesis));
|
||||
else
|
||||
semsg(_(e_missing_paren), "lambda");
|
||||
semsg(_(e_missing_parenthesis_str), "lambda");
|
||||
}
|
||||
clear_tv(rettv);
|
||||
ret = FAIL;
|
||||
@@ -3912,7 +3936,7 @@ eval_method(
|
||||
if (len <= 0)
|
||||
{
|
||||
if (verbose)
|
||||
emsg(_("E260: Missing name after ->"));
|
||||
emsg(_(e_missing_name_after_method));
|
||||
ret = FAIL;
|
||||
}
|
||||
else
|
||||
@@ -3921,13 +3945,13 @@ eval_method(
|
||||
if (**arg != '(')
|
||||
{
|
||||
if (verbose)
|
||||
semsg(_(e_missing_paren), name);
|
||||
semsg(_(e_missing_parenthesis_str), name);
|
||||
ret = FAIL;
|
||||
}
|
||||
else if (VIM_ISWHITE((*arg)[-1]))
|
||||
{
|
||||
if (verbose)
|
||||
emsg(_(e_nowhitespace));
|
||||
emsg(_(e_no_white_space_allowed_before_parenthesis));
|
||||
ret = FAIL;
|
||||
}
|
||||
else
|
||||
@@ -4002,6 +4026,8 @@ eval_index(
|
||||
}
|
||||
else if (evaluate)
|
||||
{
|
||||
int error = FALSE;
|
||||
|
||||
#ifdef FEAT_FLOAT
|
||||
// allow for indexing with float
|
||||
if (vim9 && rettv->v_type == VAR_DICT
|
||||
@@ -4011,7 +4037,11 @@ eval_index(
|
||||
var1.v_type = VAR_STRING;
|
||||
}
|
||||
#endif
|
||||
if (tv_get_string_chk(&var1) == NULL)
|
||||
if (vim9 && rettv->v_type == VAR_LIST)
|
||||
tv_get_number_chk(&var1, &error);
|
||||
else
|
||||
error = tv_get_string_chk(&var1) == NULL;
|
||||
if (error)
|
||||
{
|
||||
// not a number or string
|
||||
clear_tv(&var1);
|
||||
@@ -4059,7 +4089,7 @@ eval_index(
|
||||
if (**arg != ']')
|
||||
{
|
||||
if (verbose)
|
||||
emsg(_(e_missbrac));
|
||||
emsg(_(e_missing_closing_square_brace));
|
||||
clear_tv(&var1);
|
||||
if (range)
|
||||
clear_tv(&var2);
|
||||
@@ -4094,12 +4124,12 @@ check_can_index(typval_T *rettv, int evaluate, int verbose)
|
||||
case VAR_FUNC:
|
||||
case VAR_PARTIAL:
|
||||
if (verbose)
|
||||
emsg(_("E695: Cannot index a Funcref"));
|
||||
emsg(_(e_cannot_index_a_funcref));
|
||||
return FAIL;
|
||||
case VAR_FLOAT:
|
||||
#ifdef FEAT_FLOAT
|
||||
if (verbose)
|
||||
emsg(_(e_float_as_string));
|
||||
emsg(_(e_using_float_as_string));
|
||||
return FAIL;
|
||||
#endif
|
||||
case VAR_BOOL:
|
||||
@@ -4295,7 +4325,7 @@ eval_index_inner(
|
||||
{
|
||||
if (keylen > 0)
|
||||
key[keylen] = NUL;
|
||||
semsg(_(e_dictkey), key);
|
||||
semsg(_(e_key_not_present_in_dictionary), key);
|
||||
}
|
||||
return FAIL;
|
||||
}
|
||||
@@ -4508,12 +4538,27 @@ garbage_collect(int testing)
|
||||
// function call arguments, if v:testing is set.
|
||||
abort = abort || set_ref_in_func_args(copyID);
|
||||
|
||||
// funcstacks keep variables for closures
|
||||
abort = abort || set_ref_in_funcstacks(copyID);
|
||||
|
||||
// v: vars
|
||||
abort = abort || garbage_collect_vimvars(copyID);
|
||||
|
||||
// callbacks in buffers
|
||||
abort = abort || set_ref_in_buffers(copyID);
|
||||
|
||||
// 'completefunc', 'omnifunc' and 'thesaurusfunc' callbacks
|
||||
abort = abort || set_ref_in_insexpand_funcs(copyID);
|
||||
|
||||
// 'operatorfunc' callback
|
||||
abort = abort || set_ref_in_opfunc(copyID);
|
||||
|
||||
// 'tagfunc' callback
|
||||
abort = abort || set_ref_in_tagfunc(copyID);
|
||||
|
||||
// 'imactivatefunc' and 'imstatusfunc' callbacks
|
||||
abort = abort || set_ref_in_im_funcs(copyID);
|
||||
|
||||
#ifdef FEAT_LUA
|
||||
abort = abort || set_ref_in_lua(copyID);
|
||||
#endif
|
||||
@@ -4741,6 +4786,22 @@ set_ref_in_list_items(list_T *l, int copyID, ht_stack_T **ht_stack)
|
||||
return abort;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark the partial in callback 'cb' with "copyID".
|
||||
*/
|
||||
int
|
||||
set_ref_in_callback(callback_T *cb, int copyID)
|
||||
{
|
||||
typval_T tv;
|
||||
|
||||
if (cb->cb_name == NULL || *cb->cb_name == NUL || cb->cb_partial == NULL)
|
||||
return FALSE;
|
||||
|
||||
tv.v_type = VAR_PARTIAL;
|
||||
tv.vval.v_partial = cb->cb_partial;
|
||||
return set_ref_in_item(&tv, copyID, NULL, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark all lists and dicts referenced through typval "tv" with "copyID".
|
||||
* "list_stack" is used to add lists to be marked. Can be NULL.
|
||||
@@ -4839,15 +4900,7 @@ set_ref_in_item(
|
||||
for (i = 0; i < pt->pt_argc; ++i)
|
||||
abort = abort || set_ref_in_item(&pt->pt_argv[i], copyID,
|
||||
ht_stack, list_stack);
|
||||
if (pt->pt_funcstack != NULL)
|
||||
{
|
||||
typval_T *stack = pt->pt_funcstack->fs_ga.ga_data;
|
||||
|
||||
for (i = 0; i < pt->pt_funcstack->fs_ga.ga_len; ++i)
|
||||
abort = abort || set_ref_in_item(stack + i, copyID,
|
||||
ht_stack, list_stack);
|
||||
}
|
||||
|
||||
// pt_funcstack is handled in set_ref_in_funcstacks()
|
||||
}
|
||||
}
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
@@ -5040,7 +5093,8 @@ echo_string_core(
|
||||
ga_concat(&ga, tv2string(&dtv, &tf, numbuf, copyID));
|
||||
vim_free(tf);
|
||||
}
|
||||
ga_concat(&ga, (char_u *)")");
|
||||
// terminate with ')' and a NUL
|
||||
ga_concat_len(&ga, (char_u *)")", 2);
|
||||
|
||||
*tofree = ga.ga_data;
|
||||
r = *tofree;
|
||||
@@ -5305,8 +5359,9 @@ var2fpos(
|
||||
name = tv_get_string_chk(varp);
|
||||
if (name == NULL)
|
||||
return NULL;
|
||||
if (name[0] == '.') // cursor
|
||||
if (name[0] == '.' && (!in_vim9script() || name[1] == NUL))
|
||||
{
|
||||
// cursor
|
||||
pos = curwin->w_cursor;
|
||||
if (charcol)
|
||||
pos.col = buf_byteidx_to_charidx(curbuf, pos.lnum, pos.col);
|
||||
@@ -5322,8 +5377,10 @@ var2fpos(
|
||||
pos.col = buf_byteidx_to_charidx(curbuf, pos.lnum, pos.col);
|
||||
return &pos;
|
||||
}
|
||||
if (name[0] == '\'') // mark
|
||||
if (name[0] == '\'' && (!in_vim9script()
|
||||
|| (name[1] != NUL && name[2] == NUL)))
|
||||
{
|
||||
// mark
|
||||
pp = getmark_buf_fnum(curbuf, name[1], FALSE, fnum);
|
||||
if (pp == NULL || pp == (pos_T *)-1 || pp->lnum <= 0)
|
||||
return NULL;
|
||||
@@ -5891,7 +5948,7 @@ handle_subscript(
|
||||
{
|
||||
if (VIM_ISWHITE(**arg))
|
||||
{
|
||||
emsg(_(e_nowhitespace));
|
||||
emsg(_(e_no_white_space_allowed_before_parenthesis));
|
||||
ret = FAIL;
|
||||
}
|
||||
else if ((**arg == '{' && !in_vim9script()) || **arg == '(')
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user