mirror of
https://github.com/zoriya/vim.git
synced 2025-12-16 12:15:18 +00:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9b56b2ceb | ||
|
|
e0b66da691 | ||
|
|
690afe1fef | ||
|
|
3a29abcb61 | ||
|
|
f13e00b2cf | ||
|
|
c7b831ca15 | ||
|
|
36ae89c550 | ||
|
|
4019cf90b8 | ||
|
|
f42dd3c390 | ||
|
|
0c0590d982 | ||
|
|
4bc2f2e9fd | ||
|
|
45600ce8f2 | ||
|
|
aed6d0b81a | ||
|
|
3a118be150 | ||
|
|
16038d50c4 | ||
|
|
d9c60648e5 | ||
|
|
cc5b22b3bf | ||
|
|
65c836e600 | ||
|
|
52c0de1de1 | ||
|
|
4f7090b93d | ||
|
|
1e07633a5d | ||
|
|
9e817c8a31 | ||
|
|
ba47b51ff8 | ||
|
|
6a717f17ec | ||
|
|
b031c4ea04 | ||
|
|
941c12da3c | ||
|
|
bff6ad1331 | ||
|
|
48c9f3b123 | ||
|
|
076e502199 | ||
|
|
915350edec |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -81,3 +81,4 @@ src/testdir/viminfo
|
|||||||
src/memfile_test
|
src/memfile_test
|
||||||
src/json_test
|
src/json_test
|
||||||
src/message_test
|
src/message_test
|
||||||
|
src/kword_test
|
||||||
|
|||||||
14
.travis.yml
14
.travis.yml
@@ -18,13 +18,16 @@ env:
|
|||||||
# Mac OSX build
|
# Mac OSX build
|
||||||
- BUILD=yes TEST=test COVERAGE=no FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
- BUILD=yes TEST=test COVERAGE=no FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
||||||
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp'"
|
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp'"
|
||||||
|
# ASAN build
|
||||||
|
- BUILD=yes TEST=test SANITIZER_CFLAGS="-g -O1 -fsanitize=address -fno-omit-frame-pointer" FEATURES=huge SRCDIR=./src CHECK_AUTOCONF=no
|
||||||
|
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp'"
|
||||||
|
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
git:
|
git:
|
||||||
depth: 1
|
depth: 10
|
||||||
|
|
||||||
# instead of a 6*2*2 matrix (2*os + 2*compiler + 6*env),
|
# instead of a 2*2*8 matrix (2*os + 2*compiler + 8*env),
|
||||||
# exclude some builds on mac os x and linux
|
# exclude some builds on mac os x and linux
|
||||||
# linux: 2*compiler + 5*env + mac: 2*compiler + 2*env
|
# linux: 2*compiler + 5*env + mac: 2*compiler + 2*env
|
||||||
matrix:
|
matrix:
|
||||||
@@ -38,6 +41,13 @@ matrix:
|
|||||||
- os: osx
|
- os: osx
|
||||||
env: BUILD=yes TEST=scripttests COVERAGE=yes CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
env: BUILD=yes TEST=scripttests COVERAGE=yes CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
||||||
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp'"
|
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp'"
|
||||||
|
- os: osx
|
||||||
|
env: BUILD=yes TEST=test SANITIZER_CFLAGS="-g -O1 -fsanitize=address -fno-omit-frame-pointer" FEATURES=huge SRCDIR=./src CHECK_AUTOCONF=no
|
||||||
|
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp'"
|
||||||
|
- os: linux
|
||||||
|
compiler: gcc
|
||||||
|
env: BUILD=yes TEST=test SANITIZER_CFLAGS="-g -O1 -fsanitize=address -fno-omit-frame-pointer" FEATURES=huge SRCDIR=./src CHECK_AUTOCONF=no
|
||||||
|
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp'"
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: BUILD=no TEST=unittests COVERAGE=yes CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=yes
|
env: BUILD=no TEST=unittests COVERAGE=yes CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=yes
|
||||||
|
|||||||
2
Filelist
2
Filelist
@@ -45,6 +45,7 @@ SRC_ALL = \
|
|||||||
src/hashtab.c \
|
src/hashtab.c \
|
||||||
src/json.c \
|
src/json.c \
|
||||||
src/json_test.c \
|
src/json_test.c \
|
||||||
|
src/kword_test.c \
|
||||||
src/list.c \
|
src/list.c \
|
||||||
src/keymap.h \
|
src/keymap.h \
|
||||||
src/macros.h \
|
src/macros.h \
|
||||||
@@ -122,6 +123,7 @@ SRC_ALL = \
|
|||||||
src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py \
|
src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py \
|
||||||
src/testdir/python_after/*.py \
|
src/testdir/python_after/*.py \
|
||||||
src/testdir/python_before/*.py \
|
src/testdir/python_before/*.py \
|
||||||
|
src/testdir/pyxfile/*.py \
|
||||||
src/testdir/bench*.in \
|
src/testdir/bench*.in \
|
||||||
src/testdir/bench*.vim \
|
src/testdir/bench*.vim \
|
||||||
src/testdir/samples/*.txt \
|
src/testdir/samples/*.txt \
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
*eval.txt* For Vim version 8.0. Last change: 2017 Jan 14
|
*eval.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -2222,8 +2222,8 @@ matchstr({expr}, {pat}[, {start}[, {count}]])
|
|||||||
String {count}'th match of {pat} in {expr}
|
String {count}'th match of {pat} in {expr}
|
||||||
matchstrpos({expr}, {pat}[, {start}[, {count}]])
|
matchstrpos({expr}, {pat}[, {start}[, {count}]])
|
||||||
List {count}'th match of {pat} in {expr}
|
List {count}'th match of {pat} in {expr}
|
||||||
max({list}) Number maximum value of items in {list}
|
max({expr}) Number maximum value of items in {expr}
|
||||||
min({list}) Number minimum value of items in {list}
|
min({expr}) Number minimum value of items in {expr}
|
||||||
mkdir({name} [, {path} [, {prot}]])
|
mkdir({name} [, {path} [, {prot}]])
|
||||||
Number create directory {name}
|
Number create directory {name}
|
||||||
mode([expr]) String current editing mode
|
mode([expr]) String current editing mode
|
||||||
@@ -2239,6 +2239,7 @@ printf({fmt}, {expr1}...) String format text
|
|||||||
pumvisible() Number whether popup menu is visible
|
pumvisible() Number whether popup menu is visible
|
||||||
pyeval({expr}) any evaluate |Python| expression
|
pyeval({expr}) any evaluate |Python| expression
|
||||||
py3eval({expr}) any evaluate |python3| expression
|
py3eval({expr}) any evaluate |python3| expression
|
||||||
|
pyxeval({expr}) any evaluate |python_x| expression
|
||||||
range({expr} [, {max} [, {stride}]])
|
range({expr} [, {max} [, {stride}]])
|
||||||
List items from {expr} to {max}
|
List items from {expr} to {max}
|
||||||
readfile({fname} [, {binary} [, {max}]])
|
readfile({fname} [, {binary} [, {max}]])
|
||||||
@@ -4171,6 +4172,10 @@ getchar([expr]) *getchar()*
|
|||||||
exe "normal " . v:mouse_col . "|"
|
exe "normal " . v:mouse_col . "|"
|
||||||
endif
|
endif
|
||||||
<
|
<
|
||||||
|
When using bracketed paste only the first character is
|
||||||
|
returned, the rest of the pasted text is dropped.
|
||||||
|
|xterm-bracketed-paste|.
|
||||||
|
|
||||||
There is no prompt, you will somehow have to make clear to the
|
There is no prompt, you will somehow have to make clear to the
|
||||||
user that a character has to be typed.
|
user that a character has to be typed.
|
||||||
There is no mapping for the character.
|
There is no mapping for the character.
|
||||||
@@ -5796,16 +5801,20 @@ matchstrpos({expr}, {pat}[, {start}[, {count}]]) *matchstrpos()*
|
|||||||
The type isn't changed, it's not necessarily a String.
|
The type isn't changed, it's not necessarily a String.
|
||||||
|
|
||||||
*max()*
|
*max()*
|
||||||
max({list}) Return the maximum value of all items in {list}.
|
max({expr}) Return the maximum value of all items in {expr}.
|
||||||
If {list} is not a list or one of the items in {list} cannot
|
{expr} can be a list or a dictionary. For a dictionary,
|
||||||
be used as a Number this results in an error.
|
it returns the maximum of all values in the dictionary.
|
||||||
An empty |List| results in zero.
|
If {expr} is neither a list nor a dictionary, or one of the
|
||||||
|
items in {expr} cannot be used as a Number this results in
|
||||||
|
an error. An empty |List| or |Dictionary| results in zero.
|
||||||
|
|
||||||
*min()*
|
*min()*
|
||||||
min({list}) Return the minimum value of all items in {list}.
|
min({expr}) Return the minimum value of all items in {expr}.
|
||||||
If {list} is not a list or one of the items in {list} cannot
|
{expr} can be a list or a dictionary. For a dictionary,
|
||||||
be used as a Number this results in an error.
|
it returns the minimum of all values in the dictionary.
|
||||||
An empty |List| results in zero.
|
If {expr} is neither a list nor a dictionary, or one of the
|
||||||
|
items in {expr} cannot be used as a Number this results in
|
||||||
|
an error. An empty |List| or |Dictionary| results in zero.
|
||||||
|
|
||||||
*mkdir()* *E739*
|
*mkdir()* *E739*
|
||||||
mkdir({name} [, {path} [, {prot}]])
|
mkdir({name} [, {path} [, {prot}]])
|
||||||
@@ -6163,6 +6172,14 @@ pyeval({expr}) *pyeval()*
|
|||||||
non-string keys result in error.
|
non-string keys result in error.
|
||||||
{only available when compiled with the |+python| feature}
|
{only available when compiled with the |+python| feature}
|
||||||
|
|
||||||
|
pyxeval({expr}) *pyxeval()*
|
||||||
|
Evaluate Python expression {expr} and return its result
|
||||||
|
converted to Vim data structures.
|
||||||
|
Uses Python 2 or 3, see |python_x| and 'pyxversion'.
|
||||||
|
See also: |pyeval()|, |py3eval()|
|
||||||
|
{only available when compiled with the |+python| or the
|
||||||
|
|+python3| feature}
|
||||||
|
|
||||||
*E726* *E727*
|
*E726* *E727*
|
||||||
range({expr} [, {max} [, {stride}]]) *range()*
|
range({expr} [, {max} [, {stride}]]) *range()*
|
||||||
Returns a |List| with Numbers:
|
Returns a |List| with Numbers:
|
||||||
@@ -6789,10 +6806,12 @@ setpos({expr}, {list})
|
|||||||
[bufnum, lnum, col, off, curswant]
|
[bufnum, lnum, col, off, curswant]
|
||||||
|
|
||||||
"bufnum" is the buffer number. Zero can be used for the
|
"bufnum" is the buffer number. Zero can be used for the
|
||||||
current buffer. Setting the cursor is only possible for
|
current buffer. When setting an uppercase mark "bufnum" is
|
||||||
the current buffer. To set a mark in another buffer you can
|
used for the mark position. For other marks it specifies the
|
||||||
use the |bufnr()| function to turn a file name into a buffer
|
buffer to set the mark in. You can use the |bufnr()| function
|
||||||
number.
|
to turn a file name into a buffer number.
|
||||||
|
For setting the cursor and the ' mark "bufnum" is ignored,
|
||||||
|
since these are associated with a window, not a buffer.
|
||||||
Does not change the jumplist.
|
Does not change the jumplist.
|
||||||
|
|
||||||
"lnum" and "col" are the position in the buffer. The first
|
"lnum" and "col" are the position in the buffer. The first
|
||||||
@@ -8135,7 +8154,7 @@ winnr([{arg}]) The result is a Number, which is the number of the current
|
|||||||
is returned.
|
is returned.
|
||||||
The number can be used with |CTRL-W_w| and ":wincmd w"
|
The number can be used with |CTRL-W_w| and ":wincmd w"
|
||||||
|:wincmd|.
|
|:wincmd|.
|
||||||
Also see |tabpagewinnr()|.
|
Also see |tabpagewinnr()| and |win_getid()|.
|
||||||
|
|
||||||
*winrestcmd()*
|
*winrestcmd()*
|
||||||
winrestcmd() Returns a sequence of |:resize| commands that should restore
|
winrestcmd() Returns a sequence of |:resize| commands that should restore
|
||||||
@@ -8402,6 +8421,7 @@ printer Compiled with |:hardcopy| support.
|
|||||||
profile Compiled with |:profile| support.
|
profile Compiled with |:profile| support.
|
||||||
python Compiled with Python 2.x interface. |has-python|
|
python Compiled with Python 2.x interface. |has-python|
|
||||||
python3 Compiled with Python 3.x interface. |has-python|
|
python3 Compiled with Python 3.x interface. |has-python|
|
||||||
|
pythonx Compiled with |python_x| interface. |has-pythonx|
|
||||||
qnx QNX version of Vim.
|
qnx QNX version of Vim.
|
||||||
quickfix Compiled with |quickfix| support.
|
quickfix Compiled with |quickfix| support.
|
||||||
reltime Compiled with |reltime()| support.
|
reltime Compiled with |reltime()| support.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
*if_pyth.txt* For Vim version 8.0. Last change: 2016 Sep 17
|
*if_pyth.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Paul Moore
|
VIM REFERENCE MANUAL by Paul Moore
|
||||||
@@ -16,6 +16,7 @@ The Python Interface to Vim *python* *Python*
|
|||||||
8. pyeval(), py3eval() Vim functions |python-pyeval|
|
8. pyeval(), py3eval() Vim functions |python-pyeval|
|
||||||
9. Dynamic loading |python-dynamic|
|
9. Dynamic loading |python-dynamic|
|
||||||
10. Python 3 |python3|
|
10. Python 3 |python3|
|
||||||
|
11. Python X |python_x|
|
||||||
|
|
||||||
{Vi does not have any of these commands}
|
{Vi does not have any of these commands}
|
||||||
|
|
||||||
@@ -711,6 +712,7 @@ vim.Function object *python-Function*
|
|||||||
|
|
||||||
To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()|
|
To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()|
|
||||||
functions to evaluate Python expressions and pass their values to VimL.
|
functions to evaluate Python expressions and pass their values to VimL.
|
||||||
|
|pyxeval()| is also available.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
9. Dynamic loading *python-dynamic*
|
9. Dynamic loading *python-dynamic*
|
||||||
@@ -811,5 +813,69 @@ dynamically, these has() calls will try to load them. If only one can be
|
|||||||
loaded at a time, just checking if Python 2 or 3 are available will prevent
|
loaded at a time, just checking if Python 2 or 3 are available will prevent
|
||||||
the other one from being available.
|
the other one from being available.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
11. Python X *python_x* *pythonx*
|
||||||
|
|
||||||
|
Because most python code can be written so that it works with python 2.6+ and
|
||||||
|
python 3 the pyx* functions and commands have been writen. They work exactly
|
||||||
|
the same as the Python 2 and 3 variants, but select the Python version using
|
||||||
|
the 'pyxversion' setting.
|
||||||
|
|
||||||
|
You should set 'pyxversion' in your |.vimrc| to prefer Python 2 or Python 3
|
||||||
|
for Python commands. If you change this setting at runtime you may risk that
|
||||||
|
state of plugins (such as initialization) may be lost.
|
||||||
|
|
||||||
|
If you want to use a module, you can put it in the {rtp}/pythonx directory.
|
||||||
|
See |pythonx-directory|.
|
||||||
|
|
||||||
|
*:pyx* *:pythonx*
|
||||||
|
The `:pyx` and `:pythonx` commands work similar to `:python`. A simple check
|
||||||
|
if the `:pyx` command is working: >
|
||||||
|
:pyx print("Hello")
|
||||||
|
|
||||||
|
To see what version of Python is being used: >
|
||||||
|
:pyx import sys
|
||||||
|
:pyx print(sys.version)
|
||||||
|
<
|
||||||
|
*:pyxfile* *python_x-special-comments*
|
||||||
|
The `:pyxfile` command works similar to `:pyfile`. However you can add one of
|
||||||
|
these comments to force Vim using `:pyfile` or `:py3file`: >
|
||||||
|
#!/any string/python2 " Shebang. Must be the first line of the file.
|
||||||
|
#!/any string/python3 " Shebang. Must be the first line of the file.
|
||||||
|
# requires python 2.x " Maximum lines depend on 'modelines'.
|
||||||
|
# requires python 3.x " Maximum lines depend on 'modelines'.
|
||||||
|
Unlike normal modelines, the bottom of the file is not checked.
|
||||||
|
If none of them are found, the 'pyxversion' setting is used.
|
||||||
|
*W20* *W21*
|
||||||
|
If Vim does not support the selected Python version a silent message will be
|
||||||
|
printed. Use `:messages` to read them.
|
||||||
|
|
||||||
|
*:pyxdo*
|
||||||
|
The `:pyxdo` command works similar to `:pydo`.
|
||||||
|
|
||||||
|
*has-pythonx*
|
||||||
|
You can test if pyx* commands are available with: >
|
||||||
|
if has('pythonx')
|
||||||
|
echo 'pyx* commands are available. (Python ' . &pyx . ')'
|
||||||
|
endif
|
||||||
|
|
||||||
|
When compiled with only one of |+python| or |+python3|, the has() returns 1.
|
||||||
|
When compiled with both |+python| and |+python3|, the test depends on the
|
||||||
|
'pyxversion' setting. If 'pyxversion' is 0, it tests Python 3 first, and if
|
||||||
|
it is not available then Python 2. If 'pyxversion' is 2 or 3, it tests only
|
||||||
|
Python 2 or 3 respectively.
|
||||||
|
|
||||||
|
Note that for has('pythonx') to work it may try to dynamically load Python 3
|
||||||
|
or 2. This may have side effects, especially when Vim can only load one of
|
||||||
|
the two.
|
||||||
|
|
||||||
|
If a user prefers Python 2 and want to fallback to Python 3, he needs to set
|
||||||
|
'pyxversion' explicitly in his |.vimrc|. E.g.: >
|
||||||
|
if has('python')
|
||||||
|
set pyx=2
|
||||||
|
elseif has('python3')
|
||||||
|
set pyx=3
|
||||||
|
endif
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
vim:tw=78:ts=8:ft=help:norl:
|
vim:tw=78:ts=8:ft=help:norl:
|
||||||
|
|||||||
@@ -1440,6 +1440,10 @@ tag command action ~
|
|||||||
|:python| :py[thon] execute Python command
|
|:python| :py[thon] execute Python command
|
||||||
|:pydo| :pyd[o] execute Python command for each line
|
|:pydo| :pyd[o] execute Python command for each line
|
||||||
|:pyfile| :pyf[ile] execute Python script file
|
|:pyfile| :pyf[ile] execute Python script file
|
||||||
|
|:pyx| :pyx execute |python_x| command
|
||||||
|
|:pythonx| :pythonx same as :pyx
|
||||||
|
|:pyxdo| :pyxd[o] execute |python_x| command for each line
|
||||||
|
|:pyxfile| :pyxf[ile] execute |python_x| script file
|
||||||
|:quit| :q[uit] quit current window (when one window quit Vim)
|
|:quit| :q[uit] quit current window (when one window quit Vim)
|
||||||
|:quitall| :quita[ll] quit Vim
|
|:quitall| :quita[ll] quit Vim
|
||||||
|:qall| :qa[ll] quit Vim
|
|:qall| :qa[ll] quit Vim
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
*options.txt* For Vim version 8.0. Last change: 2017 Jan 15
|
*options.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -5786,6 +5786,34 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
Specifies the name of the Python 3 shared library. The default is
|
Specifies the name of the Python 3 shared library. The default is
|
||||||
DYNAMIC_PYTHON3_DLL, which was specified at compile time.
|
DYNAMIC_PYTHON3_DLL, which was specified at compile time.
|
||||||
Environment variables are expanded |:set_env|.
|
Environment variables are expanded |:set_env|.
|
||||||
|
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||||
|
security reasons.
|
||||||
|
|
||||||
|
*'pyxversion'* *'pyx'*
|
||||||
|
'pyxversion' 'pyx' number (default depends on the build)
|
||||||
|
global
|
||||||
|
{not in Vi}
|
||||||
|
{only available when compiled with the |+python| or
|
||||||
|
the |+python3| feature}
|
||||||
|
Specifies the python version used for pyx* functions and commands
|
||||||
|
|python_x|. The default value is as follows:
|
||||||
|
|
||||||
|
Compiled with Default ~
|
||||||
|
|+python| and |+python3| 0
|
||||||
|
only |+python| 2
|
||||||
|
only |+python3| 3
|
||||||
|
|
||||||
|
Available values are 0, 2 and 3.
|
||||||
|
If 'pyxversion' is 0, it is set to 2 or 3 after the first execution of
|
||||||
|
any python2/3 commands or functions. E.g. `:py` sets to 2, and `:py3`
|
||||||
|
sets to 3. `:pyx` sets it to 3 if Python 3 is available, otherwise sets
|
||||||
|
to 2 if Python 2 is available.
|
||||||
|
See also: |has-pythonx|
|
||||||
|
|
||||||
|
If Vim is compiled with only |+python| or |+python3| setting
|
||||||
|
'pyxversion' has no effect. The pyx* functions and commands are
|
||||||
|
always the same as the compiled version.
|
||||||
|
|
||||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||||
security reasons.
|
security reasons.
|
||||||
|
|
||||||
|
|||||||
@@ -835,6 +835,7 @@ Short explanation of each option: *option-list*
|
|||||||
'pumheight' 'ph' maximum height of the popup menu
|
'pumheight' 'ph' maximum height of the popup menu
|
||||||
'pythondll' name of the Python 2 dynamic library
|
'pythondll' name of the Python 2 dynamic library
|
||||||
'pythonthreedll' name of the Python 3 dynamic library
|
'pythonthreedll' name of the Python 3 dynamic library
|
||||||
|
'pyxversion' 'pyx' Python version used for pyx* commands
|
||||||
'quoteescape' 'qe' escape characters used in a string
|
'quoteescape' 'qe' escape characters used in a string
|
||||||
'readonly' 'ro' disallow writing the buffer
|
'readonly' 'ro' disallow writing the buffer
|
||||||
'redrawtime' 'rdt' timeout for 'hlsearch' and |:match| highlighting
|
'redrawtime' 'rdt' timeout for 'hlsearch' and |:match| highlighting
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
*syntax.txt* For Vim version 8.0. Last change: 2016 Oct 30
|
*syntax.txt* For Vim version 8.0. Last change: 2017 Jan 17
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -3479,6 +3479,8 @@ DEFINING CASE *:syn-case* *E390*
|
|||||||
"ignore". Note that any items before this are not affected, and all
|
"ignore". Note that any items before this are not affected, and all
|
||||||
items until the next ":syntax case" command are affected.
|
items until the next ":syntax case" command are affected.
|
||||||
|
|
||||||
|
:sy[ntax] case
|
||||||
|
Show either "syntax case match" or "syntax case ignore" (translated).
|
||||||
|
|
||||||
SPELL CHECKING *:syn-spell*
|
SPELL CHECKING *:syn-spell*
|
||||||
|
|
||||||
@@ -3496,6 +3498,11 @@ SPELL CHECKING *:syn-spell*
|
|||||||
|
|
||||||
To activate spell checking the 'spell' option must be set.
|
To activate spell checking the 'spell' option must be set.
|
||||||
|
|
||||||
|
:sy[ntax] spell
|
||||||
|
Show either "syntax spell toplevel", "syntax spell notoplevel" or
|
||||||
|
"syntax spell default" (translated).
|
||||||
|
|
||||||
|
|
||||||
SYNTAX ISKEYWORD SETTING *:syn-iskeyword*
|
SYNTAX ISKEYWORD SETTING *:syn-iskeyword*
|
||||||
|
|
||||||
:sy[ntax] iskeyword [clear | {option}]
|
:sy[ntax] iskeyword [clear | {option}]
|
||||||
@@ -4089,6 +4096,9 @@ IMPLICIT CONCEAL *:syn-conceal-implicit*
|
|||||||
off" returns to the normal state where the "conceal" flag must be
|
off" returns to the normal state where the "conceal" flag must be
|
||||||
given explicitly.
|
given explicitly.
|
||||||
|
|
||||||
|
:sy[ntax] conceal
|
||||||
|
Show either "syntax conceal on" or "syntax conceal off" (translated).
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
7. Syntax patterns *:syn-pattern* *E401* *E402*
|
7. Syntax patterns *:syn-pattern* *E401* *E402*
|
||||||
|
|
||||||
|
|||||||
@@ -774,6 +774,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
|||||||
'pvw' options.txt /*'pvw'*
|
'pvw' options.txt /*'pvw'*
|
||||||
'pythondll' options.txt /*'pythondll'*
|
'pythondll' options.txt /*'pythondll'*
|
||||||
'pythonthreedll' options.txt /*'pythonthreedll'*
|
'pythonthreedll' options.txt /*'pythonthreedll'*
|
||||||
|
'pyx' options.txt /*'pyx'*
|
||||||
|
'pyxversion' options.txt /*'pyxversion'*
|
||||||
'qe' options.txt /*'qe'*
|
'qe' options.txt /*'qe'*
|
||||||
'quote motion.txt /*'quote*
|
'quote motion.txt /*'quote*
|
||||||
'quoteescape' options.txt /*'quoteescape'*
|
'quoteescape' options.txt /*'quoteescape'*
|
||||||
@@ -923,6 +925,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
|||||||
't_AB' term.txt /*'t_AB'*
|
't_AB' term.txt /*'t_AB'*
|
||||||
't_AF' term.txt /*'t_AF'*
|
't_AF' term.txt /*'t_AF'*
|
||||||
't_AL' term.txt /*'t_AL'*
|
't_AL' term.txt /*'t_AL'*
|
||||||
|
't_BD' term.txt /*'t_BD'*
|
||||||
|
't_BE' term.txt /*'t_BE'*
|
||||||
't_CS' term.txt /*'t_CS'*
|
't_CS' term.txt /*'t_CS'*
|
||||||
't_CV' term.txt /*'t_CV'*
|
't_CV' term.txt /*'t_CV'*
|
||||||
't_Ce' term.txt /*'t_Ce'*
|
't_Ce' term.txt /*'t_Ce'*
|
||||||
@@ -2722,6 +2726,10 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
|||||||
:pyfile if_pyth.txt /*:pyfile*
|
:pyfile if_pyth.txt /*:pyfile*
|
||||||
:python if_pyth.txt /*:python*
|
:python if_pyth.txt /*:python*
|
||||||
:python3 if_pyth.txt /*:python3*
|
:python3 if_pyth.txt /*:python3*
|
||||||
|
:pythonx if_pyth.txt /*:pythonx*
|
||||||
|
:pyx if_pyth.txt /*:pyx*
|
||||||
|
:pyxdo if_pyth.txt /*:pyxdo*
|
||||||
|
:pyxfile if_pyth.txt /*:pyxfile*
|
||||||
:q editing.txt /*:q*
|
:q editing.txt /*:q*
|
||||||
:qa editing.txt /*:qa*
|
:qa editing.txt /*:qa*
|
||||||
:qall editing.txt /*:qall*
|
:qall editing.txt /*:qall*
|
||||||
@@ -4770,6 +4778,8 @@ W16 message.txt /*W16*
|
|||||||
W17 arabic.txt /*W17*
|
W17 arabic.txt /*W17*
|
||||||
W18 syntax.txt /*W18*
|
W18 syntax.txt /*W18*
|
||||||
W19 autocmd.txt /*W19*
|
W19 autocmd.txt /*W19*
|
||||||
|
W20 if_pyth.txt /*W20*
|
||||||
|
W21 if_pyth.txt /*W21*
|
||||||
WORD motion.txt /*WORD*
|
WORD motion.txt /*WORD*
|
||||||
WWW intro.txt /*WWW*
|
WWW intro.txt /*WWW*
|
||||||
Win32 os_win32.txt /*Win32*
|
Win32 os_win32.txt /*Win32*
|
||||||
@@ -6603,6 +6613,7 @@ hangulin.txt hangulin.txt /*hangulin.txt*
|
|||||||
has() eval.txt /*has()*
|
has() eval.txt /*has()*
|
||||||
has-patch eval.txt /*has-patch*
|
has-patch eval.txt /*has-patch*
|
||||||
has-python if_pyth.txt /*has-python*
|
has-python if_pyth.txt /*has-python*
|
||||||
|
has-pythonx if_pyth.txt /*has-pythonx*
|
||||||
has_key() eval.txt /*has_key()*
|
has_key() eval.txt /*has_key()*
|
||||||
haskell.vim syntax.txt /*haskell.vim*
|
haskell.vim syntax.txt /*haskell.vim*
|
||||||
haslocaldir() eval.txt /*haslocaldir()*
|
haslocaldir() eval.txt /*haslocaldir()*
|
||||||
@@ -7901,7 +7912,11 @@ python.vim syntax.txt /*python.vim*
|
|||||||
python2-directory if_pyth.txt /*python2-directory*
|
python2-directory if_pyth.txt /*python2-directory*
|
||||||
python3 if_pyth.txt /*python3*
|
python3 if_pyth.txt /*python3*
|
||||||
python3-directory if_pyth.txt /*python3-directory*
|
python3-directory if_pyth.txt /*python3-directory*
|
||||||
|
python_x if_pyth.txt /*python_x*
|
||||||
|
python_x-special-comments if_pyth.txt /*python_x-special-comments*
|
||||||
|
pythonx if_pyth.txt /*pythonx*
|
||||||
pythonx-directory if_pyth.txt /*pythonx-directory*
|
pythonx-directory if_pyth.txt /*pythonx-directory*
|
||||||
|
pyxeval() eval.txt /*pyxeval()*
|
||||||
q repeat.txt /*q*
|
q repeat.txt /*q*
|
||||||
q/ cmdline.txt /*q\/*
|
q/ cmdline.txt /*q\/*
|
||||||
q: cmdline.txt /*q:*
|
q: cmdline.txt /*q:*
|
||||||
@@ -8443,6 +8458,8 @@ t_@7 term.txt /*t_@7*
|
|||||||
t_AB term.txt /*t_AB*
|
t_AB term.txt /*t_AB*
|
||||||
t_AF term.txt /*t_AF*
|
t_AF term.txt /*t_AF*
|
||||||
t_AL term.txt /*t_AL*
|
t_AL term.txt /*t_AL*
|
||||||
|
t_BD term.txt /*t_BD*
|
||||||
|
t_BE term.txt /*t_BE*
|
||||||
t_CS term.txt /*t_CS*
|
t_CS term.txt /*t_CS*
|
||||||
t_CV term.txt /*t_CV*
|
t_CV term.txt /*t_CV*
|
||||||
t_Ce term.txt /*t_Ce*
|
t_Ce term.txt /*t_Ce*
|
||||||
@@ -8481,6 +8498,8 @@ t_KI term.txt /*t_KI*
|
|||||||
t_KJ term.txt /*t_KJ*
|
t_KJ term.txt /*t_KJ*
|
||||||
t_KK term.txt /*t_KK*
|
t_KK term.txt /*t_KK*
|
||||||
t_KL term.txt /*t_KL*
|
t_KL term.txt /*t_KL*
|
||||||
|
t_PE term.txt /*t_PE*
|
||||||
|
t_PS term.txt /*t_PS*
|
||||||
t_RB term.txt /*t_RB*
|
t_RB term.txt /*t_RB*
|
||||||
t_RI term.txt /*t_RI*
|
t_RI term.txt /*t_RI*
|
||||||
t_RV term.txt /*t_RV*
|
t_RV term.txt /*t_RV*
|
||||||
@@ -9332,6 +9351,7 @@ xterm-8-bit term.txt /*xterm-8-bit*
|
|||||||
xterm-8bit term.txt /*xterm-8bit*
|
xterm-8bit term.txt /*xterm-8bit*
|
||||||
xterm-blink syntax.txt /*xterm-blink*
|
xterm-blink syntax.txt /*xterm-blink*
|
||||||
xterm-blinking-cursor syntax.txt /*xterm-blinking-cursor*
|
xterm-blinking-cursor syntax.txt /*xterm-blinking-cursor*
|
||||||
|
xterm-bracketed-paste term.txt /*xterm-bracketed-paste*
|
||||||
xterm-clipboard term.txt /*xterm-clipboard*
|
xterm-clipboard term.txt /*xterm-clipboard*
|
||||||
xterm-codes term.txt /*xterm-codes*
|
xterm-codes term.txt /*xterm-codes*
|
||||||
xterm-color syntax.txt /*xterm-color*
|
xterm-color syntax.txt /*xterm-color*
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
*term.txt* For Vim version 8.0. Last change: 2016 Sep 02
|
*term.txt* For Vim version 8.0. Last change: 2017 Jan 27
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -99,7 +99,12 @@ is used.
|
|||||||
|
|
||||||
Note that in some situations Vim will not recognize the bracketed paste and
|
Note that in some situations Vim will not recognize the bracketed paste and
|
||||||
you will get the raw text. In other situations Vim will only get the first
|
you will get the raw text. In other situations Vim will only get the first
|
||||||
pasted character and drop the rest, e.g. when using the "r" command.
|
pasted character and drop the rest, e.g. when using the "r" command. If you
|
||||||
|
have a problem with this, disable bracketed paste by putting this in your
|
||||||
|
.vimrc: >
|
||||||
|
set t_BE=
|
||||||
|
If this is done while Vim is running the 't_BD' will be sent to the terminal
|
||||||
|
to disable bracketed paste.
|
||||||
|
|
||||||
*cs7-problem*
|
*cs7-problem*
|
||||||
Note: If the terminal settings are changed after running Vim, you might have
|
Note: If the terminal settings are changed after running Vim, you might have
|
||||||
@@ -414,7 +419,7 @@ Note: Use the <> form if possible
|
|||||||
t_KK <k8> keypad 8 *<k8>* *t_KK* *'t_KK'*
|
t_KK <k8> keypad 8 *<k8>* *t_KK* *'t_KK'*
|
||||||
t_KL <k9> keypad 9 *<k9>* *t_KL* *'t_KL'*
|
t_KL <k9> keypad 9 *<k9>* *t_KL* *'t_KL'*
|
||||||
<Mouse> leader of mouse code *<Mouse>*
|
<Mouse> leader of mouse code *<Mouse>*
|
||||||
t_PS start of brackted paste |xterm-bracketed-paste| *t_PS* 't_PS'
|
t_PS start of bracketed paste |xterm-bracketed-paste| *t_PS* 't_PS'
|
||||||
t_PE end of bracketed paste |xterm-bracketed-paste| *t_PE* 't_PE'
|
t_PE end of bracketed paste |xterm-bracketed-paste| *t_PE* 't_PE'
|
||||||
|
|
||||||
Note about t_so and t_mr: When the termcap entry "so" is not present the
|
Note about t_so and t_mr: When the termcap entry "so" is not present the
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
*todo.txt* For Vim version 8.0. Last change: 2017 Jan 16
|
*todo.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -35,8 +35,6 @@ entered there will not be repeated below, unless there is extra information.
|
|||||||
*known-bugs*
|
*known-bugs*
|
||||||
-------------------- Known bugs and current work -----------------------
|
-------------------- Known bugs and current work -----------------------
|
||||||
|
|
||||||
get_syn_options() does not respect skip in else part. (Zyx)
|
|
||||||
|
|
||||||
+channel:
|
+channel:
|
||||||
- Try out background make plugin:
|
- Try out background make plugin:
|
||||||
https://github.com/AndrewVos/vim-make-background
|
https://github.com/AndrewVos/vim-make-background
|
||||||
@@ -60,6 +58,7 @@ get_syn_options() does not respect skip in else part. (Zyx)
|
|||||||
connecting in the main loop with zero timeout.
|
connecting in the main loop with zero timeout.
|
||||||
- job_start(): run job in a newly opened terminal.
|
- job_start(): run job in a newly opened terminal.
|
||||||
With xterm could use -S{pty}.
|
With xterm could use -S{pty}.
|
||||||
|
Although user could use "xterm -e 'cmd arg'".
|
||||||
|
|
||||||
Regexp problems:
|
Regexp problems:
|
||||||
- Since 7.4.704 the old regex engine fails to match [[:print:]] in 0xf6.
|
- Since 7.4.704 the old regex engine fails to match [[:print:]] in 0xf6.
|
||||||
@@ -108,40 +107,27 @@ Regexp problems:
|
|||||||
|
|
||||||
'] mark invalid after undoing insert "hello".
|
'] mark invalid after undoing insert "hello".
|
||||||
|
|
||||||
Make html indent file use javascript indent, now that it's not just cindent.
|
|
||||||
#1220
|
|
||||||
|
|
||||||
Concatenation with null string causes an error: 'a'[1:0] .. 'b'
|
|
||||||
Might as well handle it like an empty string.
|
|
||||||
|
|
||||||
When using symbolic links, a package path will not be inserted at the right
|
When using symbolic links, a package path will not be inserted at the right
|
||||||
position in 'runtimepath'. (Dugan Chen, 2016 Nov 18)
|
position in 'runtimepath'. (Dugan Chen, 2016 Nov 18)
|
||||||
|
|
||||||
json_encode(): should convert to utf-8. (Nikolai Pavlov, 2016 Jan 23)
|
json_encode(): should convert to utf-8. (Nikolai Pavlov, 2016 Jan 23)
|
||||||
What if there is an invalid character?
|
What if there is an invalid character?
|
||||||
|
|
||||||
Include rust files. (Klabnik, #1356)
|
|
||||||
|
|
||||||
Allow using json with empty key? Dict already has it.
|
Allow using json with empty key? Dict already has it.
|
||||||
|
|
||||||
Json string with trailing \u should be an error. (Lcd)
|
Json string with trailing \u should be an error. (Lcd)
|
||||||
|
|
||||||
Patch to deal with changed configure events in GTK 3. (Jan Alexander Steffens,
|
|
||||||
2016 Oct 23 #1193)
|
|
||||||
Remarks from nuko8, 2016 Nov 2.
|
|
||||||
|
|
||||||
Multi-byte bug: dv} splits char. (Urtica Dioica, 2017 Jan 9)
|
Multi-byte bug: dv} splits char. (Urtica Dioica, 2017 Jan 9)
|
||||||
|
|
||||||
Patch to change order of compiler flags. (Yousong Zhou, 2016 Sep 19, #1100)
|
Patch: Make mode() return "ix" or "Rx" when in completion mode.
|
||||||
|
(Yegappan Lakshmanan, 2017 Jan 19, #1397, update Jan 22)
|
||||||
|
|
||||||
Patch to add command line completion for :cexpr commands. (Yegappan
|
With Visual selection of a multi-byte character the '] mark is on the last
|
||||||
Lakshmanan, 2016 Dec 13)
|
byte, should be first byte?
|
||||||
|
|
||||||
Patch for :pyx, run python commands depending on the supported version.
|
When session file has name in argument list but the buffer was deleted, the
|
||||||
(Marc Weber, update from Ken Takata, 2016 Sep 19, 2017 Jan 6)
|
buffer is not deleted when using the session file. (#1393)
|
||||||
|
Should add the buffer in hidden state.
|
||||||
Patch to avoid warnings for overflow. (Mike Williams, 2016 Dec 16)
|
|
||||||
Update Dec 19.
|
|
||||||
|
|
||||||
When an item in the quickfix list has a file name that does not exist, behave
|
When an item in the quickfix list has a file name that does not exist, behave
|
||||||
like the item was not a match for :cnext.
|
like the item was not a match for :cnext.
|
||||||
@@ -150,18 +136,13 @@ Wrong diff highlighting with three files. (2016 Oct 20, #1186)
|
|||||||
Also get E749 on exit.
|
Also get E749 on exit.
|
||||||
Another example in #1309
|
Another example in #1309
|
||||||
|
|
||||||
Patch to fix vim_iswordp() works differently on chars <256 that are two bytes.
|
Completion for user-defined commands does not work if a few chararacters were
|
||||||
Ozaki Kiichi, 2016 Dec 11.
|
already typed. (Dominique, 2017 Jan 26)
|
||||||
|
|
||||||
When deleting a mark or register, leave a tombstone, so that it's also deleted
|
When deleting a mark or register, leave a tombstone, so that it's also deleted
|
||||||
when writing viminfo (and the delete was the most recent action). #1339
|
when writing viminfo (and the delete was the most recent action). #1339
|
||||||
|
|
||||||
Relevant neovim patch:
|
Relevant neovim patch:
|
||||||
https://github.com/neovim/neovim/pull/5717
|
|
||||||
test case:
|
|
||||||
https://github.com/neovim/neovim/pull/5717#issuecomment-264845481
|
|
||||||
Others:
|
|
||||||
https://github.com/neovim/neovim/issues/5713#issuecomment-265136186
|
|
||||||
https://github.com/neovim/neovim/pull/5737#issuecomment-266055165
|
https://github.com/neovim/neovim/pull/5737#issuecomment-266055165
|
||||||
|
|
||||||
Patch for better explanation of 'compatible' side effects.
|
Patch for better explanation of 'compatible' side effects.
|
||||||
@@ -199,6 +180,10 @@ Patch for restoring wide characters in the console buffer.
|
|||||||
Patch to fix escaping of job arguments. (Yasuhiro Matsumoto, 2016 Oct 5)
|
Patch to fix escaping of job arguments. (Yasuhiro Matsumoto, 2016 Oct 5)
|
||||||
Update Oct 14: https://gist.github.com/mattn/d47e7d3bfe5ade4be86062b565a4bfca
|
Update Oct 14: https://gist.github.com/mattn/d47e7d3bfe5ade4be86062b565a4bfca
|
||||||
|
|
||||||
|
The TermResponse event is not triggered when a plugin has set 'eventignore' to
|
||||||
|
"all". Netrw does this. (Gary Johnson, 2017 Jan 24)
|
||||||
|
Postpone the event until 'eventignore' is reset.
|
||||||
|
|
||||||
Once .exe with updated installer is available: Add remark to download page
|
Once .exe with updated installer is available: Add remark to download page
|
||||||
about /S and /D options (Ken Takata, 2016 Apr 13)
|
about /S and /D options (Ken Takata, 2016 Apr 13)
|
||||||
Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases
|
Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases
|
||||||
@@ -220,6 +205,7 @@ lines: :g/^/normal yyp On Unix it works OK. (Bryce Orgill, 2016 Nov 5)
|
|||||||
|
|
||||||
Patch for wrong cursor position on wrapped line, involving breakindent.
|
Patch for wrong cursor position on wrapped line, involving breakindent.
|
||||||
(Ozaki Kiichi, 2016 Nov 25)
|
(Ozaki Kiichi, 2016 Nov 25)
|
||||||
|
Does this also fix #1408 ?
|
||||||
|
|
||||||
Patch for 'cursorlinenr' option. (Ozaki Kiichi, 2016 Nov 30)
|
Patch for 'cursorlinenr' option. (Ozaki Kiichi, 2016 Nov 30)
|
||||||
|
|
||||||
@@ -569,6 +555,9 @@ Patch to add :mapgroup, put mappings in a group like augroup.
|
|||||||
Value returned by virtcol() changes depending on how lines wrap. This is
|
Value returned by virtcol() changes depending on how lines wrap. This is
|
||||||
inconsistent with the documentation.
|
inconsistent with the documentation.
|
||||||
|
|
||||||
|
Value of virtcol() for '[ and '] depend on multi-byte character.
|
||||||
|
(Luchr, #277)
|
||||||
|
|
||||||
Can we cache the syntax attributes, so that updates for 'relativenumber' and
|
Can we cache the syntax attributes, so that updates for 'relativenumber' and
|
||||||
'cursorline'/'cursorcolumn' are a lot faster?
|
'cursorline'/'cursorcolumn' are a lot faster?
|
||||||
|
|
||||||
@@ -1061,9 +1050,6 @@ Aug 16)
|
|||||||
When there are no command line arguments ":next" and ":argu" give E163, which
|
When there are no command line arguments ":next" and ":argu" give E163, which
|
||||||
is confusing. Should say "the argument list is empty".
|
is confusing. Should say "the argument list is empty".
|
||||||
|
|
||||||
xterm supports escape sequences to mark a paste operation. Need to be
|
|
||||||
enabled. (Bruno Sutic, 2014 Jul 11) How to know the terminal supports this?
|
|
||||||
|
|
||||||
URXVT:
|
URXVT:
|
||||||
- will get stuck if byte sequence does not contain the expected semicolon.
|
- will get stuck if byte sequence does not contain the expected semicolon.
|
||||||
- Use urxvt mouse support also in xterm. Explanations:
|
- Use urxvt mouse support also in xterm. Explanations:
|
||||||
|
|||||||
@@ -1000,6 +1000,7 @@ Various: *various-functions*
|
|||||||
perleval() evaluate Perl expression (|+perl|)
|
perleval() evaluate Perl expression (|+perl|)
|
||||||
py3eval() evaluate Python expression (|+python3|)
|
py3eval() evaluate Python expression (|+python3|)
|
||||||
pyeval() evaluate Python expression (|+python|)
|
pyeval() evaluate Python expression (|+python|)
|
||||||
|
pyxeval() evaluate |python_x| expression
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
*41.7* Defining a function
|
*41.7* Defining a function
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
" Vim filetype plugin file
|
" Vim filetype plugin file
|
||||||
" Language: man
|
" Language: man
|
||||||
" Maintainer: SungHyun Nam <goweol@gmail.com>
|
" Maintainer: SungHyun Nam <goweol@gmail.com>
|
||||||
" Last Change: 2017 Jan 04
|
" Last Change: 2017 Jan 18
|
||||||
|
|
||||||
" To make the ":Man" command available before editing a manual page, source
|
" To make the ":Man" command available before editing a manual page, source
|
||||||
" this script from your startup vimrc file.
|
" this script from your startup vimrc file.
|
||||||
@@ -97,7 +97,7 @@ func <SID>GetCmdArg(sect, page)
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func <SID>FindPage(sect, page)
|
func <SID>FindPage(sect, page)
|
||||||
let where = system("/usr/bin/man ".s:man_find_arg.' '.s:GetCmdArg(a:sect, a:page))
|
let where = system("man ".s:man_find_arg.' '.s:GetCmdArg(a:sect, a:page))
|
||||||
if where !~ "^/"
|
if where !~ "^/"
|
||||||
if matchstr(where, " [^ ]*$") !~ "^ /"
|
if matchstr(where, " [^ ]*$") !~ "^ /"
|
||||||
return 0
|
return 0
|
||||||
@@ -176,7 +176,7 @@ func <SID>GetPage(...)
|
|||||||
let $MANWIDTH = winwidth(0)
|
let $MANWIDTH = winwidth(0)
|
||||||
let unsetwidth = 1
|
let unsetwidth = 1
|
||||||
endif
|
endif
|
||||||
silent exec "r!/usr/bin/man ".s:GetCmdArg(sect, page)." | col -b"
|
silent exec "r !man ".s:GetCmdArg(sect, page)." | col -b"
|
||||||
if unsetwidth
|
if unsetwidth
|
||||||
let $MANWIDTH = ''
|
let $MANWIDTH = ''
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
" Header: "{{{
|
" Header: "{{{
|
||||||
" Maintainer: Bram Moolenaar
|
" Maintainer: Bram Moolenaar
|
||||||
" Original Author: Andy Wokula <anwoku@yahoo.de>
|
" Original Author: Andy Wokula <anwoku@yahoo.de>
|
||||||
" Last Change: 2016 Mar 30
|
" Last Change: 2017 Jan 17
|
||||||
" Version: 1.0
|
" Version: 1.0
|
||||||
" Description: HTML indent script with cached state for faster indenting on a
|
" Description: HTML indent script with cached state for faster indenting on a
|
||||||
" range of lines.
|
" range of lines.
|
||||||
@@ -25,27 +25,22 @@
|
|||||||
if exists("b:did_indent") "{{{
|
if exists("b:did_indent") "{{{
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Load the Javascript indent script first, it defines GetJavascriptIndent().
|
||||||
|
" Undo the rest.
|
||||||
|
" Load base python indent.
|
||||||
|
if !exists('*GetJavascriptIndent')
|
||||||
|
runtime! indent/javascript.vim
|
||||||
|
endif
|
||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
|
|
||||||
setlocal indentexpr=HtmlIndent()
|
setlocal indentexpr=HtmlIndent()
|
||||||
setlocal indentkeys=o,O,<Return>,<>>,{,},!^F
|
setlocal indentkeys=o,O,<Return>,<>>,{,},!^F
|
||||||
|
|
||||||
" "j1" is included to make cindent() work better with Javascript.
|
|
||||||
setlocal cino=j1
|
|
||||||
" "J1" should be included, but it doen't work properly before 7.4.355.
|
|
||||||
if has("patch-7.4.355")
|
|
||||||
setlocal cino+=J1
|
|
||||||
endif
|
|
||||||
" Before patch 7.4.355 indenting after "(function() {" does not work well, add
|
|
||||||
" )2 to limit paren search.
|
|
||||||
if !has("patch-7.4.355")
|
|
||||||
setlocal cino+=)2
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Needed for % to work when finding start/end of a tag.
|
" Needed for % to work when finding start/end of a tag.
|
||||||
setlocal matchpairs+=<:>
|
setlocal matchpairs+=<:>
|
||||||
|
|
||||||
let b:undo_indent = "setlocal inde< indk< cino<"
|
let b:undo_indent = "setlocal inde< indk<"
|
||||||
|
|
||||||
" b:hi_indent keeps state to speed up indenting consecutive lines.
|
" b:hi_indent keeps state to speed up indenting consecutive lines.
|
||||||
let b:hi_indent = {"lnum": -1}
|
let b:hi_indent = {"lnum": -1}
|
||||||
@@ -596,7 +591,7 @@ func! s:Alien3()
|
|||||||
return eval(b:hi_js1indent)
|
return eval(b:hi_js1indent)
|
||||||
endif
|
endif
|
||||||
if b:hi_indent.scripttype == "javascript"
|
if b:hi_indent.scripttype == "javascript"
|
||||||
return cindent(v:lnum)
|
return GetJavascriptIndent()
|
||||||
else
|
else
|
||||||
return -1
|
return -1
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -923,7 +923,7 @@ if has("folding")
|
|||||||
call append("$", "foldmarker\tmarkers used when 'foldmethod' is \"marker\"")
|
call append("$", "foldmarker\tmarkers used when 'foldmethod' is \"marker\"")
|
||||||
call append("$", "\t(local to window)")
|
call append("$", "\t(local to window)")
|
||||||
call <SID>OptionL("fmr")
|
call <SID>OptionL("fmr")
|
||||||
call append("$", "foldnestmax\tmaximum fold depth for when 'foldmethod is \"indent\" or \"syntax\"")
|
call append("$", "foldnestmax\tmaximum fold depth for when 'foldmethod' is \"indent\" or \"syntax\"")
|
||||||
call append("$", "\t(local to window)")
|
call append("$", "\t(local to window)")
|
||||||
call <SID>OptionL("fdn")
|
call <SID>OptionL("fdn")
|
||||||
endif
|
endif
|
||||||
@@ -1324,6 +1324,10 @@ if exists("&perldll")
|
|||||||
call append("$", "perldll\tname of the Perl dynamic library")
|
call append("$", "perldll\tname of the Perl dynamic library")
|
||||||
call <SID>OptionG("perldll", &perldll)
|
call <SID>OptionG("perldll", &perldll)
|
||||||
endif
|
endif
|
||||||
|
if has('pythonx')
|
||||||
|
call append("$", "pyxversion\twhether to use Python 2 or 3")
|
||||||
|
call append("$", " \tset pyx=" . &wd)
|
||||||
|
endif
|
||||||
if exists("&pythondll")
|
if exists("&pythondll")
|
||||||
call append("$", "pythondll\tname of the Python 2 dynamic library")
|
call append("$", "pythondll\tname of the Python 2 dynamic library")
|
||||||
call <SID>OptionG("pythondll", &pythondll)
|
call <SID>OptionG("pythondll", &pythondll)
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: AutoHotkey script file
|
" Language: AutoHotkey script file
|
||||||
" Maintainer: SungHyun Nam <goweol@gmail.com>
|
" Maintainer: Michael Wong
|
||||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
" https://github.com/mmikeww/autohotkey.vim
|
||||||
" Latest Revision: 2015-10-29
|
" Latest Revision: 2017-01-23
|
||||||
|
" Previous Maintainers: SungHyun Nam <goweol@gmail.com>
|
||||||
|
" Nikolai Weibull <now@bitwi.se>
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
@@ -17,68 +19,11 @@ syn keyword autohotkeyTodo
|
|||||||
\ contained
|
\ contained
|
||||||
\ TODO FIXME XXX NOTE
|
\ TODO FIXME XXX NOTE
|
||||||
|
|
||||||
syn cluster autohotkeyCommentGroup
|
" only these chars are valid as escape sequences: ,%`;nrbtvaf
|
||||||
\ contains=
|
" https://autohotkey.com/docs/commands/_EscapeChar.htm
|
||||||
\ autohotkeyTodo,
|
|
||||||
\ @Spell
|
|
||||||
|
|
||||||
syn match autohotkeyComment
|
|
||||||
\ display
|
|
||||||
\ contains=@autohotkeyCommentGroup
|
|
||||||
\ '`\@<!;.*$'
|
|
||||||
|
|
||||||
syn region autohotkeyComment
|
|
||||||
\ contains=@autohotkeyCommentGroup
|
|
||||||
\ matchgroup=autohotkeyCommentStart
|
|
||||||
\ start='/\*'
|
|
||||||
\ end='\*/'
|
|
||||||
|
|
||||||
syn match autohotkeyEscape
|
syn match autohotkeyEscape
|
||||||
\ display
|
\ display
|
||||||
\ '`.'
|
\ '`[,%`;nrbtvaf]'
|
||||||
|
|
||||||
syn match autohotkeyHotkey
|
|
||||||
\ contains=autohotkeyKey,
|
|
||||||
\ autohotkeyHotkeyDelimiter
|
|
||||||
\ display
|
|
||||||
\ '^.\{-}::'
|
|
||||||
|
|
||||||
syn match autohotkeyKey
|
|
||||||
\ contained
|
|
||||||
\ display
|
|
||||||
\ '^.\{-}'
|
|
||||||
|
|
||||||
syn match autohotkeyDelimiter
|
|
||||||
\ contained
|
|
||||||
\ display
|
|
||||||
\ '::'
|
|
||||||
|
|
||||||
syn match autohotkeyHotstringDefinition
|
|
||||||
\ contains=autohotkeyHotstring,
|
|
||||||
\ autohotkeyHotstringDelimiter
|
|
||||||
\ display
|
|
||||||
\ '^:\%(B0\|C1\|K\d\+\|P\d\+\|S[IPE]\|Z\d\=\|[*?COR]\)*:.\{-}::'
|
|
||||||
|
|
||||||
syn match autohotkeyHotstring
|
|
||||||
\ contained
|
|
||||||
\ display
|
|
||||||
\ '.\{-}'
|
|
||||||
|
|
||||||
syn match autohotkeyHotstringDelimiter
|
|
||||||
\ contained
|
|
||||||
\ display
|
|
||||||
\ '::'
|
|
||||||
|
|
||||||
syn match autohotkeyHotstringDelimiter
|
|
||||||
\ contains=autohotkeyHotstringOptions
|
|
||||||
\ contained
|
|
||||||
\ display
|
|
||||||
\ ':\%(B0\|C1\|K\d\+\|P\d\+\|S[IPE]\|Z\d\=\|[*?COR]\):'
|
|
||||||
|
|
||||||
syn match autohotkeyHotstringOptions
|
|
||||||
\ contained
|
|
||||||
\ display
|
|
||||||
\ '\%(B0\|C1\|K\d\+\|P\d\+\|S[IPE]\|Z\d\=\|[*?COR]\)'
|
|
||||||
|
|
||||||
syn region autohotkeyString
|
syn region autohotkeyString
|
||||||
\ display
|
\ display
|
||||||
@@ -88,39 +33,46 @@ syn region autohotkeyString
|
|||||||
\ end=+"+
|
\ end=+"+
|
||||||
\ contains=autohotkeyEscape
|
\ contains=autohotkeyEscape
|
||||||
|
|
||||||
syn region autohotkeyVariable
|
syn match autohotkeyVariable
|
||||||
\ display
|
\ display
|
||||||
\ oneline
|
\ oneline
|
||||||
\ contains=autohotkeyBuiltinVariable
|
\ contains=autohotkeyBuiltinVariable
|
||||||
\ matchgroup=autohotkeyVariableDelimiter
|
|
||||||
\ start="%"
|
|
||||||
\ end="%"
|
|
||||||
\ keepend
|
\ keepend
|
||||||
|
\ '%\S\{-}%'
|
||||||
|
|
||||||
syn keyword autohotkeyBuiltinVariable
|
syn keyword autohotkeyBuiltinVariable
|
||||||
\ A_Space A_Tab
|
\ A_Space A_Tab
|
||||||
\ A_WorkingDir A_ScriptDir A_ScriptName A_ScriptFullPath A_LineNumber
|
\ A_WorkingDir A_ScriptDir A_ScriptName A_ScriptFullPath A_ScriptHwnd A_LineNumber
|
||||||
\ A_LineFile A_AhkVersion A_AhkPAth A_IsCompiled A_ExitReason
|
\ A_LineFile A_ThisFunc A_ThisLabel A_AhkVersion A_AhkPath A_IsUnicode A_IsCompiled A_ExitReason
|
||||||
\ A_YYYY A_MM A_DD A_MMMM A_MMM A_DDDD A_DDD A_WDay A_YWeek A_Hour A_Min
|
\ A_YYYY A_MM A_DD A_MMMM A_MMM A_DDDD A_DDD A_WDay A_YDay A_YWeek A_Hour A_Min
|
||||||
|
\ A_Mon A_Year A_MDay A_NumBatchLines
|
||||||
\ A_Sec A_MSec A_Now A_NowUTC A_TickCount
|
\ A_Sec A_MSec A_Now A_NowUTC A_TickCount
|
||||||
\ A_IsSuspended A_BatchLines A_TitleMatchMode A_TitleMatchModeSpeed
|
\ A_IsSuspended A_IsPaused A_IsCritical A_BatchLines A_TitleMatchMode A_TitleMatchModeSpeed
|
||||||
\ A_DetectHiddenWindows A_DetectHiddenText A_AutoTrim A_STringCaseSense
|
\ A_DetectHiddenWindows A_DetectHiddenText A_AutoTrim A_StringCaseSense
|
||||||
\ A_FormatInteger A_FormatFloat A_KeyDelay A_WinDelay A_ControlDelay
|
\ A_FileEncoding A_FormatInteger A_FormatFloat A_KeyDelay A_WinDelay A_ControlDelay
|
||||||
\ A_MouseDelay A_DefaultMouseSpeed A_IconHidden A_IconTip A_IconFile
|
\ A_SendMode A_SendLevel A_StoreCapsLockMode A_KeyDelay A_KeyDelayDuration
|
||||||
|
\ A_KeyDelayPlay A_KeyDelayPlayDuration A_MouseDelayPlay
|
||||||
|
\ A_MouseDelay A_DefaultMouseSpeed A_RegView A_IconHidden A_IconTip A_IconFile
|
||||||
|
\ A_CoordModeToolTip A_CoordModePixel A_CoordModeMouse A_CoordModeCaret A_CoordModeMenu
|
||||||
\ A_IconNumber
|
\ A_IconNumber
|
||||||
\ A_TimeIdle A_TimeIdlePhysical
|
\ A_TimeIdle A_TimeIdlePhysical A_DefaultGui A_DefaultListView A_DefaultTreeView
|
||||||
\ A_Gui A_GuiControl A_GuiWidth A_GuiHeight A_GuiX A_GuiY A_GuiEvent
|
\ A_Gui A_GuiControl A_GuiWidth A_GuiHeight A_GuiX A_GuiY A_GuiEvent
|
||||||
\ A_GuiControlEvent A_EventInfo
|
\ A_GuiControlEvent A_EventInfo
|
||||||
\ A_ThisMenuItem A_ThisMenu A_ThisMenuItemPos A_ThisHotkey A_PriorHotkey
|
\ A_ThisMenuItem A_ThisMenu A_ThisMenuItemPos A_ThisHotkey A_PriorHotkey
|
||||||
\ A_TimeSinceThisHotkey A_TimeSincePriorHotkey A_EndChar
|
\ A_PriorKey A_TimeSinceThisHotkey A_TimeSincePriorHotkey A_EndChar
|
||||||
\ ComSpec A_Temp A_OSType A_OSVersion A_Language A_ComputerName A_UserName
|
\ ComSpec A_Temp A_OSType A_OSVersion A_Language A_ComputerName A_UserName
|
||||||
|
\ A_Is64BitOS A_PtrSize
|
||||||
\ A_WinDir A_ProgramFiles ProgramFiles A_AppData A_AppDataCommon A_Desktop
|
\ A_WinDir A_ProgramFiles ProgramFiles A_AppData A_AppDataCommon A_Desktop
|
||||||
\ A_DesktopCommon A_StartMenu A_StartMenuCommon A_Programs
|
\ A_DesktopCommon A_StartMenu A_StartMenuCommon A_Programs
|
||||||
\ A_ProgramsCommon A_Startup A_StartupCommon A_MyDocuments A_IsAdmin
|
\ A_ProgramsCommon A_Startup A_StartupCommon A_MyDocuments A_IsAdmin
|
||||||
\ A_ScreenWidth A_ScreenHeight A_IPAddress1 A_IPAddress2 A_IPAddress3
|
\ A_ScreenWidth A_ScreenHeight A_ScreenDPI A_IPAddress1 A_IPAddress2 A_IPAddress3
|
||||||
\ A_IPAddress4
|
\ A_IPAddress4
|
||||||
\ A_Cursor A_CaretX A_CaretY Clipboard ClipboardAll ErrorLevel A_LastError
|
\ A_Cursor A_CaretX A_CaretY Clipboard ClipboardAll ErrorLevel A_LastError
|
||||||
\ A_Index A_LoopFileName A_LoopRegName A_LoopReadLine A_LoopField
|
\ A_Index A_LoopFileName A_LoopRegName A_LoopReadLine A_LoopField
|
||||||
|
\ A_LoopFileExt A_LoopFileFullPath A_LoopFileLongPath A_LoopFileShortPath
|
||||||
|
\ A_LoopFileShortName A_LoopFileDir A_LoopFileTimeModified A_LoopFileTimeCreated
|
||||||
|
\ A_LoopFileTimeAccessed A_LoopFileAttrib A_LoopFileSize A_LoopFileSizeKB A_LoopFileSizeMB
|
||||||
|
\ A_LoopRegType A_LoopRegKey A_LoopRegSubKey A_LoopRegTimeModified
|
||||||
|
|
||||||
syn match autohotkeyBuiltinVariable
|
syn match autohotkeyBuiltinVariable
|
||||||
\ contained
|
\ contained
|
||||||
@@ -130,7 +82,7 @@ syn match autohotkeyBuiltinVariable
|
|||||||
syn keyword autohotkeyCommand
|
syn keyword autohotkeyCommand
|
||||||
\ ClipWait EnvGet EnvSet EnvUpdate
|
\ ClipWait EnvGet EnvSet EnvUpdate
|
||||||
\ Drive DriveGet DriveSpaceFree FileAppend FileCopy FileCopyDir
|
\ Drive DriveGet DriveSpaceFree FileAppend FileCopy FileCopyDir
|
||||||
\ FileCreateDir FileCreateShortcut FileDelete FileGetAttrib
|
\ FileCreateDir FileCreateShortcut FileDelete FileGetAttrib FileEncoding
|
||||||
\ FileGetShortcut FileGetSize FileGetTime FileGetVersion FileInstall
|
\ FileGetShortcut FileGetSize FileGetTime FileGetVersion FileInstall
|
||||||
\ FileMove FileMoveDir FileReadLine FileRead FileRecycle FileRecycleEmpty
|
\ FileMove FileMoveDir FileReadLine FileRead FileRecycle FileRecycleEmpty
|
||||||
\ FileRemoveDir FileSelectFolder FileSelectFile FileSetAttrib FileSetTime
|
\ FileRemoveDir FileSelectFolder FileSelectFile FileSetAttrib FileSetTime
|
||||||
@@ -153,7 +105,7 @@ syn keyword autohotkeyCommand
|
|||||||
\ SoundSetWaveVolume
|
\ SoundSetWaveVolume
|
||||||
\ FormatTime IfInString IfNotInString Sort StringCaseSense StringGetPos
|
\ FormatTime IfInString IfNotInString Sort StringCaseSense StringGetPos
|
||||||
\ StringLeft StringRight StringLower StringUpper StringMid StringReplace
|
\ StringLeft StringRight StringLower StringUpper StringMid StringReplace
|
||||||
\ StringSplit StringTrimLeft StringTrimRight
|
\ StringSplit StringTrimLeft StringTrimRight StringLen
|
||||||
\ Control ControlClick ControlFocus ControlGet ControlGetFocus
|
\ Control ControlClick ControlFocus ControlGet ControlGetFocus
|
||||||
\ ControlGetPos ControlGetText ControlMove ControlSend ControlSendRaw
|
\ ControlGetPos ControlGetText ControlMove ControlSend ControlSendRaw
|
||||||
\ ControlSetText Menu PostMessage SendMessage SetControlDelay
|
\ ControlSetText Menu PostMessage SendMessage SetControlDelay
|
||||||
@@ -164,12 +116,16 @@ syn keyword autohotkeyCommand
|
|||||||
\ WinGetText WinGetTitle WinHide WinKill WinMaximize WinMinimize
|
\ WinGetText WinGetTitle WinHide WinKill WinMaximize WinMinimize
|
||||||
\ WinMinimizeAll WinMinimizeAllUndo WinMove WinRestore WinSet
|
\ WinMinimizeAll WinMinimizeAllUndo WinMove WinRestore WinSet
|
||||||
\ WinSetTitle WinShow WinWait WinWaitActive WinWaitNotActive WinWaitClose
|
\ WinSetTitle WinShow WinWait WinWaitActive WinWaitNotActive WinWaitClose
|
||||||
|
\ SetCapsLockState SetNumLockState SetScrollLockState
|
||||||
|
|
||||||
syn keyword autohotkeyFunction
|
syn keyword autohotkeyFunction
|
||||||
\ InStr RegExMatch RegExReplace StrLen SubStr Asc Chr
|
\ InStr RegExMatch RegExReplace StrLen SubStr Asc Chr
|
||||||
\ DllCall VarSetCapacity WinActive WinExist IsLabel OnMessage
|
\ DllCall VarSetCapacity WinActive WinExist IsLabel OnMessage
|
||||||
\ Abs Ceil Exp Floor Log Ln Mod Round Sqrt Sin Cos Tan ASin ACos ATan
|
\ Abs Ceil Exp Floor Log Ln Mod Round Sqrt Sin Cos Tan ASin ACos ATan
|
||||||
\ FileExist GetKeyState
|
\ FileExist GetKeyState NumGet NumPut StrGet StrPut RegisterCallback
|
||||||
|
\ IsFunc Trim LTrim RTrim IsObject Object Array FileOpen
|
||||||
|
\ ComObjActive ComObjArray ComObjConnect ComObjCreate ComObjGet
|
||||||
|
\ ComObjError ComObjFlags ComObjQuery ComObjType ComObjValue ComObject
|
||||||
|
|
||||||
syn keyword autohotkeyStatement
|
syn keyword autohotkeyStatement
|
||||||
\ Break Continue Exit ExitApp Gosub Goto OnExit Pause Return
|
\ Break Continue Exit ExitApp Gosub Goto OnExit Pause Return
|
||||||
@@ -180,7 +136,9 @@ syn keyword autohotkeyRepeat
|
|||||||
|
|
||||||
syn keyword autohotkeyConditional
|
syn keyword autohotkeyConditional
|
||||||
\ IfExist IfNotExist If IfEqual IfLess IfGreater Else
|
\ IfExist IfNotExist If IfEqual IfLess IfGreater Else
|
||||||
\ IfWinExist IfWinNotExist
|
\ IfWinExist IfWinNotExist IfWinActive IfWinNotActive
|
||||||
|
\ IfNotEqual IfLessOrEqual IfGreaterOrEqual
|
||||||
|
\ while until for in
|
||||||
|
|
||||||
syn match autohotkeyPreProcStart
|
syn match autohotkeyPreProcStart
|
||||||
\ nextgroup=
|
\ nextgroup=
|
||||||
@@ -200,6 +158,7 @@ syn keyword autohotkeyPreProc
|
|||||||
\ HotkeyInterval HotKeyModifierTimeout
|
\ HotkeyInterval HotKeyModifierTimeout
|
||||||
\ Hotstring
|
\ Hotstring
|
||||||
\ IfWinActive IfWinNotActive IfWinExist IfWinNotExist
|
\ IfWinActive IfWinNotActive IfWinExist IfWinNotExist
|
||||||
|
\ If IfTimeout
|
||||||
\ MaxHotkeysPerInterval MaxThreads MaxThreadsBuffer MaxThreadsPerHotkey
|
\ MaxHotkeysPerInterval MaxThreads MaxThreadsBuffer MaxThreadsPerHotkey
|
||||||
\ UseHook InstallKeybdHook InstallMouseHook
|
\ UseHook InstallKeybdHook InstallMouseHook
|
||||||
\ KeyHistory
|
\ KeyHistory
|
||||||
@@ -213,6 +172,10 @@ syn keyword autohotkeyPreProc
|
|||||||
\ MaxMem
|
\ MaxMem
|
||||||
\ NoEnv
|
\ NoEnv
|
||||||
\ Persistent
|
\ Persistent
|
||||||
|
\ LTrim
|
||||||
|
\ InputLevel
|
||||||
|
\ MenuMaskKey
|
||||||
|
\ Warn
|
||||||
|
|
||||||
syn keyword autohotkeyMatchClass
|
syn keyword autohotkeyMatchClass
|
||||||
\ ahk_group ahk_class ahk_id ahk_pid
|
\ ahk_group ahk_class ahk_id ahk_pid
|
||||||
@@ -243,11 +206,74 @@ syn match autohotkeyFloat
|
|||||||
syn keyword autohotkeyType
|
syn keyword autohotkeyType
|
||||||
\ local
|
\ local
|
||||||
\ global
|
\ global
|
||||||
|
\ static
|
||||||
|
\ byref
|
||||||
|
|
||||||
syn keyword autohotkeyBoolean
|
syn keyword autohotkeyBoolean
|
||||||
\ true
|
\ true
|
||||||
\ false
|
\ false
|
||||||
|
|
||||||
|
syn match autohotkeyHotkey
|
||||||
|
\ contains=autohotkeyKey,
|
||||||
|
\ autohotkeyHotkeyDelimiter
|
||||||
|
\ display
|
||||||
|
\ '^.\{-}::'
|
||||||
|
|
||||||
|
syn match autohotkeyKey
|
||||||
|
\ contained
|
||||||
|
\ display
|
||||||
|
\ '^.\{-}'
|
||||||
|
|
||||||
|
syn match autohotkeyDelimiter
|
||||||
|
\ contained
|
||||||
|
\ display
|
||||||
|
\ '::'
|
||||||
|
|
||||||
|
" allowable hotstring options:
|
||||||
|
" https://autohotkey.com/docs/Hotstrings.htm
|
||||||
|
syn match autohotkeyHotstringDefinition
|
||||||
|
\ contains=autohotkeyHotstring,
|
||||||
|
\ autohotkeyHotstringDelimiter
|
||||||
|
\ display
|
||||||
|
\ '^\s*:\%([*?]\|[BORZ]0\?\|C[01]\?\|K\d\+\|P\d\+\|S[IPE]\)*:.\{-}::'
|
||||||
|
|
||||||
|
syn match autohotkeyHotstring
|
||||||
|
\ contained
|
||||||
|
\ display
|
||||||
|
\ '.\{-}'
|
||||||
|
|
||||||
|
syn match autohotkeyHotstringDelimiter
|
||||||
|
\ contained
|
||||||
|
\ display
|
||||||
|
\ '::'
|
||||||
|
|
||||||
|
syn match autohotkeyHotstringDelimiter
|
||||||
|
\ contains=autohotkeyHotstringOptions
|
||||||
|
\ contained
|
||||||
|
\ display
|
||||||
|
\ ':\%([*?]\|[BORZ]0\?\|C[01]\?\|K\d\+\|P\d\+\|S[IPE]\)*:'
|
||||||
|
|
||||||
|
syn match autohotkeyHotstringOptions
|
||||||
|
\ contained
|
||||||
|
\ display
|
||||||
|
\ '\%([*?]\|[BORZ]0\?\|C[01]\?\|K\d\+\|P\d\+\|S[IPE]\)*'
|
||||||
|
|
||||||
|
syn cluster autohotkeyCommentGroup
|
||||||
|
\ contains=
|
||||||
|
\ autohotkeyTodo,
|
||||||
|
\ @Spell
|
||||||
|
|
||||||
|
syn match autohotkeyComment
|
||||||
|
\ display
|
||||||
|
\ contains=@autohotkeyCommentGroup
|
||||||
|
\ '\%(^;\|\s\+;\).*$'
|
||||||
|
|
||||||
|
syn region autohotkeyComment
|
||||||
|
\ contains=@autohotkeyCommentGroup
|
||||||
|
\ matchgroup=autohotkeyCommentStart
|
||||||
|
\ start='^\s*/\*'
|
||||||
|
\ end='^\s*\*/'
|
||||||
|
|
||||||
" TODO: Shouldn't we look for g:, b:, variables before defaulting to
|
" TODO: Shouldn't we look for g:, b:, variables before defaulting to
|
||||||
" something?
|
" something?
|
||||||
if exists("g:autohotkey_syntax_sync_minlines")
|
if exists("g:autohotkey_syntax_sync_minlines")
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
" Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
|
" Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
|
||||||
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
||||||
" Repository: https://notabug.org/jorgesumle/vim-html-syntax
|
" Repository: https://notabug.org/jorgesumle/vim-html-syntax
|
||||||
" Last Change: 2017 Jan 04
|
" Last Change: 2017 Jan 21
|
||||||
" included patch from Jorge Maldonado Ventura
|
" included patch from Jorge Maldonado Ventura
|
||||||
|
|
||||||
" Please check :help html.vim for some comments and a description of the options
|
" Please check :help html.vim for some comments and a description of the options
|
||||||
@@ -55,9 +55,9 @@ syn keyword htmlTagName contained colgroup del fieldset iframe ins legend
|
|||||||
syn keyword htmlTagName contained object optgroup q s tbody tfoot thead
|
syn keyword htmlTagName contained object optgroup q s tbody tfoot thead
|
||||||
|
|
||||||
" new html 5 tags
|
" new html 5 tags
|
||||||
syn keyword htmlTagName contained article aside audio bdi canvas datalist
|
syn keyword htmlTagName contained article aside audio bdi canvas data
|
||||||
syn keyword htmlTagName contained details embed figcaption figure
|
syn keyword htmlTagName contained datalist details embed figcaption figure
|
||||||
syn keyword htmlTagName contained footer header hgroup main mark
|
syn keyword htmlTagName contained footer header hgroup keygen main mark
|
||||||
syn keyword htmlTagName contained menuitem meter nav output picture
|
syn keyword htmlTagName contained menuitem meter nav output picture
|
||||||
syn keyword htmlTagName contained progress rb rp rt rtc ruby section
|
syn keyword htmlTagName contained progress rb rp rt rtc ruby section
|
||||||
syn keyword htmlTagName contained slot source template time track video wbr
|
syn keyword htmlTagName contained slot source template time track video wbr
|
||||||
@@ -97,8 +97,17 @@ syn keyword htmlArg contained rules scheme scope span standby style
|
|||||||
syn keyword htmlArg contained summary tabindex valuetype version
|
syn keyword htmlArg contained summary tabindex valuetype version
|
||||||
|
|
||||||
" html 5 arg names
|
" html 5 arg names
|
||||||
syn keyword htmlArg contained contenteditable contextmenu draggable dropzone
|
syn keyword htmlArg contained allowfullscreen async autocomplete autofocus
|
||||||
syn keyword htmlArg contained hidden spellcheck title translate
|
syn keyword htmlArg contained autoplay challenge contenteditable contextmenu
|
||||||
|
syn keyword htmlArg contained controls crossorigin default dirname download
|
||||||
|
syn keyword htmlArg contained draggable dropzone form formaction formenctype
|
||||||
|
syn keyword htmlArg contained formmethod formnovalidate formtarget hidden
|
||||||
|
syn keyword htmlArg contained high icon inputmode keytype kind list loop low
|
||||||
|
syn keyword htmlArg contained max min minlength muted nonce novalidate open
|
||||||
|
syn keyword htmlArg contained optimum pattern placeholder poster preload
|
||||||
|
syn keyword htmlArg contained radiogroup required reversed sandbox spellcheck
|
||||||
|
syn keyword htmlArg contained sizes srcset srcdoc srclang step title translate
|
||||||
|
syn keyword htmlArg contained typemustmatch
|
||||||
|
|
||||||
" special characters
|
" special characters
|
||||||
syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
|
syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: Matlab
|
" Language: Matlab
|
||||||
" Maintainer: Maurizio Tranchero - maurizio(.)tranchero(@)gmail(.)com
|
" Maintainer: Alex Burka <vim@alexburka.com>
|
||||||
" Credits: Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
|
" Credits: Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
|
||||||
|
" Maurizio Tranchero - maurizio(.)tranchero(@)gmail(.)com
|
||||||
" Original author: Mario Eusebio
|
" Original author: Mario Eusebio
|
||||||
" Last Change: Wed Jan 13 11:12:34 CET 2010
|
" Last Change: Mon Jan 23 2017
|
||||||
" sinh added to matlab implicit commands
|
" added support for cell mode
|
||||||
" Change History:
|
" Change History:
|
||||||
|
" - now highlights cell-mode separator comments
|
||||||
" - 'global' and 'persistent' keyword are now recognized
|
" - 'global' and 'persistent' keyword are now recognized
|
||||||
|
|
||||||
" quit when a syntax file was already loaded
|
" quit when a syntax file was already loaded
|
||||||
@@ -60,6 +62,7 @@ syn match matlabComment "%.*$" contains=matlabTodo,matlabTab
|
|||||||
" MT_ADDON - correctly highlights words after '...' as comments
|
" MT_ADDON - correctly highlights words after '...' as comments
|
||||||
syn match matlabComment "\.\.\..*$" contains=matlabTodo,matlabTab
|
syn match matlabComment "\.\.\..*$" contains=matlabTodo,matlabTab
|
||||||
syn region matlabMultilineComment start=+%{+ end=+%}+ contains=matlabTodo,matlabTab
|
syn region matlabMultilineComment start=+%{+ end=+%}+ contains=matlabTodo,matlabTab
|
||||||
|
syn match matlabCellComment "^%%.*$"
|
||||||
|
|
||||||
syn keyword matlabOperator break zeros default margin round ones rand
|
syn keyword matlabOperator break zeros default margin round ones rand
|
||||||
syn keyword matlabOperator ceil floor size clear zeros eye mean std cov
|
syn keyword matlabOperator ceil floor size clear zeros eye mean std cov
|
||||||
@@ -96,6 +99,7 @@ hi def link matlabOO Statement
|
|||||||
hi def link matlabSemicolon SpecialChar
|
hi def link matlabSemicolon SpecialChar
|
||||||
hi def link matlabComment Comment
|
hi def link matlabComment Comment
|
||||||
hi def link matlabMultilineComment Comment
|
hi def link matlabMultilineComment Comment
|
||||||
|
hi def link matlabCellComment Todo
|
||||||
hi def link matlabScope Type
|
hi def link matlabScope Type
|
||||||
|
|
||||||
hi def link matlabArithmeticOperator matlabOperator
|
hi def link matlabArithmeticOperator matlabOperator
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: NASM - The Netwide Assembler (v0.98)
|
" Language: NASM - The Netwide Assembler (v0.98)
|
||||||
" Maintainer: Andriy Sokolov <andriy145@gmail.com>
|
" Maintainer: Andrii Sokolov <andriy145@gmail.com>
|
||||||
" Original Author: Manuel M.H. Stol <Manuel.Stol@allieddata.nl>
|
" Original Author: Manuel M.H. Stol <Manuel.Stol@allieddata.nl>
|
||||||
" Former Maintainer: Manuel M.H. Stol <Manuel.Stol@allieddata.nl>
|
" Former Maintainer: Manuel M.H. Stol <Manuel.Stol@allieddata.nl>
|
||||||
" Last Change: 2012 Feb 7
|
" Contributors: Leonard König <leonard.r.koenig@gmail.com> (C string highlighting)
|
||||||
|
" Last Change: 2017 Jan 23
|
||||||
" NASM Home: http://www.nasm.us/
|
" NASM Home: http://www.nasm.us/
|
||||||
|
|
||||||
|
|
||||||
@@ -67,8 +68,23 @@ syn match nasmLabelError "\<\~\s*\(\k*\s*:\|\$\=\.\k*\)"
|
|||||||
|
|
||||||
|
|
||||||
" Constants:
|
" Constants:
|
||||||
syn match nasmStringError +["']+
|
syn match nasmStringError +["'`]+
|
||||||
|
" NASM is case sensitive here: eg. u-prefix allows for 4-digit, U-prefix for
|
||||||
|
" 8-digit Unicode characters
|
||||||
|
syn case match
|
||||||
|
" one-char escape-sequences
|
||||||
|
syn match nasmCStringEscape display contained "\\[’"‘\\\?abtnvfre]"
|
||||||
|
" hex and octal numbers
|
||||||
|
syn match nasmCStringEscape display contained "\\\(x\x\{2}\|\o\{1,3}\)"
|
||||||
|
" Unicode characters
|
||||||
|
syn match nasmCStringEscape display contained "\\\(u\x\{4}\|U\x\{8}\)"
|
||||||
|
" ISO C99 format strings (copied from cFormat in runtime/syntax/c.vim)
|
||||||
|
syn match nasmCStringFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
|
||||||
|
syn match nasmCStringFormat display "%%" contained
|
||||||
syn match nasmString +\("[^"]\{-}"\|'[^']\{-}'\)+
|
syn match nasmString +\("[^"]\{-}"\|'[^']\{-}'\)+
|
||||||
|
" Highlight C escape- and format-sequences within ``-strings
|
||||||
|
syn match nasmCString +\(`[^`]\{-}`\)+ contains=nasmCStringEscape,nasmCStringFormat extend
|
||||||
|
syn case ignore
|
||||||
syn match nasmBinNumber "\<[0-1]\+b\>"
|
syn match nasmBinNumber "\<[0-1]\+b\>"
|
||||||
syn match nasmBinNumber "\<\~[0-1]\+b\>"lc=1
|
syn match nasmBinNumber "\<\~[0-1]\+b\>"lc=1
|
||||||
syn match nasmOctNumber "\<\o\+q\>"
|
syn match nasmOctNumber "\<\o\+q\>"
|
||||||
@@ -443,7 +459,10 @@ hi def link nasmInCommentTodo Todo
|
|||||||
|
|
||||||
" Constant Group:
|
" Constant Group:
|
||||||
hi def link nasmString String
|
hi def link nasmString String
|
||||||
|
hi def link nasmCString String
|
||||||
hi def link nasmStringError Error
|
hi def link nasmStringError Error
|
||||||
|
hi def link nasmCStringEscape SpecialChar
|
||||||
|
hi def link nasmCStringFormat SpecialChar
|
||||||
hi def link nasmBinNumber Number
|
hi def link nasmBinNumber Number
|
||||||
hi def link nasmOctNumber Number
|
hi def link nasmOctNumber Number
|
||||||
hi def link nasmDecNumber Number
|
hi def link nasmDecNumber Number
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
" Language: shell (sh) Korn shell (ksh) bash (sh)
|
" Language: shell (sh) Korn shell (ksh) bash (sh)
|
||||||
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||||
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
|
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
|
||||||
" Last Change: Sep 22, 2016
|
" Last Change: Jan 03, 2017
|
||||||
" Version: 165
|
" Version: 167
|
||||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
|
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
|
||||||
" For options and settings, please use: :help ft-sh-syntax
|
" For options and settings, please use: :help ft-sh-syntax
|
||||||
" This file includes many ideas from Eric Brunet (eric.brunet@ens.fr)
|
" This file includes many ideas from Eric Brunet (eric.brunet@ens.fr)
|
||||||
@@ -386,7 +386,7 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \
|
|||||||
" Here Strings: {{{1
|
" Here Strings: {{{1
|
||||||
" =============
|
" =============
|
||||||
" available for: bash; ksh (really should be ksh93 only) but not if its a posix
|
" available for: bash; ksh (really should be ksh93 only) but not if its a posix
|
||||||
if exists("b:is_bash") || (exists("b:is_kornshell") && !exists("g:is_posix"))
|
if exists("b:is_bash") || (exists("b:is_kornshell") && !exists("b:is_posix"))
|
||||||
syn match shHereString "<<<" skipwhite nextgroup=shCmdParenRegion
|
syn match shHereString "<<<" skipwhite nextgroup=shCmdParenRegion
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -407,7 +407,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Functions: {{{1
|
" Functions: {{{1
|
||||||
if !exists("g:is_posix")
|
if !exists("b:is_posix")
|
||||||
syn keyword shFunctionKey function skipwhite skipnl nextgroup=shFunctionTwo
|
syn keyword shFunctionKey function skipwhite skipnl nextgroup=shFunctionTwo
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -533,7 +533,7 @@ endif
|
|||||||
" ====================
|
" ====================
|
||||||
if exists("b:is_kornshell") || exists("b:is_bash")
|
if exists("b:is_kornshell") || exists("b:is_bash")
|
||||||
syn keyword shStatement autoload bg false fc fg functions getopts hash history integer jobs let nohup printf r stop suspend times true type unalias whence
|
syn keyword shStatement autoload bg false fc fg functions getopts hash history integer jobs let nohup printf r stop suspend times true type unalias whence
|
||||||
if exists("g:is_posix")
|
if exists("b:is_posix")
|
||||||
syn keyword shStatement command
|
syn keyword shStatement command
|
||||||
else
|
else
|
||||||
syn keyword shStatement time
|
syn keyword shStatement time
|
||||||
@@ -542,7 +542,7 @@ if exists("b:is_kornshell") || exists("b:is_bash")
|
|||||||
" Useful bash Keywords: {{{1
|
" Useful bash Keywords: {{{1
|
||||||
" =====================
|
" =====================
|
||||||
if exists("b:is_bash")
|
if exists("b:is_bash")
|
||||||
syn keyword shStatement bind builtin dirs disown enable help local logout popd pushd shopt source
|
syn keyword shStatement bind builtin dirs disown enable help logout popd pushd shopt source
|
||||||
else
|
else
|
||||||
syn keyword shStatement login newgrp
|
syn keyword shStatement login newgrp
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: TeX
|
" Language: TeX
|
||||||
" Maintainer: Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM>
|
" Maintainer: Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM>
|
||||||
" Last Change: Sep 20, 2016
|
" Last Change: Dec 07, 2016
|
||||||
" Version: 101
|
" Version: 102
|
||||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
|
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
|
||||||
"
|
"
|
||||||
" Notes: {{{1
|
" Notes: {{{1
|
||||||
@@ -494,13 +494,11 @@ if !exists("g:tex_no_math")
|
|||||||
\ ['\\backslash' , '\'] ,
|
\ ['\\backslash' , '\'] ,
|
||||||
\ ['\\downarrow' , '↓'] ,
|
\ ['\\downarrow' , '↓'] ,
|
||||||
\ ['\\Downarrow' , '⇓'] ,
|
\ ['\\Downarrow' , '⇓'] ,
|
||||||
\ ['\\langle' , '<'] ,
|
|
||||||
\ ['\\lbrace' , '['] ,
|
\ ['\\lbrace' , '['] ,
|
||||||
\ ['\\lceil' , '⌈'] ,
|
\ ['\\lceil' , '⌈'] ,
|
||||||
\ ['\\lfloor' , '⌊'] ,
|
\ ['\\lfloor' , '⌊'] ,
|
||||||
\ ['\\lgroup' , '⌊'] ,
|
\ ['\\lgroup' , '⌊'] ,
|
||||||
\ ['\\lmoustache' , '⎛'] ,
|
\ ['\\lmoustache' , '⎛'] ,
|
||||||
\ ['\\rangle' , '>'] ,
|
|
||||||
\ ['\\rbrace' , ']'] ,
|
\ ['\\rbrace' , ']'] ,
|
||||||
\ ['\\rceil' , '⌉'] ,
|
\ ['\\rceil' , '⌉'] ,
|
||||||
\ ['\\rfloor' , '⌋'] ,
|
\ ['\\rfloor' , '⌋'] ,
|
||||||
@@ -510,6 +508,15 @@ if !exists("g:tex_no_math")
|
|||||||
\ ['\\Uparrow' , '↑'] ,
|
\ ['\\Uparrow' , '↑'] ,
|
||||||
\ ['\\updownarrow', '↕'] ,
|
\ ['\\updownarrow', '↕'] ,
|
||||||
\ ['\\Updownarrow', '⇕']]
|
\ ['\\Updownarrow', '⇕']]
|
||||||
|
if &ambw == "double" || exists("g:tex_usedblwidth")
|
||||||
|
let s:texMathDelimList= s:texMathDelimList + [
|
||||||
|
\ ['\\langle' , '〈'] ,
|
||||||
|
\ ['\\rangle' , '〉'] ,
|
||||||
|
else
|
||||||
|
let s:texMathDelimList= s:texMathDelimList + [
|
||||||
|
\ ['\\langle' , '<'] ,
|
||||||
|
\ ['\\rangle' , '>']]
|
||||||
|
endif
|
||||||
syn match texMathDelim '\\[bB]igg\=[lr]' contained nextgroup=texMathDelimBad
|
syn match texMathDelim '\\[bB]igg\=[lr]' contained nextgroup=texMathDelimBad
|
||||||
for texmath in s:texMathDelimList
|
for texmath in s:texMathDelimList
|
||||||
exe "syn match texMathDelim '\\\\[bB]igg\\=[lr]\\=".texmath[0]."' contained conceal cchar=".texmath[1]
|
exe "syn match texMathDelim '\\\\[bB]igg\\=[lr]\\=".texmath[0]."' contained conceal cchar=".texmath[1]
|
||||||
@@ -680,6 +687,7 @@ if has("conceal") && &enc == 'utf-8'
|
|||||||
\ ['backslash' , '∖'],
|
\ ['backslash' , '∖'],
|
||||||
\ ['barwedge' , '⊼'],
|
\ ['barwedge' , '⊼'],
|
||||||
\ ['because' , '∵'],
|
\ ['because' , '∵'],
|
||||||
|
\ ['beth' , 'ܒ'],
|
||||||
\ ['between' , '≬'],
|
\ ['between' , '≬'],
|
||||||
\ ['bigcap' , '∩'],
|
\ ['bigcap' , '∩'],
|
||||||
\ ['bigcirc' , '○'],
|
\ ['bigcirc' , '○'],
|
||||||
@@ -699,6 +707,7 @@ if has("conceal") && &enc == 'utf-8'
|
|||||||
\ ['boxminus' , '⊟'],
|
\ ['boxminus' , '⊟'],
|
||||||
\ ['boxplus' , '⊞'],
|
\ ['boxplus' , '⊞'],
|
||||||
\ ['boxtimes' , '⊠'],
|
\ ['boxtimes' , '⊠'],
|
||||||
|
\ ['Box' , '☐'],
|
||||||
\ ['bullet' , '•'],
|
\ ['bullet' , '•'],
|
||||||
\ ['bumpeq' , '≏'],
|
\ ['bumpeq' , '≏'],
|
||||||
\ ['Bumpeq' , '≎'],
|
\ ['Bumpeq' , '≎'],
|
||||||
@@ -748,6 +757,7 @@ if has("conceal") && &enc == 'utf-8'
|
|||||||
\ ['eqslantgtr' , '⪖'],
|
\ ['eqslantgtr' , '⪖'],
|
||||||
\ ['eqslantless' , '⪕'],
|
\ ['eqslantless' , '⪕'],
|
||||||
\ ['equiv' , '≡'],
|
\ ['equiv' , '≡'],
|
||||||
|
\ ['eth' , 'ð'],
|
||||||
\ ['exists' , '∃'],
|
\ ['exists' , '∃'],
|
||||||
\ ['fallingdotseq' , '≒'],
|
\ ['fallingdotseq' , '≒'],
|
||||||
\ ['flat' , '♭'],
|
\ ['flat' , '♭'],
|
||||||
@@ -757,6 +767,7 @@ if has("conceal") && &enc == 'utf-8'
|
|||||||
\ ['geq' , '≥'],
|
\ ['geq' , '≥'],
|
||||||
\ ['geqq' , '≧'],
|
\ ['geqq' , '≧'],
|
||||||
\ ['gets' , '←'],
|
\ ['gets' , '←'],
|
||||||
|
\ ['gimel' , 'ℷ'],
|
||||||
\ ['gg' , '⟫'],
|
\ ['gg' , '⟫'],
|
||||||
\ ['gneqq' , '≩'],
|
\ ['gneqq' , '≩'],
|
||||||
\ ['gtrdot' , '⋗'],
|
\ ['gtrdot' , '⋗'],
|
||||||
@@ -767,13 +778,17 @@ if has("conceal") && &enc == 'utf-8'
|
|||||||
\ ['heartsuit' , '♡'],
|
\ ['heartsuit' , '♡'],
|
||||||
\ ['hookleftarrow' , '↩'],
|
\ ['hookleftarrow' , '↩'],
|
||||||
\ ['hookrightarrow' , '↪'],
|
\ ['hookrightarrow' , '↪'],
|
||||||
|
\ ['iff' , '⇔'],
|
||||||
\ ['iiint' , '∭'],
|
\ ['iiint' , '∭'],
|
||||||
\ ['iint' , '∬'],
|
\ ['iint' , '∬'],
|
||||||
\ ['Im' , 'ℑ'],
|
\ ['Im' , 'ℑ'],
|
||||||
\ ['imath' , 'ɩ'],
|
\ ['imath' , 'ɩ'],
|
||||||
|
\ ['implies' , '⇒'],
|
||||||
\ ['in' , '∈'],
|
\ ['in' , '∈'],
|
||||||
\ ['infty' , '∞'],
|
\ ['infty' , '∞'],
|
||||||
\ ['int' , '∫'],
|
\ ['int' , '∫'],
|
||||||
|
\ ['jmath' , '𝚥'],
|
||||||
|
\ ['land' , '∧'],
|
||||||
\ ['lceil' , '⌈'],
|
\ ['lceil' , '⌈'],
|
||||||
\ ['ldots' , '…'],
|
\ ['ldots' , '…'],
|
||||||
\ ['le' , '≤'],
|
\ ['le' , '≤'],
|
||||||
@@ -800,6 +815,7 @@ if has("conceal") && &enc == 'utf-8'
|
|||||||
\ ['ll' , '≪'],
|
\ ['ll' , '≪'],
|
||||||
\ ['lmoustache' , '╭'],
|
\ ['lmoustache' , '╭'],
|
||||||
\ ['lneqq' , '≨'],
|
\ ['lneqq' , '≨'],
|
||||||
|
\ ['lor' , '∨'],
|
||||||
\ ['ltimes' , '⋉'],
|
\ ['ltimes' , '⋉'],
|
||||||
\ ['mapsto' , '↦'],
|
\ ['mapsto' , '↦'],
|
||||||
\ ['measuredangle' , '∡'],
|
\ ['measuredangle' , '∡'],
|
||||||
@@ -826,6 +842,7 @@ if has("conceal") && &enc == 'utf-8'
|
|||||||
\ ['nless' , '≮'],
|
\ ['nless' , '≮'],
|
||||||
\ ['nmid' , '∤'],
|
\ ['nmid' , '∤'],
|
||||||
\ ['notin' , '∉'],
|
\ ['notin' , '∉'],
|
||||||
|
\ ['nparallel' , '∦'],
|
||||||
\ ['nprec' , '⊀'],
|
\ ['nprec' , '⊀'],
|
||||||
\ ['nrightarrow' , '↛'],
|
\ ['nrightarrow' , '↛'],
|
||||||
\ ['nRightarrow' , '⇏'],
|
\ ['nRightarrow' , '⇏'],
|
||||||
@@ -927,10 +944,12 @@ if has("conceal") && &enc == 'utf-8'
|
|||||||
\ ['trianglerighteq', '⊵'],
|
\ ['trianglerighteq', '⊵'],
|
||||||
\ ['twoheadleftarrow', '↞'],
|
\ ['twoheadleftarrow', '↞'],
|
||||||
\ ['twoheadrightarrow', '↠'],
|
\ ['twoheadrightarrow', '↠'],
|
||||||
|
\ ['ulcorner' , '⌜'],
|
||||||
\ ['uparrow' , '↑'],
|
\ ['uparrow' , '↑'],
|
||||||
\ ['Uparrow' , '⇑'],
|
\ ['Uparrow' , '⇑'],
|
||||||
\ ['updownarrow' , '↕'],
|
\ ['updownarrow' , '↕'],
|
||||||
\ ['Updownarrow' , '⇕'],
|
\ ['Updownarrow' , '⇕'],
|
||||||
|
\ ['urcorner' , '⌝'],
|
||||||
\ ['varnothing' , '∅'],
|
\ ['varnothing' , '∅'],
|
||||||
\ ['vartriangle' , '∆'],
|
\ ['vartriangle' , '∆'],
|
||||||
\ ['vdash' , '⊢'],
|
\ ['vdash' , '⊢'],
|
||||||
@@ -946,6 +965,15 @@ if has("conceal") && &enc == 'utf-8'
|
|||||||
" \ ['jmath' , 'X']
|
" \ ['jmath' , 'X']
|
||||||
" \ ['uminus' , 'X']
|
" \ ['uminus' , 'X']
|
||||||
" \ ['uplus' , 'X']
|
" \ ['uplus' , 'X']
|
||||||
|
if &ambw == "double" || exists("g:tex_usedblwidth")
|
||||||
|
let s:texMathList= s:texMathList + [
|
||||||
|
\ ['right\\rangle' , '〉'],
|
||||||
|
\ ['left\\langle' , '〈']]
|
||||||
|
else
|
||||||
|
let s:texMathList= s:texMathList + [
|
||||||
|
\ ['right\\rangle' , '>'],
|
||||||
|
\ ['left\\langle' , '<']]
|
||||||
|
endif
|
||||||
for texmath in s:texMathList
|
for texmath in s:texMathList
|
||||||
if texmath[0] =~# '\w$'
|
if texmath[0] =~# '\w$'
|
||||||
exe "syn match texMathSymbol '\\\\".texmath[0]."\\>' contained conceal cchar=".texmath[1]
|
exe "syn match texMathSymbol '\\\\".texmath[0]."\\>' contained conceal cchar=".texmath[1]
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: Vim 8.0 script
|
" Language: Vim 8.0 script
|
||||||
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||||
" Last Change: September 29, 2016
|
" Last Change: Jan 19, 2017
|
||||||
" Version: 8.0-01
|
" Version: 8.0-02
|
||||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
|
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
|
||||||
" Automatically generated keyword lists: {{{1
|
" Automatically generated keyword lists: {{{1
|
||||||
|
|
||||||
@@ -164,6 +164,7 @@ endif
|
|||||||
syn match vimNumber "\<\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand
|
syn match vimNumber "\<\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand
|
||||||
syn match vimNumber "-\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand
|
syn match vimNumber "-\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand
|
||||||
syn match vimNumber "\<0[xX]\x\+"
|
syn match vimNumber "\<0[xX]\x\+"
|
||||||
|
syn match vimNumber "\<0[bB][01]\+"
|
||||||
syn match vimNumber "\%(^\|[^a-zA-Z]\)\zs#\x\{6}"
|
syn match vimNumber "\%(^\|[^a-zA-Z]\)\zs#\x\{6}"
|
||||||
|
|
||||||
" All vimCommands are contained by vimIsCommands. {{{2
|
" All vimCommands are contained by vimIsCommands. {{{2
|
||||||
@@ -225,7 +226,7 @@ endif
|
|||||||
" Functions : Tag is provided for those who wish to highlight tagged functions {{{2
|
" Functions : Tag is provided for those who wish to highlight tagged functions {{{2
|
||||||
" =========
|
" =========
|
||||||
syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID
|
syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID
|
||||||
syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand
|
syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand
|
||||||
syn match vimFunction "\<fu\%[nction]!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody
|
syn match vimFunction "\<fu\%[nction]!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody
|
||||||
|
|
||||||
if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
|
if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
|
||||||
|
|||||||
47
src/Makefile
47
src/Makefile
@@ -1584,14 +1584,16 @@ EXTRA_SRC = hangulin.c if_lua.c if_mzsch.c auto/if_perl.c if_perlsfio.c \
|
|||||||
# Unittest files
|
# Unittest files
|
||||||
JSON_TEST_SRC = json_test.c
|
JSON_TEST_SRC = json_test.c
|
||||||
JSON_TEST_TARGET = json_test$(EXEEXT)
|
JSON_TEST_TARGET = json_test$(EXEEXT)
|
||||||
|
KWORD_TEST_SRC = kword_test.c
|
||||||
|
KWORD_TEST_TARGET = kword_test$(EXEEXT)
|
||||||
MEMFILE_TEST_SRC = memfile_test.c
|
MEMFILE_TEST_SRC = memfile_test.c
|
||||||
MEMFILE_TEST_TARGET = memfile_test$(EXEEXT)
|
MEMFILE_TEST_TARGET = memfile_test$(EXEEXT)
|
||||||
MESSAGE_TEST_SRC = message_test.c
|
MESSAGE_TEST_SRC = message_test.c
|
||||||
MESSAGE_TEST_TARGET = message_test$(EXEEXT)
|
MESSAGE_TEST_TARGET = message_test$(EXEEXT)
|
||||||
|
|
||||||
UNITTEST_SRC = $(JSON_TEST_SRC) $(MEMFILE_TEST_SRC) $(MESSAGE_TEST_SRC)
|
UNITTEST_SRC = $(JSON_TEST_SRC) $(KWORD_TEST_SRC) $(MEMFILE_TEST_SRC) $(MESSAGE_TEST_SRC)
|
||||||
UNITTEST_TARGETS = $(JSON_TEST_TARGET) $(MEMFILE_TEST_TARGET) $(MESSAGE_TEST_TARGET)
|
UNITTEST_TARGETS = $(JSON_TEST_TARGET) $(KWORD_TEST_TARGET) $(MEMFILE_TEST_TARGET) $(MESSAGE_TEST_TARGET)
|
||||||
RUN_UNITTESTS = run_json_test run_memfile_test run_message_test
|
RUN_UNITTESTS = run_json_test run_kword_test run_memfile_test run_message_test
|
||||||
|
|
||||||
# All sources, also the ones that are not configured
|
# All sources, also the ones that are not configured
|
||||||
ALL_SRC = $(BASIC_SRC) $(ALL_GUI_SRC) $(UNITTEST_SRC) $(EXTRA_SRC)
|
ALL_SRC = $(BASIC_SRC) $(ALL_GUI_SRC) $(UNITTEST_SRC) $(EXTRA_SRC)
|
||||||
@@ -1611,7 +1613,6 @@ OBJ_COMMON = \
|
|||||||
objects/arabic.o \
|
objects/arabic.o \
|
||||||
objects/buffer.o \
|
objects/buffer.o \
|
||||||
objects/blowfish.o \
|
objects/blowfish.o \
|
||||||
objects/charset.o \
|
|
||||||
objects/crypt.o \
|
objects/crypt.o \
|
||||||
objects/crypt_zip.o \
|
objects/crypt_zip.o \
|
||||||
objects/dict.o \
|
objects/dict.o \
|
||||||
@@ -1679,6 +1680,7 @@ OBJ_COMMON = \
|
|||||||
|
|
||||||
# The files included by tests are not in OBJ_COMMON.
|
# The files included by tests are not in OBJ_COMMON.
|
||||||
OBJ_MAIN = \
|
OBJ_MAIN = \
|
||||||
|
objects/charset.o \
|
||||||
objects/json.o \
|
objects/json.o \
|
||||||
objects/main.o \
|
objects/main.o \
|
||||||
objects/memfile.o \
|
objects/memfile.o \
|
||||||
@@ -1687,13 +1689,23 @@ OBJ_MAIN = \
|
|||||||
OBJ = $(OBJ_COMMON) $(OBJ_MAIN)
|
OBJ = $(OBJ_COMMON) $(OBJ_MAIN)
|
||||||
|
|
||||||
OBJ_JSON_TEST = \
|
OBJ_JSON_TEST = \
|
||||||
|
objects/charset.o \
|
||||||
objects/memfile.o \
|
objects/memfile.o \
|
||||||
objects/message.o \
|
objects/message.o \
|
||||||
objects/json_test.o
|
objects/json_test.o
|
||||||
|
|
||||||
JSON_TEST_OBJ = $(OBJ_COMMON) $(OBJ_JSON_TEST)
|
JSON_TEST_OBJ = $(OBJ_COMMON) $(OBJ_JSON_TEST)
|
||||||
|
|
||||||
|
OBJ_KWORD_TEST = \
|
||||||
|
objects/json.o \
|
||||||
|
objects/memfile.o \
|
||||||
|
objects/message.o \
|
||||||
|
objects/kword_test.o
|
||||||
|
|
||||||
|
KWORD_TEST_OBJ = $(OBJ_COMMON) $(OBJ_KWORD_TEST)
|
||||||
|
|
||||||
OBJ_MEMFILE_TEST = \
|
OBJ_MEMFILE_TEST = \
|
||||||
|
objects/charset.o \
|
||||||
objects/json.o \
|
objects/json.o \
|
||||||
objects/message.o \
|
objects/message.o \
|
||||||
objects/memfile_test.o
|
objects/memfile_test.o
|
||||||
@@ -1701,6 +1713,7 @@ OBJ_MEMFILE_TEST = \
|
|||||||
MEMFILE_TEST_OBJ = $(OBJ_COMMON) $(OBJ_MEMFILE_TEST)
|
MEMFILE_TEST_OBJ = $(OBJ_COMMON) $(OBJ_MEMFILE_TEST)
|
||||||
|
|
||||||
OBJ_MESSAGE_TEST = \
|
OBJ_MESSAGE_TEST = \
|
||||||
|
objects/charset.o \
|
||||||
objects/json.o \
|
objects/json.o \
|
||||||
objects/memfile.o \
|
objects/memfile.o \
|
||||||
objects/message_test.o
|
objects/message_test.o
|
||||||
@@ -1710,6 +1723,7 @@ MESSAGE_TEST_OBJ = $(OBJ_COMMON) $(OBJ_MESSAGE_TEST)
|
|||||||
ALL_OBJ = $(OBJ_COMMON) \
|
ALL_OBJ = $(OBJ_COMMON) \
|
||||||
$(OBJ_MAIN) \
|
$(OBJ_MAIN) \
|
||||||
$(OBJ_JSON_TEST) \
|
$(OBJ_JSON_TEST) \
|
||||||
|
$(OBJ_KWORD_TEST) \
|
||||||
$(OBJ_MEMFILE_TEST) \
|
$(OBJ_MEMFILE_TEST) \
|
||||||
$(OBJ_MESSAGE_TEST)
|
$(OBJ_MESSAGE_TEST)
|
||||||
|
|
||||||
@@ -2036,6 +2050,9 @@ unittest unittests: $(RUN_UNITTESTS)
|
|||||||
run_json_test: $(JSON_TEST_TARGET)
|
run_json_test: $(JSON_TEST_TARGET)
|
||||||
$(VALGRIND) ./$(JSON_TEST_TARGET) || exit 1; echo $* passed;
|
$(VALGRIND) ./$(JSON_TEST_TARGET) || exit 1; echo $* passed;
|
||||||
|
|
||||||
|
run_kword_test: $(KWORD_TEST_TARGET)
|
||||||
|
$(VALGRIND) ./$(KWORD_TEST_TARGET) || exit 1; echo $* passed;
|
||||||
|
|
||||||
run_memfile_test: $(MEMFILE_TEST_TARGET)
|
run_memfile_test: $(MEMFILE_TEST_TARGET)
|
||||||
$(VALGRIND) ./$(MEMFILE_TEST_TARGET) || exit 1; echo $* passed;
|
$(VALGRIND) ./$(MEMFILE_TEST_TARGET) || exit 1; echo $* passed;
|
||||||
|
|
||||||
@@ -2058,7 +2075,6 @@ test1 \
|
|||||||
test_listlbr \
|
test_listlbr \
|
||||||
test_listlbr_utf8 \
|
test_listlbr_utf8 \
|
||||||
test_search_mbyte \
|
test_search_mbyte \
|
||||||
test_utf8 \
|
|
||||||
test_wordcount \
|
test_wordcount \
|
||||||
test3 test4 test5 test6 test7 test8 test9 \
|
test3 test4 test5 test6 test7 test8 test9 \
|
||||||
test11 test12 test14 test15 test17 test18 test19 \
|
test11 test12 test14 test15 test17 test18 test19 \
|
||||||
@@ -2147,10 +2163,13 @@ test_arglist \
|
|||||||
test_options \
|
test_options \
|
||||||
test_packadd \
|
test_packadd \
|
||||||
test_partial \
|
test_partial \
|
||||||
|
test_paste \
|
||||||
test_perl \
|
test_perl \
|
||||||
test_popup \
|
test_popup \
|
||||||
test_profile \
|
test_profile \
|
||||||
test_put \
|
test_put \
|
||||||
|
test_pyx2 \
|
||||||
|
test_pyx3 \
|
||||||
test_quickfix \
|
test_quickfix \
|
||||||
test_regexp_latin \
|
test_regexp_latin \
|
||||||
test_regexp_utf8 \
|
test_regexp_utf8 \
|
||||||
@@ -2161,9 +2180,9 @@ test_arglist \
|
|||||||
test_searchpos \
|
test_searchpos \
|
||||||
test_set \
|
test_set \
|
||||||
test_signs \
|
test_signs \
|
||||||
|
test_smartindent \
|
||||||
test_sort \
|
test_sort \
|
||||||
test_source_utf8 \
|
test_source_utf8 \
|
||||||
test_smartindent \
|
|
||||||
test_startup \
|
test_startup \
|
||||||
test_startup_utf8 \
|
test_startup_utf8 \
|
||||||
test_stat \
|
test_stat \
|
||||||
@@ -2182,6 +2201,7 @@ test_arglist \
|
|||||||
test_undo \
|
test_undo \
|
||||||
test_unlet \
|
test_unlet \
|
||||||
test_usercommands \
|
test_usercommands \
|
||||||
|
test_utf8 \
|
||||||
test_viminfo \
|
test_viminfo \
|
||||||
test_viml \
|
test_viml \
|
||||||
test_visual \
|
test_visual \
|
||||||
@@ -2219,6 +2239,13 @@ $(JSON_TEST_TARGET): auto/config.mk objects $(JSON_TEST_OBJ)
|
|||||||
MAKE="$(MAKE)" LINK_AS_NEEDED=$(LINK_AS_NEEDED) \
|
MAKE="$(MAKE)" LINK_AS_NEEDED=$(LINK_AS_NEEDED) \
|
||||||
sh $(srcdir)/link.sh
|
sh $(srcdir)/link.sh
|
||||||
|
|
||||||
|
$(KWORD_TEST_TARGET): auto/config.mk objects $(KWORD_TEST_OBJ)
|
||||||
|
$(CCC) version.c -o objects/version.o
|
||||||
|
@LINK="$(PURIFY) $(SHRPENV) $(CClink) $(ALL_LIB_DIRS) $(LDFLAGS) \
|
||||||
|
-o $(KWORD_TEST_TARGET) $(KWORD_TEST_OBJ) $(ALL_LIBS)" \
|
||||||
|
MAKE="$(MAKE)" LINK_AS_NEEDED=$(LINK_AS_NEEDED) \
|
||||||
|
sh $(srcdir)/link.sh
|
||||||
|
|
||||||
$(MEMFILE_TEST_TARGET): auto/config.mk objects $(MEMFILE_TEST_OBJ)
|
$(MEMFILE_TEST_TARGET): auto/config.mk objects $(MEMFILE_TEST_OBJ)
|
||||||
$(CCC) version.c -o objects/version.o
|
$(CCC) version.c -o objects/version.o
|
||||||
@LINK="$(PURIFY) $(SHRPENV) $(CClink) $(ALL_LIB_DIRS) $(LDFLAGS) \
|
@LINK="$(PURIFY) $(SHRPENV) $(CClink) $(ALL_LIB_DIRS) $(LDFLAGS) \
|
||||||
@@ -2753,6 +2780,7 @@ shadow: runtime pixmaps
|
|||||||
../../testdir/*.vim \
|
../../testdir/*.vim \
|
||||||
../../testdir/*.py \
|
../../testdir/*.py \
|
||||||
../../testdir/python* \
|
../../testdir/python* \
|
||||||
|
../../testdir/pyxfile \
|
||||||
../../testdir/sautest \
|
../../testdir/sautest \
|
||||||
../../testdir/samples \
|
../../testdir/samples \
|
||||||
../../testdir/test83-tags? \
|
../../testdir/test83-tags? \
|
||||||
@@ -3054,6 +3082,9 @@ objects/json.o: json.c
|
|||||||
objects/json_test.o: json_test.c
|
objects/json_test.o: json_test.c
|
||||||
$(CCC) -o $@ json_test.c
|
$(CCC) -o $@ json_test.c
|
||||||
|
|
||||||
|
objects/kword_test.o: kword_test.c
|
||||||
|
$(CCC) -o $@ kword_test.c
|
||||||
|
|
||||||
objects/list.o: list.c
|
objects/list.o: list.c
|
||||||
$(CCC) -o $@ list.c
|
$(CCC) -o $@ list.c
|
||||||
|
|
||||||
@@ -3593,6 +3624,10 @@ objects/json_test.o: json_test.c main.c vim.h auto/config.h feature.h os_unix.h
|
|||||||
auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
|
auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
|
||||||
regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h spell.h \
|
regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h spell.h \
|
||||||
proto.h globals.h farsi.h arabic.h json.c
|
proto.h globals.h farsi.h arabic.h json.c
|
||||||
|
objects/kword_test.o: kword_test.c main.c vim.h auto/config.h feature.h os_unix.h \
|
||||||
|
auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
|
||||||
|
regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h spell.h \
|
||||||
|
proto.h globals.h farsi.h arabic.h charset.c mbyte.c
|
||||||
objects/memfile_test.o: memfile_test.c main.c vim.h auto/config.h feature.h \
|
objects/memfile_test.o: memfile_test.c main.c vim.h auto/config.h feature.h \
|
||||||
os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h \
|
os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h \
|
||||||
structs.h regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h \
|
structs.h regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h \
|
||||||
|
|||||||
@@ -899,16 +899,17 @@ vim_iswordc(int c)
|
|||||||
int
|
int
|
||||||
vim_iswordc_buf(int c, buf_T *buf)
|
vim_iswordc_buf(int c, buf_T *buf)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_MBYTE
|
|
||||||
if (c >= 0x100)
|
if (c >= 0x100)
|
||||||
{
|
{
|
||||||
|
#ifdef FEAT_MBYTE
|
||||||
if (enc_dbcs != 0)
|
if (enc_dbcs != 0)
|
||||||
return dbcs_class((unsigned)c >> 8, (unsigned)(c & 0xff)) >= 2;
|
return dbcs_class((unsigned)c >> 8, (unsigned)(c & 0xff)) >= 2;
|
||||||
if (enc_utf8)
|
if (enc_utf8)
|
||||||
return utf_class(c) >= 2;
|
return utf_class_buf(c, buf) >= 2;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
return (c > 0 && c < 0x100 && GET_CHARTAB(buf, c) != 0);
|
return FALSE;
|
||||||
|
}
|
||||||
|
return (c > 0 && GET_CHARTAB(buf, c) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -917,21 +918,19 @@ vim_iswordc_buf(int c, buf_T *buf)
|
|||||||
int
|
int
|
||||||
vim_iswordp(char_u *p)
|
vim_iswordp(char_u *p)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_MBYTE
|
return vim_iswordp_buf(p, curbuf);
|
||||||
if (has_mbyte && MB_BYTE2LEN(*p) > 1)
|
|
||||||
return mb_get_class(p) >= 2;
|
|
||||||
#endif
|
|
||||||
return GET_CHARTAB(curbuf, *p) != 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
vim_iswordp_buf(char_u *p, buf_T *buf)
|
vim_iswordp_buf(char_u *p, buf_T *buf)
|
||||||
{
|
{
|
||||||
|
int c = *p;
|
||||||
|
|
||||||
#ifdef FEAT_MBYTE
|
#ifdef FEAT_MBYTE
|
||||||
if (has_mbyte && MB_BYTE2LEN(*p) > 1)
|
if (has_mbyte && MB_BYTE2LEN(c) > 1)
|
||||||
return mb_get_class(p) >= 2;
|
c = (*mb_ptr2char)(p);
|
||||||
#endif
|
#endif
|
||||||
return (GET_CHARTAB(buf, *p) != 0);
|
return vim_iswordc_buf(c, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1296,7 +1295,14 @@ getvcol(
|
|||||||
if (pos->col == MAXCOL)
|
if (pos->col == MAXCOL)
|
||||||
posptr = NULL; /* continue until the NUL */
|
posptr = NULL; /* continue until the NUL */
|
||||||
else
|
else
|
||||||
|
{
|
||||||
posptr = ptr + pos->col;
|
posptr = ptr + pos->col;
|
||||||
|
#ifdef FEAT_MBYTE
|
||||||
|
if (has_mbyte)
|
||||||
|
/* always start on the first byte */
|
||||||
|
posptr -= (*mb_head_off)(line, posptr);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function is used very often, do some speed optimizations.
|
* This function is used very often, do some speed optimizations.
|
||||||
|
|||||||
31
src/edit.c
31
src/edit.c
@@ -463,7 +463,10 @@ edit(
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
AppendCharToRedobuff(cmdchar);
|
if (cmdchar == K_PS)
|
||||||
|
AppendCharToRedobuff('a');
|
||||||
|
else
|
||||||
|
AppendCharToRedobuff(cmdchar);
|
||||||
if (cmdchar == 'g') /* "gI" command */
|
if (cmdchar == 'g') /* "gI" command */
|
||||||
AppendCharToRedobuff('I');
|
AppendCharToRedobuff('I');
|
||||||
else if (cmdchar == 'r') /* "r<CR>" command */
|
else if (cmdchar == 'r') /* "r<CR>" command */
|
||||||
@@ -531,6 +534,10 @@ edit(
|
|||||||
revins_legal = 0;
|
revins_legal = 0;
|
||||||
revins_scol = -1;
|
revins_scol = -1;
|
||||||
#endif
|
#endif
|
||||||
|
if (!p_ek)
|
||||||
|
/* Disable bracketed paste mode, we won't recognize the escape
|
||||||
|
* sequences. */
|
||||||
|
out_str(T_BD);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Handle restarting Insert mode.
|
* Handle restarting Insert mode.
|
||||||
@@ -2814,6 +2821,7 @@ set_completion(colnr_T startcol, list_T *list)
|
|||||||
if (ctrl_x_mode != 0)
|
if (ctrl_x_mode != 0)
|
||||||
ins_compl_prep(' ');
|
ins_compl_prep(' ');
|
||||||
ins_compl_clear();
|
ins_compl_clear();
|
||||||
|
ins_compl_free();
|
||||||
|
|
||||||
compl_direction = FORWARD;
|
compl_direction = FORWARD;
|
||||||
if (startcol > curwin->w_cursor.col)
|
if (startcol > curwin->w_cursor.col)
|
||||||
@@ -8620,6 +8628,9 @@ ins_esc(
|
|||||||
#ifdef CURSOR_SHAPE
|
#ifdef CURSOR_SHAPE
|
||||||
ui_cursor_shape(); /* may show different cursor shape */
|
ui_cursor_shape(); /* may show different cursor shape */
|
||||||
#endif
|
#endif
|
||||||
|
if (!p_ek)
|
||||||
|
/* Re-enable bracketed paste mode. */
|
||||||
|
out_str(T_BE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When recording or for CTRL-O, need to display the new mode.
|
* When recording or for CTRL-O, need to display the new mode.
|
||||||
@@ -9453,12 +9464,17 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
|
|||||||
char_u *end = find_termcode((char_u *)"PE");
|
char_u *end = find_termcode((char_u *)"PE");
|
||||||
int ret_char = -1;
|
int ret_char = -1;
|
||||||
int save_allow_keys = allow_keys;
|
int save_allow_keys = allow_keys;
|
||||||
|
int save_paste = p_paste;
|
||||||
|
int save_ai = curbuf->b_p_ai;
|
||||||
|
|
||||||
/* If the end code is too long we can't detect it, read everything. */
|
/* If the end code is too long we can't detect it, read everything. */
|
||||||
if (STRLEN(end) >= NUMBUFLEN)
|
if (STRLEN(end) >= NUMBUFLEN)
|
||||||
end = NULL;
|
end = NULL;
|
||||||
++no_mapping;
|
++no_mapping;
|
||||||
allow_keys = 0;
|
allow_keys = 0;
|
||||||
|
p_paste = TRUE;
|
||||||
|
curbuf->b_p_ai = FALSE;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
/* When the end is not defined read everything. */
|
/* When the end is not defined read everything. */
|
||||||
@@ -9498,8 +9514,14 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
|
|||||||
case PASTE_INSERT:
|
case PASTE_INSERT:
|
||||||
if (stop_arrow() == OK)
|
if (stop_arrow() == OK)
|
||||||
{
|
{
|
||||||
ins_char_bytes(buf, idx);
|
c = buf[0];
|
||||||
AppendToRedobuffLit(buf, idx);
|
if (idx == 1 && (c == CAR || c == K_KENTER || c == NL))
|
||||||
|
ins_eol(c);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ins_char_bytes(buf, idx);
|
||||||
|
AppendToRedobuffLit(buf, idx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -9518,8 +9540,11 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
|
|||||||
}
|
}
|
||||||
idx = 0;
|
idx = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
--no_mapping;
|
--no_mapping;
|
||||||
allow_keys = save_allow_keys;
|
allow_keys = save_allow_keys;
|
||||||
|
p_paste = save_paste;
|
||||||
|
curbuf->b_p_ai = save_ai;
|
||||||
|
|
||||||
return ret_char;
|
return ret_char;
|
||||||
}
|
}
|
||||||
|
|||||||
47
src/eval.c
47
src/eval.c
@@ -9240,35 +9240,34 @@ fill_assert_error(
|
|||||||
|
|
||||||
if (opt_msg_tv->v_type != VAR_UNKNOWN)
|
if (opt_msg_tv->v_type != VAR_UNKNOWN)
|
||||||
{
|
{
|
||||||
ga_concat(gap, tv2string(opt_msg_tv, &tofree, numbuf, 0));
|
ga_concat(gap, echo_string(opt_msg_tv, &tofree, numbuf, 0));
|
||||||
|
vim_free(tofree);
|
||||||
|
ga_concat(gap, (char_u *)": ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (atype == ASSERT_MATCH || atype == ASSERT_NOTMATCH)
|
||||||
|
ga_concat(gap, (char_u *)"Pattern ");
|
||||||
|
else if (atype == ASSERT_NOTEQUAL)
|
||||||
|
ga_concat(gap, (char_u *)"Expected not equal to ");
|
||||||
|
else
|
||||||
|
ga_concat(gap, (char_u *)"Expected ");
|
||||||
|
if (exp_str == NULL)
|
||||||
|
{
|
||||||
|
ga_concat_esc(gap, tv2string(exp_tv, &tofree, numbuf, 0));
|
||||||
vim_free(tofree);
|
vim_free(tofree);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
ga_concat_esc(gap, exp_str);
|
||||||
|
if (atype != ASSERT_NOTEQUAL)
|
||||||
{
|
{
|
||||||
if (atype == ASSERT_MATCH || atype == ASSERT_NOTMATCH)
|
if (atype == ASSERT_MATCH)
|
||||||
ga_concat(gap, (char_u *)"Pattern ");
|
ga_concat(gap, (char_u *)" does not match ");
|
||||||
else if (atype == ASSERT_NOTEQUAL)
|
else if (atype == ASSERT_NOTMATCH)
|
||||||
ga_concat(gap, (char_u *)"Expected not equal to ");
|
ga_concat(gap, (char_u *)" does match ");
|
||||||
else
|
else
|
||||||
ga_concat(gap, (char_u *)"Expected ");
|
ga_concat(gap, (char_u *)" but got ");
|
||||||
if (exp_str == NULL)
|
ga_concat_esc(gap, tv2string(got_tv, &tofree, numbuf, 0));
|
||||||
{
|
vim_free(tofree);
|
||||||
ga_concat_esc(gap, tv2string(exp_tv, &tofree, numbuf, 0));
|
|
||||||
vim_free(tofree);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ga_concat_esc(gap, exp_str);
|
|
||||||
if (atype != ASSERT_NOTEQUAL)
|
|
||||||
{
|
|
||||||
if (atype == ASSERT_MATCH)
|
|
||||||
ga_concat(gap, (char_u *)" does not match ");
|
|
||||||
else if (atype == ASSERT_NOTMATCH)
|
|
||||||
ga_concat(gap, (char_u *)" does match ");
|
|
||||||
else
|
|
||||||
ga_concat(gap, (char_u *)" but got ");
|
|
||||||
ga_concat_esc(gap, tv2string(got_tv, &tofree, numbuf, 0));
|
|
||||||
vim_free(tofree);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
114
src/evalfunc.c
114
src/evalfunc.c
@@ -289,6 +289,9 @@ static void f_py3eval(typval_T *argvars, typval_T *rettv);
|
|||||||
#ifdef FEAT_PYTHON
|
#ifdef FEAT_PYTHON
|
||||||
static void f_pyeval(typval_T *argvars, typval_T *rettv);
|
static void f_pyeval(typval_T *argvars, typval_T *rettv);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
|
||||||
|
static void f_pyxeval(typval_T *argvars, typval_T *rettv);
|
||||||
|
#endif
|
||||||
static void f_range(typval_T *argvars, typval_T *rettv);
|
static void f_range(typval_T *argvars, typval_T *rettv);
|
||||||
static void f_readfile(typval_T *argvars, typval_T *rettv);
|
static void f_readfile(typval_T *argvars, typval_T *rettv);
|
||||||
static void f_reltime(typval_T *argvars, typval_T *rettv);
|
static void f_reltime(typval_T *argvars, typval_T *rettv);
|
||||||
@@ -715,6 +718,9 @@ static struct fst
|
|||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_PYTHON
|
#ifdef FEAT_PYTHON
|
||||||
{"pyeval", 1, 1, f_pyeval},
|
{"pyeval", 1, 1, f_pyeval},
|
||||||
|
#endif
|
||||||
|
#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
|
||||||
|
{"pyxeval", 1, 1, f_pyxeval},
|
||||||
#endif
|
#endif
|
||||||
{"range", 1, 3, f_range},
|
{"range", 1, 3, f_range},
|
||||||
{"readfile", 1, 3, f_readfile},
|
{"readfile", 1, 3, f_readfile},
|
||||||
@@ -5734,15 +5740,13 @@ f_has(typval_T *argvars, typval_T *rettv)
|
|||||||
#ifdef FEAT_PERSISTENT_UNDO
|
#ifdef FEAT_PERSISTENT_UNDO
|
||||||
"persistent_undo",
|
"persistent_undo",
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_PYTHON
|
#if defined(FEAT_PYTHON) && !defined(DYNAMIC_PYTHON)
|
||||||
#ifndef DYNAMIC_PYTHON
|
|
||||||
"python",
|
"python",
|
||||||
|
"pythonx",
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#if defined(FEAT_PYTHON3) && !defined(DYNAMIC_PYTHON3)
|
||||||
#ifdef FEAT_PYTHON3
|
|
||||||
#ifndef DYNAMIC_PYTHON3
|
|
||||||
"python3",
|
"python3",
|
||||||
#endif
|
"pythonx",
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_POSTSCRIPT
|
#ifdef FEAT_POSTSCRIPT
|
||||||
"postscript",
|
"postscript",
|
||||||
@@ -5972,17 +5976,30 @@ f_has(typval_T *argvars, typval_T *rettv)
|
|||||||
else if (STRICMP(name, "ruby") == 0)
|
else if (STRICMP(name, "ruby") == 0)
|
||||||
n = ruby_enabled(FALSE);
|
n = ruby_enabled(FALSE);
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_PYTHON
|
|
||||||
#ifdef DYNAMIC_PYTHON
|
#ifdef DYNAMIC_PYTHON
|
||||||
else if (STRICMP(name, "python") == 0)
|
else if (STRICMP(name, "python") == 0)
|
||||||
n = python_enabled(FALSE);
|
n = python_enabled(FALSE);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#ifdef FEAT_PYTHON3
|
|
||||||
#ifdef DYNAMIC_PYTHON3
|
#ifdef DYNAMIC_PYTHON3
|
||||||
else if (STRICMP(name, "python3") == 0)
|
else if (STRICMP(name, "python3") == 0)
|
||||||
n = python3_enabled(FALSE);
|
n = python3_enabled(FALSE);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(DYNAMIC_PYTHON) || defined(DYNAMIC_PYTHON3)
|
||||||
|
else if (STRICMP(name, "pythonx") == 0)
|
||||||
|
{
|
||||||
|
# if defined(DYNAMIC_PYTHON) && defined(DYNAMIC_PYTHON3)
|
||||||
|
if (p_pyx == 0)
|
||||||
|
n = python3_enabled(FALSE) || python_enabled(FALSE);
|
||||||
|
else if (p_pyx == 3)
|
||||||
|
n = python3_enabled(FALSE);
|
||||||
|
else if (p_pyx == 2)
|
||||||
|
n = python_enabled(FALSE);
|
||||||
|
# elif defined(DYNAMIC_PYTHON)
|
||||||
|
n = python_enabled(FALSE);
|
||||||
|
# elif defined(DYNAMIC_PYTHON3)
|
||||||
|
n = python3_enabled(FALSE);
|
||||||
|
# endif
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef DYNAMIC_PERL
|
#ifdef DYNAMIC_PERL
|
||||||
else if (STRICMP(name, "perl") == 0)
|
else if (STRICMP(name, "perl") == 0)
|
||||||
@@ -8007,6 +8024,9 @@ f_py3eval(typval_T *argvars, typval_T *rettv)
|
|||||||
char_u *str;
|
char_u *str;
|
||||||
char_u buf[NUMBUFLEN];
|
char_u buf[NUMBUFLEN];
|
||||||
|
|
||||||
|
if (p_pyx == 0)
|
||||||
|
p_pyx = 3;
|
||||||
|
|
||||||
str = get_tv_string_buf(&argvars[0], buf);
|
str = get_tv_string_buf(&argvars[0], buf);
|
||||||
do_py3eval(str, rettv);
|
do_py3eval(str, rettv);
|
||||||
}
|
}
|
||||||
@@ -8022,11 +8042,35 @@ f_pyeval(typval_T *argvars, typval_T *rettv)
|
|||||||
char_u *str;
|
char_u *str;
|
||||||
char_u buf[NUMBUFLEN];
|
char_u buf[NUMBUFLEN];
|
||||||
|
|
||||||
|
if (p_pyx == 0)
|
||||||
|
p_pyx = 2;
|
||||||
|
|
||||||
str = get_tv_string_buf(&argvars[0], buf);
|
str = get_tv_string_buf(&argvars[0], buf);
|
||||||
do_pyeval(str, rettv);
|
do_pyeval(str, rettv);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
|
||||||
|
/*
|
||||||
|
* "pyxeval()" function
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
f_pyxeval(typval_T *argvars, typval_T *rettv)
|
||||||
|
{
|
||||||
|
# if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3)
|
||||||
|
init_pyxversion();
|
||||||
|
if (p_pyx == 2)
|
||||||
|
f_pyeval(argvars, rettv);
|
||||||
|
else
|
||||||
|
f_py3eval(argvars, rettv);
|
||||||
|
# elif defined(FEAT_PYTHON)
|
||||||
|
f_pyeval(argvars, rettv);
|
||||||
|
# elif defined(FEAT_PYTHON3)
|
||||||
|
f_py3eval(argvars, rettv);
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "range()" function
|
* "range()" function
|
||||||
*/
|
*/
|
||||||
@@ -10092,20 +10136,15 @@ f_setpos(typval_T *argvars, typval_T *rettv)
|
|||||||
pos.col = 0;
|
pos.col = 0;
|
||||||
if (name[0] == '.' && name[1] == NUL)
|
if (name[0] == '.' && name[1] == NUL)
|
||||||
{
|
{
|
||||||
/* set cursor */
|
/* set cursor; "fnum" is ignored */
|
||||||
if (fnum == curbuf->b_fnum)
|
curwin->w_cursor = pos;
|
||||||
|
if (curswant >= 0)
|
||||||
{
|
{
|
||||||
curwin->w_cursor = pos;
|
curwin->w_curswant = curswant - 1;
|
||||||
if (curswant >= 0)
|
curwin->w_set_curswant = FALSE;
|
||||||
{
|
|
||||||
curwin->w_curswant = curswant - 1;
|
|
||||||
curwin->w_set_curswant = FALSE;
|
|
||||||
}
|
|
||||||
check_cursor();
|
|
||||||
rettv->vval.v_number = 0;
|
|
||||||
}
|
}
|
||||||
else
|
check_cursor();
|
||||||
EMSG(_(e_invarg));
|
rettv->vval.v_number = 0;
|
||||||
}
|
}
|
||||||
else if (name[0] == '\'' && name[1] != NUL && name[2] == NUL)
|
else if (name[0] == '\'' && name[1] != NUL && name[2] == NUL)
|
||||||
{
|
{
|
||||||
@@ -12503,39 +12542,8 @@ f_timer_stopall(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
|||||||
static void
|
static void
|
||||||
f_tolower(typval_T *argvars, typval_T *rettv)
|
f_tolower(typval_T *argvars, typval_T *rettv)
|
||||||
{
|
{
|
||||||
char_u *p;
|
|
||||||
|
|
||||||
p = vim_strsave(get_tv_string(&argvars[0]));
|
|
||||||
rettv->v_type = VAR_STRING;
|
rettv->v_type = VAR_STRING;
|
||||||
rettv->vval.v_string = p;
|
rettv->vval.v_string = strlow_save(get_tv_string(&argvars[0]));
|
||||||
|
|
||||||
if (p != NULL)
|
|
||||||
while (*p != NUL)
|
|
||||||
{
|
|
||||||
#ifdef FEAT_MBYTE
|
|
||||||
int l;
|
|
||||||
|
|
||||||
if (enc_utf8)
|
|
||||||
{
|
|
||||||
int c, lc;
|
|
||||||
|
|
||||||
c = utf_ptr2char(p);
|
|
||||||
lc = utf_tolower(c);
|
|
||||||
l = utf_ptr2len(p);
|
|
||||||
/* TODO: reallocate string when byte count changes. */
|
|
||||||
if (utf_char2len(lc) == l)
|
|
||||||
utf_char2bytes(lc, p);
|
|
||||||
p += l;
|
|
||||||
}
|
|
||||||
else if (has_mbyte && (l = (*mb_ptr2len)(p)) > 1)
|
|
||||||
p += l; /* skip multi-byte character */
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
*p = TOLOWER_LOC(*p); /* note that tolower() can be a macro */
|
|
||||||
++p;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1132,6 +1132,18 @@ EX(CMD_python3, "python3", ex_py3,
|
|||||||
EX(CMD_py3file, "py3file", ex_py3file,
|
EX(CMD_py3file, "py3file", ex_py3file,
|
||||||
RANGE|FILE1|NEEDARG|CMDWIN,
|
RANGE|FILE1|NEEDARG|CMDWIN,
|
||||||
ADDR_LINES),
|
ADDR_LINES),
|
||||||
|
EX(CMD_pyx, "pyx", ex_pyx,
|
||||||
|
RANGE|EXTRA|NEEDARG|CMDWIN,
|
||||||
|
ADDR_LINES),
|
||||||
|
EX(CMD_pyxdo, "pyxdo", ex_pyxdo,
|
||||||
|
RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN,
|
||||||
|
ADDR_LINES),
|
||||||
|
EX(CMD_pythonx, "pythonx", ex_pyx,
|
||||||
|
RANGE|EXTRA|NEEDARG|CMDWIN,
|
||||||
|
ADDR_LINES),
|
||||||
|
EX(CMD_pyxfile, "pyxfile", ex_pyxfile,
|
||||||
|
RANGE|FILE1|NEEDARG|CMDWIN,
|
||||||
|
ADDR_LINES),
|
||||||
EX(CMD_quit, "quit", ex_quit,
|
EX(CMD_quit, "quit", ex_quit,
|
||||||
BANG|RANGE|COUNT|NOTADR|TRLBAR|CMDWIN,
|
BANG|RANGE|COUNT|NOTADR|TRLBAR|CMDWIN,
|
||||||
ADDR_WINDOWS),
|
ADDR_WINDOWS),
|
||||||
|
|||||||
188
src/ex_cmds2.c
188
src/ex_cmds2.c
@@ -3675,6 +3675,194 @@ ex_options(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(FEAT_PYTHON3) || defined(FEAT_PYTHON) || defined(PROTO)
|
||||||
|
|
||||||
|
# if (defined(FEAT_PYTHON) && defined(FEAT_PYTHON3)) || defined(PROTO)
|
||||||
|
/*
|
||||||
|
* Detect Python 3 or 2, and initialize 'pyxversion'.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
init_pyxversion(void)
|
||||||
|
{
|
||||||
|
if (p_pyx == 0)
|
||||||
|
{
|
||||||
|
if (python3_enabled(FALSE))
|
||||||
|
p_pyx = 3;
|
||||||
|
else if (python_enabled(FALSE))
|
||||||
|
p_pyx = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Does a file contain one of the following strings at the beginning of any
|
||||||
|
* line?
|
||||||
|
* "#!(any string)python2" => returns 2
|
||||||
|
* "#!(any string)python3" => returns 3
|
||||||
|
* "# requires python 2.x" => returns 2
|
||||||
|
* "# requires python 3.x" => returns 3
|
||||||
|
* otherwise return 0.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
requires_py_version(char_u *filename)
|
||||||
|
{
|
||||||
|
FILE *file;
|
||||||
|
int requires_py_version = 0;
|
||||||
|
int i, lines;
|
||||||
|
|
||||||
|
lines = (int)p_mls;
|
||||||
|
if (lines < 0)
|
||||||
|
lines = 5;
|
||||||
|
|
||||||
|
file = mch_fopen((char *)filename, "r");
|
||||||
|
if (file != NULL)
|
||||||
|
{
|
||||||
|
for (i = 0; i < lines; i++)
|
||||||
|
{
|
||||||
|
if (vim_fgets(IObuff, IOSIZE, file))
|
||||||
|
break;
|
||||||
|
if (i == 0 && IObuff[0] == '#' && IObuff[1] == '!')
|
||||||
|
{
|
||||||
|
/* Check shebang. */
|
||||||
|
if (strstr((char *)IObuff + 2, "python2") != NULL)
|
||||||
|
{
|
||||||
|
requires_py_version = 2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (strstr((char *)IObuff + 2, "python3") != NULL)
|
||||||
|
{
|
||||||
|
requires_py_version = 3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
IObuff[21] = '\0';
|
||||||
|
if (STRCMP("# requires python 2.x", IObuff) == 0)
|
||||||
|
{
|
||||||
|
requires_py_version = 2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (STRCMP("# requires python 3.x", IObuff) == 0)
|
||||||
|
{
|
||||||
|
requires_py_version = 3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fclose(file);
|
||||||
|
}
|
||||||
|
return requires_py_version;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Source a python file using the requested python version.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
source_pyx_file(exarg_T *eap, char_u *fname)
|
||||||
|
{
|
||||||
|
exarg_T ex;
|
||||||
|
int v = requires_py_version(fname);
|
||||||
|
|
||||||
|
# if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3)
|
||||||
|
init_pyxversion();
|
||||||
|
# endif
|
||||||
|
if (v == 0)
|
||||||
|
{
|
||||||
|
# if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3)
|
||||||
|
/* user didn't choose a preference, 'pyx' is used */
|
||||||
|
v = p_pyx;
|
||||||
|
# elif defined(FEAT_PYTHON)
|
||||||
|
v = 2;
|
||||||
|
# elif defined(FEAT_PYTHON3)
|
||||||
|
v = 3;
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* now source, if required python version is not supported show
|
||||||
|
* unobtrusive message.
|
||||||
|
*/
|
||||||
|
if (eap == NULL)
|
||||||
|
vim_memset(&ex, 0, sizeof(ex));
|
||||||
|
else
|
||||||
|
ex = *eap;
|
||||||
|
ex.arg = fname;
|
||||||
|
ex.cmd = (char_u *)(v == 2 ? "pyfile" : "pyfile3");
|
||||||
|
|
||||||
|
if (v == 2)
|
||||||
|
{
|
||||||
|
# ifdef FEAT_PYTHON
|
||||||
|
ex_pyfile(&ex);
|
||||||
|
# else
|
||||||
|
vim_snprintf((char *)IObuff, IOSIZE,
|
||||||
|
_("W20: Required python version 2.x not supported, ignoring file: %s"),
|
||||||
|
fname);
|
||||||
|
MSG(IObuff);
|
||||||
|
# endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
# ifdef FEAT_PYTHON3
|
||||||
|
ex_py3file(&ex);
|
||||||
|
# else
|
||||||
|
vim_snprintf((char *)IObuff, IOSIZE,
|
||||||
|
_("W21: Required python version 3.x not supported, ignoring file: %s"),
|
||||||
|
fname);
|
||||||
|
MSG(IObuff);
|
||||||
|
# endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ":pyxfile {fname}"
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
ex_pyxfile(exarg_T *eap)
|
||||||
|
{
|
||||||
|
source_pyx_file(eap, eap->arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ":pyx"
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
ex_pyx(exarg_T *eap)
|
||||||
|
{
|
||||||
|
# if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3)
|
||||||
|
init_pyxversion();
|
||||||
|
if (p_pyx == 2)
|
||||||
|
ex_python(eap);
|
||||||
|
else
|
||||||
|
ex_py3(eap);
|
||||||
|
# elif defined(FEAT_PYTHON)
|
||||||
|
ex_python(eap);
|
||||||
|
# elif defined(FEAT_PYTHON3)
|
||||||
|
ex_py3(eap);
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ":pyxdo"
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
ex_pyxdo(exarg_T *eap)
|
||||||
|
{
|
||||||
|
# if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3)
|
||||||
|
init_pyxversion();
|
||||||
|
if (p_pyx == 2)
|
||||||
|
ex_pydo(eap);
|
||||||
|
else
|
||||||
|
ex_py3do(eap);
|
||||||
|
# elif defined(FEAT_PYTHON)
|
||||||
|
ex_pydo(eap);
|
||||||
|
# elif defined(FEAT_PYTHON3)
|
||||||
|
ex_py3do(eap);
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ":source {fname}"
|
* ":source {fname}"
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -288,6 +288,11 @@ static void ex_popup(exarg_T *eap);
|
|||||||
# define ex_py3do ex_ni
|
# define ex_py3do ex_ni
|
||||||
# define ex_py3file ex_ni
|
# define ex_py3file ex_ni
|
||||||
#endif
|
#endif
|
||||||
|
#if !defined(FEAT_PYTHON) && !defined(FEAT_PYTHON3)
|
||||||
|
# define ex_pyx ex_script_ni
|
||||||
|
# define ex_pyxdo ex_ni
|
||||||
|
# define ex_pyxfile ex_ni
|
||||||
|
#endif
|
||||||
#ifndef FEAT_TCL
|
#ifndef FEAT_TCL
|
||||||
# define ex_tcl ex_script_ni
|
# define ex_tcl ex_script_ni
|
||||||
# define ex_tcldo ex_ni
|
# define ex_tcldo ex_ni
|
||||||
@@ -11192,8 +11197,10 @@ makeopens(
|
|||||||
* resized when moving between windows.
|
* resized when moving between windows.
|
||||||
* Do this before restoring the view, so that the topline and the
|
* Do this before restoring the view, so that the topline and the
|
||||||
* cursor can be set. This is done again below.
|
* cursor can be set. This is done again below.
|
||||||
|
* winminheight and winminwidth need to be set to avoid an error if the
|
||||||
|
* user has set winheight or winwidth.
|
||||||
*/
|
*/
|
||||||
if (put_line(fd, "set winheight=1 winwidth=1") == FAIL)
|
if (put_line(fd, "set winminheight=1 winheight=1 winminwidth=1 winwidth=1") == FAIL)
|
||||||
return FAIL;
|
return FAIL;
|
||||||
if (nr > 1 && ses_winsizes(fd, restore_size, tab_firstwin) == FAIL)
|
if (nr > 1 && ses_winsizes(fd, restore_size, tab_firstwin) == FAIL)
|
||||||
return FAIL;
|
return FAIL;
|
||||||
@@ -11263,6 +11270,10 @@ makeopens(
|
|||||||
if (fprintf(fd, "set winheight=%ld winwidth=%ld shortmess=%s",
|
if (fprintf(fd, "set winheight=%ld winwidth=%ld shortmess=%s",
|
||||||
p_wh, p_wiw, p_shm) < 0 || put_eol(fd) == FAIL)
|
p_wh, p_wiw, p_shm) < 0 || put_eol(fd) == FAIL)
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
/* Re-apply 'winminheight' and 'winminwidth'. */
|
||||||
|
if (fprintf(fd, "set winminheight=%ld winminwidth=%ld",
|
||||||
|
p_wmh, p_wmw) < 0 || put_eol(fd) == FAIL)
|
||||||
|
return FAIL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Lastly, execute the x.vim file if it exists.
|
* Lastly, execute the x.vim file if it exists.
|
||||||
|
|||||||
@@ -4366,7 +4366,9 @@ addstar(
|
|||||||
|| context == EXPAND_OWNSYNTAX
|
|| context == EXPAND_OWNSYNTAX
|
||||||
|| context == EXPAND_FILETYPE
|
|| context == EXPAND_FILETYPE
|
||||||
|| context == EXPAND_PACKADD
|
|| context == EXPAND_PACKADD
|
||||||
|| (context == EXPAND_TAGS && fname[0] == '/'))
|
|| ((context == EXPAND_TAGS_LISTFILES
|
||||||
|
|| context == EXPAND_TAGS)
|
||||||
|
&& fname[0] == '/'))
|
||||||
retval = vim_strnsave(fname, len);
|
retval = vim_strnsave(fname, len);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1114,6 +1114,9 @@ ex_python(exarg_T *eap)
|
|||||||
{
|
{
|
||||||
char_u *script;
|
char_u *script;
|
||||||
|
|
||||||
|
if (p_pyx == 0)
|
||||||
|
p_pyx = 2;
|
||||||
|
|
||||||
script = script_get(eap, eap->arg);
|
script = script_get(eap, eap->arg);
|
||||||
if (!eap->skip)
|
if (!eap->skip)
|
||||||
{
|
{
|
||||||
@@ -1137,6 +1140,9 @@ ex_pyfile(exarg_T *eap)
|
|||||||
const char *file = (char *)eap->arg;
|
const char *file = (char *)eap->arg;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
|
if (p_pyx == 0)
|
||||||
|
p_pyx = 2;
|
||||||
|
|
||||||
/* Have to do it like this. PyRun_SimpleFile requires you to pass a
|
/* Have to do it like this. PyRun_SimpleFile requires you to pass a
|
||||||
* stdio file pointer, but Vim and the Python DLL are compiled with
|
* stdio file pointer, but Vim and the Python DLL are compiled with
|
||||||
* different options under Windows, meaning that stdio pointers aren't
|
* different options under Windows, meaning that stdio pointers aren't
|
||||||
@@ -1175,6 +1181,9 @@ ex_pyfile(exarg_T *eap)
|
|||||||
void
|
void
|
||||||
ex_pydo(exarg_T *eap)
|
ex_pydo(exarg_T *eap)
|
||||||
{
|
{
|
||||||
|
if (p_pyx == 0)
|
||||||
|
p_pyx = 2;
|
||||||
|
|
||||||
DoPyCommand((char *)eap->arg,
|
DoPyCommand((char *)eap->arg,
|
||||||
(rangeinitializer) init_range_cmd,
|
(rangeinitializer) init_range_cmd,
|
||||||
(runner)run_do,
|
(runner)run_do,
|
||||||
|
|||||||
@@ -1004,6 +1004,9 @@ ex_py3(exarg_T *eap)
|
|||||||
{
|
{
|
||||||
char_u *script;
|
char_u *script;
|
||||||
|
|
||||||
|
if (p_pyx == 0)
|
||||||
|
p_pyx = 3;
|
||||||
|
|
||||||
script = script_get(eap, eap->arg);
|
script = script_get(eap, eap->arg);
|
||||||
if (!eap->skip)
|
if (!eap->skip)
|
||||||
{
|
{
|
||||||
@@ -1028,6 +1031,9 @@ ex_py3file(exarg_T *eap)
|
|||||||
char *p;
|
char *p;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (p_pyx == 0)
|
||||||
|
p_pyx = 3;
|
||||||
|
|
||||||
/* Have to do it like this. PyRun_SimpleFile requires you to pass a
|
/* Have to do it like this. PyRun_SimpleFile requires you to pass a
|
||||||
* stdio file pointer, but Vim and the Python DLL are compiled with
|
* stdio file pointer, but Vim and the Python DLL are compiled with
|
||||||
* different options under Windows, meaning that stdio pointers aren't
|
* different options under Windows, meaning that stdio pointers aren't
|
||||||
@@ -1080,6 +1086,9 @@ ex_py3file(exarg_T *eap)
|
|||||||
void
|
void
|
||||||
ex_py3do(exarg_T *eap)
|
ex_py3do(exarg_T *eap)
|
||||||
{
|
{
|
||||||
|
if (p_pyx == 0)
|
||||||
|
p_pyx = 3;
|
||||||
|
|
||||||
DoPyCommand((char *)eap->arg,
|
DoPyCommand((char *)eap->arg,
|
||||||
(rangeinitializer)init_range_cmd,
|
(rangeinitializer)init_range_cmd,
|
||||||
(runner)run_do,
|
(runner)run_do,
|
||||||
|
|||||||
85
src/kword_test.c
Normal file
85
src/kword_test.c
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
/* vi:set ts=8 sts=4 sw=4 noet:
|
||||||
|
*
|
||||||
|
* VIM - Vi IMproved by Bram Moolenaar
|
||||||
|
*
|
||||||
|
* Do ":help uganda" in Vim to read copying and usage conditions.
|
||||||
|
* Do ":help credits" in Vim to see a list of people who contributed.
|
||||||
|
* See README.txt for an overview of the Vim source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* kword_test.c: Unittests for vim_iswordc() and vim_iswordp().
|
||||||
|
*/
|
||||||
|
|
||||||
|
#undef NDEBUG
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
/* Must include main.c because it contains much more than just main() */
|
||||||
|
#define NO_VIM_MAIN
|
||||||
|
#include "main.c"
|
||||||
|
|
||||||
|
/* This file has to be included because the tested functions are static */
|
||||||
|
#include "charset.c"
|
||||||
|
|
||||||
|
#ifdef FEAT_MBYTE
|
||||||
|
/*
|
||||||
|
* Test the results of vim_iswordc() and vim_iswordp() are matched.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
test_isword_funcs_utf8(void)
|
||||||
|
{
|
||||||
|
buf_T buf;
|
||||||
|
int c;
|
||||||
|
|
||||||
|
vim_memset(&buf, 0, sizeof(buf));
|
||||||
|
p_enc = (char_u *)"utf-8";
|
||||||
|
p_isi = (char_u *)"";
|
||||||
|
p_isp = (char_u *)"";
|
||||||
|
p_isf = (char_u *)"";
|
||||||
|
buf.b_p_isk = (char_u *)"@,48-57,_,128-167,224-235";
|
||||||
|
|
||||||
|
curbuf = &buf;
|
||||||
|
mb_init(); /* calls init_chartab() */
|
||||||
|
|
||||||
|
for (c = 0; c < 0x10000; ++c)
|
||||||
|
{
|
||||||
|
char_u p[4] = {0};
|
||||||
|
int c1;
|
||||||
|
int retc;
|
||||||
|
int retp;
|
||||||
|
|
||||||
|
utf_char2bytes(c, p);
|
||||||
|
c1 = utf_ptr2char(p);
|
||||||
|
if (c != c1)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Failed: ");
|
||||||
|
fprintf(stderr,
|
||||||
|
"[c = %#04x, p = {%#02x, %#02x, %#02x}] ",
|
||||||
|
c, p[0], p[1], p[2]);
|
||||||
|
fprintf(stderr, "c != utf_ptr2char(p) (=%#04x)\n", c1);
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
retc = vim_iswordc_buf(c, &buf);
|
||||||
|
retp = vim_iswordp_buf(p, &buf);
|
||||||
|
if (retc != retp)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Failed: ");
|
||||||
|
fprintf(stderr,
|
||||||
|
"[c = %#04x, p = {%#02x, %#02x, %#02x}] ",
|
||||||
|
c, p[0], p[1], p[2]);
|
||||||
|
fprintf(stderr, "vim_iswordc(c) (=%d) != vim_iswordp(p) (=%d)\n",
|
||||||
|
retc, retp);
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main(void)
|
||||||
|
{
|
||||||
|
#ifdef FEAT_MBYTE
|
||||||
|
test_isword_funcs_utf8();
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
24
src/mark.c
24
src/mark.c
@@ -57,6 +57,7 @@ setmark(int c)
|
|||||||
setmark_pos(int c, pos_T *pos, int fnum)
|
setmark_pos(int c, pos_T *pos, int fnum)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
buf_T *buf;
|
||||||
|
|
||||||
/* Check for a special key (may cause islower() to crash). */
|
/* Check for a special key (may cause islower() to crash). */
|
||||||
if (c < 0)
|
if (c < 0)
|
||||||
@@ -75,9 +76,13 @@ setmark_pos(int c, pos_T *pos, int fnum)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buf = buflist_findnr(fnum);
|
||||||
|
if (buf == NULL)
|
||||||
|
return FAIL;
|
||||||
|
|
||||||
if (c == '"')
|
if (c == '"')
|
||||||
{
|
{
|
||||||
curbuf->b_last_cursor = *pos;
|
buf->b_last_cursor = *pos;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,31 +90,31 @@ setmark_pos(int c, pos_T *pos, int fnum)
|
|||||||
* file. */
|
* file. */
|
||||||
if (c == '[')
|
if (c == '[')
|
||||||
{
|
{
|
||||||
curbuf->b_op_start = *pos;
|
buf->b_op_start = *pos;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
if (c == ']')
|
if (c == ']')
|
||||||
{
|
{
|
||||||
curbuf->b_op_end = *pos;
|
buf->b_op_end = *pos;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c == '<' || c == '>')
|
if (c == '<' || c == '>')
|
||||||
{
|
{
|
||||||
if (c == '<')
|
if (c == '<')
|
||||||
curbuf->b_visual.vi_start = *pos;
|
buf->b_visual.vi_start = *pos;
|
||||||
else
|
else
|
||||||
curbuf->b_visual.vi_end = *pos;
|
buf->b_visual.vi_end = *pos;
|
||||||
if (curbuf->b_visual.vi_mode == NUL)
|
if (buf->b_visual.vi_mode == NUL)
|
||||||
/* Visual_mode has not yet been set, use a sane default. */
|
/* Visual_mode has not yet been set, use a sane default. */
|
||||||
curbuf->b_visual.vi_mode = 'v';
|
buf->b_visual.vi_mode = 'v';
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ASCII_ISLOWER(c))
|
if (ASCII_ISLOWER(c))
|
||||||
{
|
{
|
||||||
i = c - 'a';
|
i = c - 'a';
|
||||||
curbuf->b_namedm[i] = *pos;
|
buf->b_namedm[i] = *pos;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
if (ASCII_ISUPPER(c) || VIM_ISDIGIT(c))
|
if (ASCII_ISUPPER(c) || VIM_ISDIGIT(c))
|
||||||
@@ -396,7 +401,8 @@ getmark_buf_fnum(
|
|||||||
{
|
{
|
||||||
startp = &buf->b_visual.vi_start;
|
startp = &buf->b_visual.vi_start;
|
||||||
endp = &buf->b_visual.vi_end;
|
endp = &buf->b_visual.vi_end;
|
||||||
if ((c == '<') == lt(*startp, *endp))
|
if (((c == '<') == lt(*startp, *endp) || endp->lnum == 0)
|
||||||
|
&& startp->lnum != 0)
|
||||||
posp = startp;
|
posp = startp;
|
||||||
else
|
else
|
||||||
posp = endp;
|
posp = endp;
|
||||||
|
|||||||
10
src/mbyte.c
10
src/mbyte.c
@@ -895,7 +895,7 @@ mb_get_class_buf(char_u *p, buf_T *buf)
|
|||||||
if (enc_dbcs != 0 && p[0] != NUL && p[1] != NUL)
|
if (enc_dbcs != 0 && p[0] != NUL && p[1] != NUL)
|
||||||
return dbcs_class(p[0], p[1]);
|
return dbcs_class(p[0], p[1]);
|
||||||
if (enc_utf8)
|
if (enc_utf8)
|
||||||
return utf_class(utf_ptr2char(p));
|
return utf_class_buf(utf_ptr2char(p), buf);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2693,6 +2693,12 @@ static struct interval emoji_all[] =
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
utf_class(int c)
|
utf_class(int c)
|
||||||
|
{
|
||||||
|
return utf_class_buf(c, curbuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
utf_class_buf(int c, buf_T *buf)
|
||||||
{
|
{
|
||||||
/* sorted list of non-overlapping intervals */
|
/* sorted list of non-overlapping intervals */
|
||||||
static struct clinterval
|
static struct clinterval
|
||||||
@@ -2780,7 +2786,7 @@ utf_class(int c)
|
|||||||
{
|
{
|
||||||
if (c == ' ' || c == '\t' || c == NUL || c == 0xa0)
|
if (c == ' ' || c == '\t' || c == NUL || c == 0xa0)
|
||||||
return 0; /* blank */
|
return 0; /* blank */
|
||||||
if (vim_iswordc(c))
|
if (vim_iswordc_buf(c, buf))
|
||||||
return 2; /* word character */
|
return 2; /* word character */
|
||||||
return 1; /* punctuation */
|
return 1; /* punctuation */
|
||||||
}
|
}
|
||||||
|
|||||||
100
src/misc2.c
100
src/misc2.c
@@ -1602,7 +1602,10 @@ strup_save(char_u *orig)
|
|||||||
{
|
{
|
||||||
s = alloc((unsigned)STRLEN(res) + 1 + newl - l);
|
s = alloc((unsigned)STRLEN(res) + 1 + newl - l);
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
break;
|
{
|
||||||
|
vim_free(res);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
mch_memmove(s, res, p - res);
|
mch_memmove(s, res, p - res);
|
||||||
STRCPY(s + (p - res) + newl, p + l);
|
STRCPY(s + (p - res) + newl, p + l);
|
||||||
p = s + (p - res);
|
p = s + (p - res);
|
||||||
@@ -1625,6 +1628,69 @@ strup_save(char_u *orig)
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Make string "s" all lower-case and return it in allocated memory.
|
||||||
|
* Handles multi-byte characters as well as possible.
|
||||||
|
* Returns NULL when out of memory.
|
||||||
|
*/
|
||||||
|
char_u *
|
||||||
|
strlow_save(char_u *orig)
|
||||||
|
{
|
||||||
|
char_u *p;
|
||||||
|
char_u *res;
|
||||||
|
|
||||||
|
res = p = vim_strsave(orig);
|
||||||
|
|
||||||
|
if (res != NULL)
|
||||||
|
while (*p != NUL)
|
||||||
|
{
|
||||||
|
# ifdef FEAT_MBYTE
|
||||||
|
int l;
|
||||||
|
|
||||||
|
if (enc_utf8)
|
||||||
|
{
|
||||||
|
int c, lc;
|
||||||
|
int newl;
|
||||||
|
char_u *s;
|
||||||
|
|
||||||
|
c = utf_ptr2char(p);
|
||||||
|
lc = utf_tolower(c);
|
||||||
|
|
||||||
|
/* Reallocate string when byte count changes. This is rare,
|
||||||
|
* thus it's OK to do another malloc()/free(). */
|
||||||
|
l = utf_ptr2len(p);
|
||||||
|
newl = utf_char2len(lc);
|
||||||
|
if (newl != l)
|
||||||
|
{
|
||||||
|
s = alloc((unsigned)STRLEN(res) + 1 + newl - l);
|
||||||
|
if (s == NULL)
|
||||||
|
{
|
||||||
|
vim_free(res);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
mch_memmove(s, res, p - res);
|
||||||
|
STRCPY(s + (p - res) + newl, p + l);
|
||||||
|
p = s + (p - res);
|
||||||
|
vim_free(res);
|
||||||
|
res = s;
|
||||||
|
}
|
||||||
|
|
||||||
|
utf_char2bytes(lc, p);
|
||||||
|
p += newl;
|
||||||
|
}
|
||||||
|
else if (has_mbyte && (l = (*mb_ptr2len)(p)) > 1)
|
||||||
|
p += l; /* skip multi-byte character */
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
*p = TOLOWER_LOC(*p); /* note that tolower() can be a macro */
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1653,7 +1719,7 @@ vim_strncpy(char_u *to, char_u *from, size_t len)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Like strcat(), but make sure the result fits in "tosize" bytes and is
|
* Like strcat(), but make sure the result fits in "tosize" bytes and is
|
||||||
* always NUL terminated.
|
* always NUL terminated. "from" and "to" may overlap.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
vim_strcat(char_u *to, char_u *from, size_t tosize)
|
vim_strcat(char_u *to, char_u *from, size_t tosize)
|
||||||
@@ -1667,7 +1733,7 @@ vim_strcat(char_u *to, char_u *from, size_t tosize)
|
|||||||
to[tosize - 1] = NUL;
|
to[tosize - 1] = NUL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
STRCPY(to + tolen, from);
|
mch_memmove(to + tolen, from, fromlen + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1740,34 +1806,6 @@ vim_memset(void *ptr, int c, size_t size)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* skipped when generating prototypes, the prototype is in vim.h */
|
|
||||||
#ifdef VIM_MEMMOVE
|
|
||||||
/*
|
|
||||||
* Version of memmove() that handles overlapping source and destination.
|
|
||||||
* For systems that don't have a function that is guaranteed to do that (SYSV).
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
mch_memmove(void *src_arg, void *dst_arg, size_t len)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* A void doesn't have a size, we use char pointers.
|
|
||||||
*/
|
|
||||||
char *dst = dst_arg, *src = src_arg;
|
|
||||||
|
|
||||||
/* overlap, copy backwards */
|
|
||||||
if (dst > src && dst < src + len)
|
|
||||||
{
|
|
||||||
src += len;
|
|
||||||
dst += len;
|
|
||||||
while (len-- > 0)
|
|
||||||
*--dst = *--src;
|
|
||||||
}
|
|
||||||
else /* copy forwards */
|
|
||||||
while (len-- > 0)
|
|
||||||
*dst++ = *src++;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (!defined(HAVE_STRCASECMP) && !defined(HAVE_STRICMP)) || defined(PROTO)
|
#if (!defined(HAVE_STRCASECMP) && !defined(HAVE_STRICMP)) || defined(PROTO)
|
||||||
/*
|
/*
|
||||||
* Compare two strings, ignoring case, using current locale.
|
* Compare two strings, ignoring case, using current locale.
|
||||||
|
|||||||
17
src/ops.c
17
src/ops.c
@@ -3774,16 +3774,25 @@ do_put(
|
|||||||
*/
|
*/
|
||||||
if (y_type == MCHAR && y_size == 1)
|
if (y_type == MCHAR && y_size == 1)
|
||||||
{
|
{
|
||||||
linenr_T end = curbuf->b_visual.vi_end.lnum;
|
linenr_T end_lnum = 0; /* init for gcc */
|
||||||
|
|
||||||
if (curbuf->b_visual.vi_end.lnum < curbuf->b_visual.vi_start.lnum)
|
if (VIsual_active)
|
||||||
end = curbuf->b_visual.vi_start.lnum;
|
{
|
||||||
|
end_lnum = curbuf->b_visual.vi_end.lnum;
|
||||||
|
if (end_lnum < curbuf->b_visual.vi_start.lnum)
|
||||||
|
end_lnum = curbuf->b_visual.vi_start.lnum;
|
||||||
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
totlen = count * yanklen;
|
totlen = count * yanklen;
|
||||||
if (totlen > 0)
|
if (totlen > 0)
|
||||||
{
|
{
|
||||||
oldp = ml_get(lnum);
|
oldp = ml_get(lnum);
|
||||||
|
if (VIsual_active && col > (int)STRLEN(oldp))
|
||||||
|
{
|
||||||
|
lnum++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
newp = alloc_check((unsigned)(STRLEN(oldp) + totlen + 1));
|
newp = alloc_check((unsigned)(STRLEN(oldp) + totlen + 1));
|
||||||
if (newp == NULL)
|
if (newp == NULL)
|
||||||
goto end; /* alloc() gave an error message */
|
goto end; /* alloc() gave an error message */
|
||||||
@@ -3806,7 +3815,7 @@ do_put(
|
|||||||
}
|
}
|
||||||
if (VIsual_active)
|
if (VIsual_active)
|
||||||
lnum++;
|
lnum++;
|
||||||
} while (VIsual_active && lnum <= end);
|
} while (VIsual_active && lnum <= end_lnum);
|
||||||
|
|
||||||
if (VIsual_active) /* reset lnum to the last visual line */
|
if (VIsual_active) /* reset lnum to the last visual line */
|
||||||
lnum--;
|
lnum--;
|
||||||
|
|||||||
37
src/option.c
37
src/option.c
@@ -479,6 +479,17 @@ struct vimoption
|
|||||||
# define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,t:Title,v:Visual,w:WarningMsg,W:WildMenu,>:SignColumn,*:TabLine,#:TabLineSel,_:TabLineFill"
|
# define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,t:Title,v:Visual,w:WarningMsg,W:WildMenu,>:SignColumn,*:TabLine,#:TabLineSel,_:TabLineFill"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Default python version for pyx* commands */
|
||||||
|
#if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3)
|
||||||
|
# define DEFAULT_PYTHON_VER 0
|
||||||
|
#elif defined(FEAT_PYTHON3)
|
||||||
|
# define DEFAULT_PYTHON_VER 3
|
||||||
|
#elif defined(FEAT_PYTHON)
|
||||||
|
# define DEFAULT_PYTHON_VER 2
|
||||||
|
#else
|
||||||
|
# define DEFAULT_PYTHON_VER 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* options[] is initialized here.
|
* options[] is initialized here.
|
||||||
* The order of the options MUST be alphabetic for ":set all" and findoption().
|
* The order of the options MUST be alphabetic for ":set all" and findoption().
|
||||||
@@ -2143,6 +2154,14 @@ static struct vimoption options[] =
|
|||||||
{(char_u *)DYNAMIC_PYTHON_DLL, (char_u *)0L}
|
{(char_u *)DYNAMIC_PYTHON_DLL, (char_u *)0L}
|
||||||
SCRIPTID_INIT},
|
SCRIPTID_INIT},
|
||||||
#endif
|
#endif
|
||||||
|
{"pyxversion", "pyx", P_NUM|P_VI_DEF|P_SECURE,
|
||||||
|
#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
|
||||||
|
(char_u *)&p_pyx, PV_NONE,
|
||||||
|
#else
|
||||||
|
(char_u *)NULL, PV_NONE,
|
||||||
|
#endif
|
||||||
|
{(char_u *)DEFAULT_PYTHON_VER, (char_u *)0L}
|
||||||
|
SCRIPTID_INIT},
|
||||||
{"quoteescape", "qe", P_STRING|P_ALLOCED|P_VI_DEF,
|
{"quoteescape", "qe", P_STRING|P_ALLOCED|P_VI_DEF,
|
||||||
#ifdef FEAT_TEXTOBJ
|
#ifdef FEAT_TEXTOBJ
|
||||||
(char_u *)&p_qe, PV_QE,
|
(char_u *)&p_qe, PV_QE,
|
||||||
@@ -6619,6 +6638,15 @@ did_set_string_option(
|
|||||||
mch_set_normal_colors();
|
mch_set_normal_colors();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
if (varp == &T_BE && termcap_active)
|
||||||
|
{
|
||||||
|
if (*T_BE == NUL)
|
||||||
|
/* When clearing t_BE we assume the user no longer wants
|
||||||
|
* bracketed paste, thus disable it by writing t_BD. */
|
||||||
|
out_str(T_BD);
|
||||||
|
else
|
||||||
|
out_str(T_BE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_LINEBREAK
|
#ifdef FEAT_LINEBREAK
|
||||||
@@ -8817,6 +8845,15 @@ set_num_option(
|
|||||||
mzvim_reset_timer();
|
mzvim_reset_timer();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
|
||||||
|
/* 'pyxversion' */
|
||||||
|
else if (pp == &p_pyx)
|
||||||
|
{
|
||||||
|
if (p_pyx != 0 && p_pyx != 2 && p_pyx != 3)
|
||||||
|
errmsg = e_invarg;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* sync undo before 'undolevels' changes */
|
/* sync undo before 'undolevels' changes */
|
||||||
else if (pp == &p_ul)
|
else if (pp == &p_ul)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -694,6 +694,9 @@ EXTERN char_u *p_py3dll; /* 'pythonthreedll' */
|
|||||||
#if defined(DYNAMIC_PYTHON)
|
#if defined(DYNAMIC_PYTHON)
|
||||||
EXTERN char_u *p_pydll; /* 'pythondll' */
|
EXTERN char_u *p_pydll; /* 'pythondll' */
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
|
||||||
|
EXTERN long p_pyx; /* 'pyxversion' */
|
||||||
|
#endif
|
||||||
#ifdef FEAT_RELTIME
|
#ifdef FEAT_RELTIME
|
||||||
EXTERN long p_rdt; /* 'redrawtime' */
|
EXTERN long p_rdt; /* 'redrawtime' */
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -423,21 +423,17 @@ typedef struct dsc$descriptor DESC;
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* memmove is not present on all systems, use memmove, bcopy, memcpy or our
|
/* memmove() is not present on all systems, use memmove, bcopy or memcpy.
|
||||||
* own version */
|
* Some systems have (void *) arguments, some (char *). If we use (char *) it
|
||||||
/* Some systems have (void *) arguments, some (char *). If we use (char *) it
|
|
||||||
* works for all */
|
* works for all */
|
||||||
#ifdef USEMEMMOVE
|
#if defined(USEMEMMOVE) || (!defined(USEBCOPY) && !defined(USEMEMCPY))
|
||||||
# define mch_memmove(to, from, len) memmove((char *)(to), (char *)(from), len)
|
# define mch_memmove(to, from, len) memmove((char *)(to), (char *)(from), len)
|
||||||
#else
|
#else
|
||||||
# ifdef USEBCOPY
|
# ifdef USEBCOPY
|
||||||
# define mch_memmove(to, from, len) bcopy((char *)(from), (char *)(to), len)
|
# define mch_memmove(to, from, len) bcopy((char *)(from), (char *)(to), len)
|
||||||
# else
|
# else
|
||||||
# ifdef USEMEMCPY
|
/* ifdef USEMEMCPY */
|
||||||
# define mch_memmove(to, from, len) memcpy((char *)(to), (char *)(from), len)
|
# define mch_memmove(to, from, len) memcpy((char *)(to), (char *)(from), len)
|
||||||
# else
|
|
||||||
# define VIM_MEMMOVE /* found in misc2.c */
|
|
||||||
# endif
|
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -232,12 +232,13 @@ sk.cp1250.po: sk.po
|
|||||||
iconv -f iso-8859-2 -t cp1250 sk.po | \
|
iconv -f iso-8859-2 -t cp1250 sk.po | \
|
||||||
sed -e 's/charset=ISO-8859-2/charset=cp1250/' -e 's/# Original translations/# Generated from sk.po, DO NOT EDIT/' > sk.cp1250.po
|
sed -e 's/charset=ISO-8859-2/charset=cp1250/' -e 's/# Original translations/# Generated from sk.po, DO NOT EDIT/' > sk.cp1250.po
|
||||||
|
|
||||||
# Convert zh_CN.po to create zh_CN.cp936.po.
|
# Convert zh_CN.UTF-8.po to create zh_CN.cp936.po.
|
||||||
# set 'charset' to gbk to avoid that msfmt generates a warning
|
# Set 'charset' to gbk to avoid that msfmt generates a warning.
|
||||||
zh_CN.cp936.po: zh_CN.po
|
# This used to convert from zh_CN.po, but that results in a conversion error.
|
||||||
|
zh_CN.cp936.po: zh_CN.UTF-8.po
|
||||||
rm -f zh_CN.cp936.po
|
rm -f zh_CN.cp936.po
|
||||||
iconv -f gb2312 -t cp936 zh_CN.po | \
|
iconv -f UTF-8 -t cp936 zh_CN.UTF-8.po | \
|
||||||
sed -e 's/charset=gb2312/charset=gbk/' -e 's/# Original translations/# Generated from zh_CN.po, DO NOT EDIT/' > zh_CN.cp936.po
|
sed -e 's/charset=utf-8/charset=gbk/' -e 's/# Original translations/# Generated from zh_CN.po, DO NOT EDIT/' > zh_CN.cp936.po
|
||||||
|
|
||||||
# Convert ko.UTF-8.po to create ko.po.
|
# Convert ko.UTF-8.po to create ko.po.
|
||||||
ko.po: ko.UTF-8.po
|
ko.po: ko.UTF-8.po
|
||||||
|
|||||||
@@ -2894,7 +2894,8 @@ msgstr "-X\t\t\t不连接到 X Server"
|
|||||||
msgid "--remote <files>\tEdit <files> in a Vim server if possible"
|
msgid "--remote <files>\tEdit <files> in a Vim server if possible"
|
||||||
msgstr "--remote <files>\t如有可能,在 Vim 服务器上编辑文件 <files>"
|
msgstr "--remote <files>\t如有可能,在 Vim 服务器上编辑文件 <files>"
|
||||||
|
|
||||||
msgid "--remote-silent <files> Same, don't complain if there is no server"
|
msgid ""
|
||||||
|
"--remote-silent <files> Same, don't complain if there is no server"
|
||||||
msgstr "--remote-silent <files> 同上,找不到服务器时不抱怨"
|
msgstr "--remote-silent <files> 同上,找不到服务器时不抱怨"
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
|
|||||||
@@ -241,9 +241,8 @@ msgstr "
|
|||||||
msgid " Tag completion (^]^N^P)"
|
msgid " Tag completion (^]^N^P)"
|
||||||
msgstr " Tag <20><>ȫ (^]^N^P)"
|
msgstr " Tag <20><>ȫ (^]^N^P)"
|
||||||
|
|
||||||
#, fuzzy
|
msgid " Path pattern completion (^N^P)"
|
||||||
#~ msgid " Path pattern completion (^N^P)"
|
msgstr " ͷ<>ļ<EFBFBD>ģʽ<C4A3><CABD>ȫ (^N^P)"
|
||||||
#~ msgstr " ·<><C2B7>ģʽ<C4A3><CABD>ȫ (^N^P)"
|
|
||||||
|
|
||||||
msgid " Definition completion (^D^N^P)"
|
msgid " Definition completion (^D^N^P)"
|
||||||
msgstr " <20><><EFBFBD>岹ȫ (^D^N^P)"
|
msgstr " <20><><EFBFBD>岹ȫ (^D^N^P)"
|
||||||
@@ -2896,7 +2895,7 @@ msgid "--remote <files>\tEdit <files> in a Vim server if possible"
|
|||||||
msgstr "--remote <files>\t<><74><EFBFBD>п<EFBFBD><D0BF>ܣ<EFBFBD><DCA3><EFBFBD> Vim <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϱ༭<CFB1>ļ<EFBFBD> <files>"
|
msgstr "--remote <files>\t<><74><EFBFBD>п<EFBFBD><D0BF>ܣ<EFBFBD><DCA3><EFBFBD> Vim <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϱ༭<CFB1>ļ<EFBFBD> <files>"
|
||||||
|
|
||||||
msgid "--remote-silent <files> Same, don't complain if there is no server"
|
msgid "--remote-silent <files> Same, don't complain if there is no server"
|
||||||
msgstr "--remote-silent <files> ͬ<>ϣ<EFBFBD><CFA3>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>Թ"
|
msgstr "--remote-silent <files> ͬ<>ϣ<EFBFBD><CFA3>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Թ"
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"--remote-wait <files> As --remote but wait for files to have been edited"
|
"--remote-wait <files> As --remote but wait for files to have been edited"
|
||||||
@@ -5284,7 +5283,7 @@ msgstr "Vim:
|
|||||||
|
|
||||||
#. must display the prompt
|
#. must display the prompt
|
||||||
msgid "No undo possible; continue anyway"
|
msgid "No undo possible; continue anyway"
|
||||||
msgstr "<22><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
msgstr "<22><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||||
|
|
||||||
msgid "Already at oldest change"
|
msgid "Already at oldest change"
|
||||||
msgstr "<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>ɵĸı<C4B8>"
|
msgstr "<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>ɵĸı<C4B8>"
|
||||||
@@ -5601,13 +5600,13 @@ msgid "type :help cp-default<Enter> for info on this"
|
|||||||
msgstr "<22><><EFBFBD><EFBFBD> :help cp-default<Enter> <20>鿴<EFBFBD><E9BFB4><EFBFBD><EFBFBD>˵<EFBFBD><CBB5> "
|
msgstr "<22><><EFBFBD><EFBFBD> :help cp-default<Enter> <20>鿴<EFBFBD><E9BFB4><EFBFBD><EFBFBD>˵<EFBFBD><CBB5> "
|
||||||
|
|
||||||
msgid "menu Help->Orphans for information "
|
msgid "menu Help->Orphans for information "
|
||||||
msgstr "<22>˵<EFBFBD> Help->Orphans <20>鿴˵<E9BFB4><CBB5> "
|
msgstr "<22>˵<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>-><3E>¶<EFBFBD> <20>鿴˵<E9BFB4><CBB5> "
|
||||||
|
|
||||||
msgid "Running modeless, typed text is inserted"
|
msgid "Running modeless, typed text is inserted"
|
||||||
msgstr "<22><>ģʽ<C4A3><CABD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD><EFBFBD><EFBFBD>"
|
msgstr "<22><>ģʽ<C4A3><CABD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD><EFBFBD><EFBFBD>"
|
||||||
|
|
||||||
msgid "menu Edit->Global Settings->Toggle Insert Mode "
|
msgid "menu Edit->Global Settings->Toggle Insert Mode "
|
||||||
msgstr "<22>˵<EFBFBD> Edit->Global Settings->Toggle Insert Mode "
|
msgstr "<22>˵<EFBFBD> <EFBFBD>༭->ȫ<><C8AB><EFBFBD>趨-><3E><>/<2F>ز<EFBFBD><D8B2><EFBFBD>ģʽ "
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
#~ msgid " for two modes "
|
#~ msgid " for two modes "
|
||||||
|
|||||||
@@ -75,6 +75,10 @@ int do_in_runtimepath(char_u *name, int flags, void (*callback)(char_u *fname, v
|
|||||||
void ex_packloadall(exarg_T *eap);
|
void ex_packloadall(exarg_T *eap);
|
||||||
void ex_packadd(exarg_T *eap);
|
void ex_packadd(exarg_T *eap);
|
||||||
void ex_options(exarg_T *eap);
|
void ex_options(exarg_T *eap);
|
||||||
|
void init_pyxversion(void);
|
||||||
|
void ex_pyxfile(exarg_T *eap);
|
||||||
|
void ex_pyx(exarg_T *eap);
|
||||||
|
void ex_pyxdo(exarg_T *eap);
|
||||||
void ex_source(exarg_T *eap);
|
void ex_source(exarg_T *eap);
|
||||||
linenr_T *source_breakpoint(void *cookie);
|
linenr_T *source_breakpoint(void *cookie);
|
||||||
int *source_dbg_tick(void *cookie);
|
int *source_dbg_tick(void *cookie);
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ int utf_char2bytes(int c, char_u *buf);
|
|||||||
int utf_iscomposing(int c);
|
int utf_iscomposing(int c);
|
||||||
int utf_printable(int c);
|
int utf_printable(int c);
|
||||||
int utf_class(int c);
|
int utf_class(int c);
|
||||||
|
int utf_class_buf(int c, buf_T *buf);
|
||||||
int utf_ambiguous_width(int c);
|
int utf_ambiguous_width(int c);
|
||||||
int utf_fold(int a);
|
int utf_fold(int a);
|
||||||
int utf_toupper(int a);
|
int utf_toupper(int a);
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ char_u *vim_strsave_up(char_u *string);
|
|||||||
char_u *vim_strnsave_up(char_u *string, int len);
|
char_u *vim_strnsave_up(char_u *string, int len);
|
||||||
void vim_strup(char_u *p);
|
void vim_strup(char_u *p);
|
||||||
char_u *strup_save(char_u *orig);
|
char_u *strup_save(char_u *orig);
|
||||||
|
char_u *strlow_save(char_u *orig);
|
||||||
void del_trailing_spaces(char_u *ptr);
|
void del_trailing_spaces(char_u *ptr);
|
||||||
void vim_strncpy(char_u *to, char_u *from, size_t len);
|
void vim_strncpy(char_u *to, char_u *from, size_t len);
|
||||||
void vim_strcat(char_u *to, char_u *from, size_t tosize);
|
void vim_strcat(char_u *to, char_u *from, size_t tosize);
|
||||||
|
|||||||
@@ -3651,6 +3651,7 @@ win_line(
|
|||||||
{
|
{
|
||||||
/* Draw the 'foldcolumn'. Allocate a buffer, "extra" may
|
/* Draw the 'foldcolumn'. Allocate a buffer, "extra" may
|
||||||
* already be in use. */
|
* already be in use. */
|
||||||
|
vim_free(p_extra_free);
|
||||||
p_extra_free = alloc(12 + 1);
|
p_extra_free = alloc(12 + 1);
|
||||||
|
|
||||||
if (p_extra_free != NULL)
|
if (p_extra_free != NULL)
|
||||||
@@ -4695,6 +4696,7 @@ win_line(
|
|||||||
p = alloc((unsigned)(len + 1));
|
p = alloc((unsigned)(len + 1));
|
||||||
vim_memset(p, ' ', len);
|
vim_memset(p, ' ', len);
|
||||||
p[len] = NUL;
|
p[len] = NUL;
|
||||||
|
vim_free(p_extra_free);
|
||||||
p_extra_free = p;
|
p_extra_free = p;
|
||||||
for (i = 0; i < tab_len; i++)
|
for (i = 0; i < tab_len; i++)
|
||||||
{
|
{
|
||||||
@@ -4857,6 +4859,7 @@ win_line(
|
|||||||
vim_memset(p, ' ', n_extra);
|
vim_memset(p, ' ', n_extra);
|
||||||
STRNCPY(p, p_extra + 1, STRLEN(p_extra) - 1);
|
STRNCPY(p, p_extra + 1, STRLEN(p_extra) - 1);
|
||||||
p[n_extra] = NUL;
|
p[n_extra] = NUL;
|
||||||
|
vim_free(p_extra_free);
|
||||||
p_extra_free = p_extra = p;
|
p_extra_free = p_extra = p;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -5784,6 +5787,7 @@ win_line(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
vim_free(p_extra_free);
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ SCRIPTS_ALL = \
|
|||||||
test_listchars.out \
|
test_listchars.out \
|
||||||
test_listlbr.out \
|
test_listlbr.out \
|
||||||
test_search_mbyte.out \
|
test_search_mbyte.out \
|
||||||
test_utf8.out \
|
|
||||||
test_wordcount.out
|
test_wordcount.out
|
||||||
|
|
||||||
|
|
||||||
@@ -173,9 +172,12 @@ NEW_TESTS = test_arglist.res \
|
|||||||
test_nested_function.res \
|
test_nested_function.res \
|
||||||
test_netbeans.res \
|
test_netbeans.res \
|
||||||
test_normal.res \
|
test_normal.res \
|
||||||
|
test_paste.res \
|
||||||
test_packadd.res \
|
test_packadd.res \
|
||||||
test_perl.res \
|
test_perl.res \
|
||||||
test_profile.res \
|
test_profile.res \
|
||||||
|
test_pyx2.res \
|
||||||
|
test_pyx3.res \
|
||||||
test_quickfix.res \
|
test_quickfix.res \
|
||||||
test_retab.res \
|
test_retab.res \
|
||||||
test_ruby.res \
|
test_ruby.res \
|
||||||
|
|||||||
4
src/testdir/pyxfile/py2_magic.py
Normal file
4
src/testdir/pyxfile/py2_magic.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# requires python 2.x
|
||||||
|
|
||||||
|
import sys
|
||||||
|
print(sys.version)
|
||||||
4
src/testdir/pyxfile/py2_shebang.py
Normal file
4
src/testdir/pyxfile/py2_shebang.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/python2
|
||||||
|
|
||||||
|
import sys
|
||||||
|
print(sys.version)
|
||||||
4
src/testdir/pyxfile/py3_magic.py
Normal file
4
src/testdir/pyxfile/py3_magic.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# requires python 3.x
|
||||||
|
|
||||||
|
import sys
|
||||||
|
print(sys.version)
|
||||||
4
src/testdir/pyxfile/py3_shebang.py
Normal file
4
src/testdir/pyxfile/py3_shebang.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import sys
|
||||||
|
print(sys.version)
|
||||||
2
src/testdir/pyxfile/pyx.py
Normal file
2
src/testdir/pyxfile/pyx.py
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
import sys
|
||||||
|
print(sys.version)
|
||||||
@@ -9,3 +9,4 @@ source test_expr_utf8.vim
|
|||||||
source test_matchadd_conceal_utf8.vim
|
source test_matchadd_conceal_utf8.vim
|
||||||
source test_regexp_utf8.vim
|
source test_regexp_utf8.vim
|
||||||
source test_source_utf8.vim
|
source test_source_utf8.vim
|
||||||
|
source test_utf8.vim
|
||||||
|
|||||||
@@ -121,6 +121,12 @@ func Test_assert_inrange()
|
|||||||
call assert_fails('call assert_inrange(1, 1)', 'E119:')
|
call assert_fails('call assert_inrange(1, 1)', 'E119:')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_assert_with_msg()
|
||||||
|
call assert_equal('foo', 'bar', 'testing')
|
||||||
|
call assert_match("testing: Expected 'foo' but got 'bar'", v:errors[0])
|
||||||
|
call remove(v:errors, 0)
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_user_is_happy()
|
func Test_user_is_happy()
|
||||||
smile
|
smile
|
||||||
sleep 300m
|
sleep 300m
|
||||||
|
|||||||
@@ -295,3 +295,14 @@ func Test_illegal_address()
|
|||||||
2;')
|
2;')
|
||||||
quit
|
quit
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_cmdline_complete_wildoptions()
|
||||||
|
help
|
||||||
|
call feedkeys(":tag /\<c-a>\<c-b>\"\<cr>", 'tx')
|
||||||
|
let a = join(sort(split(@:)),' ')
|
||||||
|
set wildoptions=tagfile
|
||||||
|
call feedkeys(":tag /\<c-a>\<c-b>\"\<cr>", 'tx')
|
||||||
|
let b = join(sort(split(@:)),' ')
|
||||||
|
call assert_equal(a, b)
|
||||||
|
bw!
|
||||||
|
endfunc
|
||||||
|
|||||||
@@ -16,3 +16,148 @@ func Test_str2nr()
|
|||||||
call assert_equal(123456789, str2nr('123456789'))
|
call assert_equal(123456789, str2nr('123456789'))
|
||||||
call assert_equal(-123456789, str2nr('-123456789'))
|
call assert_equal(-123456789, str2nr('-123456789'))
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_tolower()
|
||||||
|
call assert_equal("", tolower(""))
|
||||||
|
|
||||||
|
" Test with all printable ASCII characters.
|
||||||
|
call assert_equal(' !"#$%&''()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~',
|
||||||
|
\ tolower(' !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~'))
|
||||||
|
|
||||||
|
if !has('multi_byte')
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Test with a few uppercase diacritics.
|
||||||
|
call assert_equal("aàáâãäåāăąǎǟǡả", tolower("AÀÁÂÃÄÅĀĂĄǍǞǠẢ"))
|
||||||
|
call assert_equal("bḃḇ", tolower("BḂḆ"))
|
||||||
|
call assert_equal("cçćĉċč", tolower("CÇĆĈĊČ"))
|
||||||
|
call assert_equal("dďđḋḏḑ", tolower("DĎĐḊḎḐ"))
|
||||||
|
call assert_equal("eèéêëēĕėęěẻẽ", tolower("EÈÉÊËĒĔĖĘĚẺẼ"))
|
||||||
|
call assert_equal("fḟ ", tolower("FḞ "))
|
||||||
|
call assert_equal("gĝğġģǥǧǵḡ", tolower("GĜĞĠĢǤǦǴḠ"))
|
||||||
|
call assert_equal("hĥħḣḧḩ", tolower("HĤĦḢḦḨ"))
|
||||||
|
call assert_equal("iìíîïĩīĭįiǐỉ", tolower("IÌÍÎÏĨĪĬĮİǏỈ"))
|
||||||
|
call assert_equal("jĵ", tolower("JĴ"))
|
||||||
|
call assert_equal("kķǩḱḵ", tolower("KĶǨḰḴ"))
|
||||||
|
call assert_equal("lĺļľŀłḻ", tolower("LĹĻĽĿŁḺ"))
|
||||||
|
call assert_equal("mḿṁ", tolower("MḾṀ"))
|
||||||
|
call assert_equal("nñńņňṅṉ", tolower("NÑŃŅŇṄṈ"))
|
||||||
|
call assert_equal("oòóôõöøōŏőơǒǫǭỏ", tolower("OÒÓÔÕÖØŌŎŐƠǑǪǬỎ"))
|
||||||
|
call assert_equal("pṕṗ", tolower("PṔṖ"))
|
||||||
|
call assert_equal("q", tolower("Q"))
|
||||||
|
call assert_equal("rŕŗřṙṟ", tolower("RŔŖŘṘṞ"))
|
||||||
|
call assert_equal("sśŝşšṡ", tolower("SŚŜŞŠṠ"))
|
||||||
|
call assert_equal("tţťŧṫṯ", tolower("TŢŤŦṪṮ"))
|
||||||
|
call assert_equal("uùúûüũūŭůűųưǔủ", tolower("UÙÚÛÜŨŪŬŮŰŲƯǓỦ"))
|
||||||
|
call assert_equal("vṽ", tolower("VṼ"))
|
||||||
|
call assert_equal("wŵẁẃẅẇ", tolower("WŴẀẂẄẆ"))
|
||||||
|
call assert_equal("xẋẍ", tolower("XẊẌ"))
|
||||||
|
call assert_equal("yýŷÿẏỳỷỹ", tolower("YÝŶŸẎỲỶỸ"))
|
||||||
|
call assert_equal("zźżžƶẑẕ", tolower("ZŹŻŽƵẐẔ"))
|
||||||
|
|
||||||
|
" Test with a few lowercase diacritics, which should remain unchanged.
|
||||||
|
call assert_equal("aàáâãäåāăąǎǟǡả", tolower("aàáâãäåāăąǎǟǡả"))
|
||||||
|
call assert_equal("bḃḇ", tolower("bḃḇ"))
|
||||||
|
call assert_equal("cçćĉċč", tolower("cçćĉċč"))
|
||||||
|
call assert_equal("dďđḋḏḑ", tolower("dďđḋḏḑ"))
|
||||||
|
call assert_equal("eèéêëēĕėęěẻẽ", tolower("eèéêëēĕėęěẻẽ"))
|
||||||
|
call assert_equal("fḟ", tolower("fḟ"))
|
||||||
|
call assert_equal("gĝğġģǥǧǵḡ", tolower("gĝğġģǥǧǵḡ"))
|
||||||
|
call assert_equal("hĥħḣḧḩẖ", tolower("hĥħḣḧḩẖ"))
|
||||||
|
call assert_equal("iìíîïĩīĭįǐỉ", tolower("iìíîïĩīĭįǐỉ"))
|
||||||
|
call assert_equal("jĵǰ", tolower("jĵǰ"))
|
||||||
|
call assert_equal("kķǩḱḵ", tolower("kķǩḱḵ"))
|
||||||
|
call assert_equal("lĺļľŀłḻ", tolower("lĺļľŀłḻ"))
|
||||||
|
call assert_equal("mḿṁ ", tolower("mḿṁ "))
|
||||||
|
call assert_equal("nñńņňʼnṅṉ", tolower("nñńņňʼnṅṉ"))
|
||||||
|
call assert_equal("oòóôõöøōŏőơǒǫǭỏ", tolower("oòóôõöøōŏőơǒǫǭỏ"))
|
||||||
|
call assert_equal("pṕṗ", tolower("pṕṗ"))
|
||||||
|
call assert_equal("q", tolower("q"))
|
||||||
|
call assert_equal("rŕŗřṙṟ", tolower("rŕŗřṙṟ"))
|
||||||
|
call assert_equal("sśŝşšṡ", tolower("sśŝşšṡ"))
|
||||||
|
call assert_equal("tţťŧṫṯẗ", tolower("tţťŧṫṯẗ"))
|
||||||
|
call assert_equal("uùúûüũūŭůűųưǔủ", tolower("uùúûüũūŭůűųưǔủ"))
|
||||||
|
call assert_equal("vṽ", tolower("vṽ"))
|
||||||
|
call assert_equal("wŵẁẃẅẇẘ", tolower("wŵẁẃẅẇẘ"))
|
||||||
|
call assert_equal("ẋẍ", tolower("ẋẍ"))
|
||||||
|
call assert_equal("yýÿŷẏẙỳỷỹ", tolower("yýÿŷẏẙỳỷỹ"))
|
||||||
|
call assert_equal("zźżžƶẑẕ", tolower("zźżžƶẑẕ"))
|
||||||
|
|
||||||
|
" According to https://twitter.com/jifa/status/625776454479970304
|
||||||
|
" Ⱥ (U+023A) and Ⱦ (U+023E) are the *only* code points to increase
|
||||||
|
" in length (2 to 3 bytes) when lowercased. So let's test them.
|
||||||
|
call assert_equal("ⱥ ⱦ", tolower("Ⱥ Ⱦ"))
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_toupper()
|
||||||
|
call assert_equal("", toupper(""))
|
||||||
|
|
||||||
|
" Test with all printable ASCII characters.
|
||||||
|
call assert_equal(' !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~',
|
||||||
|
\ toupper(' !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~'))
|
||||||
|
|
||||||
|
if !has('multi_byte')
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Test with a few lowercase diacritics.
|
||||||
|
call assert_equal("AÀÁÂÃÄÅĀĂĄǍǞǠẢ", toupper("aàáâãäåāăąǎǟǡả"))
|
||||||
|
call assert_equal("BḂḆ", toupper("bḃḇ"))
|
||||||
|
call assert_equal("CÇĆĈĊČ", toupper("cçćĉċč"))
|
||||||
|
call assert_equal("DĎĐḊḎḐ", toupper("dďđḋḏḑ"))
|
||||||
|
call assert_equal("EÈÉÊËĒĔĖĘĚẺẼ", toupper("eèéêëēĕėęěẻẽ"))
|
||||||
|
call assert_equal("FḞ", toupper("fḟ"))
|
||||||
|
call assert_equal("GĜĞĠĢǤǦǴḠ", toupper("gĝğġģǥǧǵḡ"))
|
||||||
|
call assert_equal("HĤĦḢḦḨẖ", toupper("hĥħḣḧḩẖ"))
|
||||||
|
call assert_equal("IÌÍÎÏĨĪĬĮǏỈ", toupper("iìíîïĩīĭįǐỉ"))
|
||||||
|
call assert_equal("JĴǰ", toupper("jĵǰ"))
|
||||||
|
call assert_equal("KĶǨḰḴ", toupper("kķǩḱḵ"))
|
||||||
|
call assert_equal("LĹĻĽĿŁḺ", toupper("lĺļľŀłḻ"))
|
||||||
|
call assert_equal("MḾṀ ", toupper("mḿṁ "))
|
||||||
|
call assert_equal("NÑŃŅŇʼnṄṈ", toupper("nñńņňʼnṅṉ"))
|
||||||
|
call assert_equal("OÒÓÔÕÖØŌŎŐƠǑǪǬỎ", toupper("oòóôõöøōŏőơǒǫǭỏ"))
|
||||||
|
call assert_equal("PṔṖ", toupper("pṕṗ"))
|
||||||
|
call assert_equal("Q", toupper("q"))
|
||||||
|
call assert_equal("RŔŖŘṘṞ", toupper("rŕŗřṙṟ"))
|
||||||
|
call assert_equal("SŚŜŞŠṠ", toupper("sśŝşšṡ"))
|
||||||
|
call assert_equal("TŢŤŦṪṮẗ", toupper("tţťŧṫṯẗ"))
|
||||||
|
call assert_equal("UÙÚÛÜŨŪŬŮŰŲƯǓỦ", toupper("uùúûüũūŭůűųưǔủ"))
|
||||||
|
call assert_equal("VṼ", toupper("vṽ"))
|
||||||
|
call assert_equal("WŴẀẂẄẆẘ", toupper("wŵẁẃẅẇẘ"))
|
||||||
|
call assert_equal("ẊẌ", toupper("ẋẍ"))
|
||||||
|
call assert_equal("YÝŸŶẎẙỲỶỸ", toupper("yýÿŷẏẙỳỷỹ"))
|
||||||
|
call assert_equal("ZŹŻŽƵẐẔ", toupper("zźżžƶẑẕ"))
|
||||||
|
|
||||||
|
" Test that uppercase diacritics, which should remain unchanged.
|
||||||
|
call assert_equal("AÀÁÂÃÄÅĀĂĄǍǞǠẢ", toupper("AÀÁÂÃÄÅĀĂĄǍǞǠẢ"))
|
||||||
|
call assert_equal("BḂḆ", toupper("BḂḆ"))
|
||||||
|
call assert_equal("CÇĆĈĊČ", toupper("CÇĆĈĊČ"))
|
||||||
|
call assert_equal("DĎĐḊḎḐ", toupper("DĎĐḊḎḐ"))
|
||||||
|
call assert_equal("EÈÉÊËĒĔĖĘĚẺẼ", toupper("EÈÉÊËĒĔĖĘĚẺẼ"))
|
||||||
|
call assert_equal("FḞ ", toupper("FḞ "))
|
||||||
|
call assert_equal("GĜĞĠĢǤǦǴḠ", toupper("GĜĞĠĢǤǦǴḠ"))
|
||||||
|
call assert_equal("HĤĦḢḦḨ", toupper("HĤĦḢḦḨ"))
|
||||||
|
call assert_equal("IÌÍÎÏĨĪĬĮİǏỈ", toupper("IÌÍÎÏĨĪĬĮİǏỈ"))
|
||||||
|
call assert_equal("JĴ", toupper("JĴ"))
|
||||||
|
call assert_equal("KĶǨḰḴ", toupper("KĶǨḰḴ"))
|
||||||
|
call assert_equal("LĹĻĽĿŁḺ", toupper("LĹĻĽĿŁḺ"))
|
||||||
|
call assert_equal("MḾṀ", toupper("MḾṀ"))
|
||||||
|
call assert_equal("NÑŃŅŇṄṈ", toupper("NÑŃŅŇṄṈ"))
|
||||||
|
call assert_equal("OÒÓÔÕÖØŌŎŐƠǑǪǬỎ", toupper("OÒÓÔÕÖØŌŎŐƠǑǪǬỎ"))
|
||||||
|
call assert_equal("PṔṖ", toupper("PṔṖ"))
|
||||||
|
call assert_equal("Q", toupper("Q"))
|
||||||
|
call assert_equal("RŔŖŘṘṞ", toupper("RŔŖŘṘṞ"))
|
||||||
|
call assert_equal("SŚŜŞŠṠ", toupper("SŚŜŞŠṠ"))
|
||||||
|
call assert_equal("TŢŤŦṪṮ", toupper("TŢŤŦṪṮ"))
|
||||||
|
call assert_equal("UÙÚÛÜŨŪŬŮŰŲƯǓỦ", toupper("UÙÚÛÜŨŪŬŮŰŲƯǓỦ"))
|
||||||
|
call assert_equal("VṼ", toupper("VṼ"))
|
||||||
|
call assert_equal("WŴẀẂẄẆ", toupper("WŴẀẂẄẆ"))
|
||||||
|
call assert_equal("XẊẌ", toupper("XẊẌ"))
|
||||||
|
call assert_equal("YÝŶŸẎỲỶỸ", toupper("YÝŶŸẎỲỶỸ"))
|
||||||
|
call assert_equal("ZŹŻŽƵẐẔ", toupper("ZŹŻŽƵẐẔ"))
|
||||||
|
|
||||||
|
call assert_equal("ⱥ ⱦ", tolower("Ⱥ Ⱦ"))
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,3 +24,47 @@ function! Test_Incr_Marks()
|
|||||||
call assert_equal("XXX 123 123", getline(3))
|
call assert_equal("XXX 123 123", getline(3))
|
||||||
enew!
|
enew!
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
func Test_setpos()
|
||||||
|
new one
|
||||||
|
let onebuf = bufnr('%')
|
||||||
|
let onewin = win_getid()
|
||||||
|
call setline(1, ['aaa', 'bbb', 'ccc'])
|
||||||
|
new two
|
||||||
|
let twobuf = bufnr('%')
|
||||||
|
let twowin = win_getid()
|
||||||
|
call setline(1, ['aaa', 'bbb', 'ccc'])
|
||||||
|
|
||||||
|
" for the cursor the buffer number is ignored
|
||||||
|
call setpos(".", [0, 2, 1, 0])
|
||||||
|
call assert_equal([0, 2, 1, 0], getpos("."))
|
||||||
|
call setpos(".", [onebuf, 3, 3, 0])
|
||||||
|
call assert_equal([0, 3, 3, 0], getpos("."))
|
||||||
|
|
||||||
|
call setpos("''", [0, 1, 3, 0])
|
||||||
|
call assert_equal([0, 1, 3, 0], getpos("''"))
|
||||||
|
call setpos("''", [onebuf, 2, 2, 0])
|
||||||
|
call assert_equal([0, 2, 2, 0], getpos("''"))
|
||||||
|
|
||||||
|
" buffer-local marks
|
||||||
|
for mark in ["'a", "'\"", "'[", "']", "'<", "'>"]
|
||||||
|
call win_gotoid(twowin)
|
||||||
|
call setpos(mark, [0, 2, 1, 0])
|
||||||
|
call assert_equal([0, 2, 1, 0], getpos(mark), "for mark " . mark)
|
||||||
|
call setpos(mark, [onebuf, 1, 3, 0])
|
||||||
|
call win_gotoid(onewin)
|
||||||
|
call assert_equal([0, 1, 3, 0], getpos(mark), "for mark " . mark)
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" global marks
|
||||||
|
call win_gotoid(twowin)
|
||||||
|
call setpos("'N", [0, 2, 1, 0])
|
||||||
|
call assert_equal([twobuf, 2, 1, 0], getpos("'N"))
|
||||||
|
call setpos("'N", [onebuf, 1, 3, 0])
|
||||||
|
call assert_equal([onebuf, 1, 3, 0], getpos("'N"))
|
||||||
|
|
||||||
|
call win_gotoid(onewin)
|
||||||
|
bwipe!
|
||||||
|
call win_gotoid(twowin)
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ func Test_mksession()
|
|||||||
\ 'a<> <20> two multiByte characters',
|
\ 'a<> <20> two multiByte characters',
|
||||||
\ 'A<><41><EFBFBD> three mulTibyte characters'
|
\ 'A<><41><EFBFBD> three mulTibyte characters'
|
||||||
\ ])
|
\ ])
|
||||||
let tmpfile = tempname()
|
let tmpfile = 'Xtemp'
|
||||||
exec 'w! ' . tmpfile
|
exec 'w! ' . tmpfile
|
||||||
/^start:
|
/^start:
|
||||||
set wrap
|
set wrap
|
||||||
@@ -63,8 +63,8 @@ func Test_mksession()
|
|||||||
norm! j016|3zl
|
norm! j016|3zl
|
||||||
split
|
split
|
||||||
call wincol()
|
call wincol()
|
||||||
mksession! test_mks.out
|
mksession! Xtest_mks.out
|
||||||
let li = filter(readfile('test_mks.out'), 'v:val =~# "\\(^ *normal! 0\\|^ *exe ''normal!\\)"')
|
let li = filter(readfile('Xtest_mks.out'), 'v:val =~# "\\(^ *normal! 0\\|^ *exe ''normal!\\)"')
|
||||||
let expected = [
|
let expected = [
|
||||||
\ 'normal! 016|',
|
\ 'normal! 016|',
|
||||||
\ 'normal! 016|',
|
\ 'normal! 016|',
|
||||||
@@ -96,9 +96,18 @@ func Test_mksession()
|
|||||||
call assert_equal(expected, li)
|
call assert_equal(expected, li)
|
||||||
tabclose!
|
tabclose!
|
||||||
|
|
||||||
call delete('test_mks.out')
|
call delete('Xtest_mks.out')
|
||||||
call delete(tmpfile)
|
call delete(tmpfile)
|
||||||
let &wrap = wrap_save
|
let &wrap = wrap_save
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_mksession_winheight()
|
||||||
|
new
|
||||||
|
set winheight=10 winminheight=2
|
||||||
|
mksession! Xtest_mks.out
|
||||||
|
source Xtest_mks.out
|
||||||
|
|
||||||
|
call delete('Xtest_mks.out')
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
|||||||
54
src/testdir/test_paste.vim
Normal file
54
src/testdir/test_paste.vim
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
" Tests for bracketed paste.
|
||||||
|
|
||||||
|
" Bracketed paste only works with "xterm". Not in GUI.
|
||||||
|
if has('gui_running')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
set term=xterm
|
||||||
|
|
||||||
|
func Test_paste_normal_mode()
|
||||||
|
new
|
||||||
|
call setline(1, ['a', 'b', 'c'])
|
||||||
|
2
|
||||||
|
call feedkeys("\<Esc>[200~foo\<CR>bar\<Esc>[201~", 'xt')
|
||||||
|
call assert_equal('bfoo', getline(2))
|
||||||
|
call assert_equal('bar', getline(3))
|
||||||
|
call assert_equal('c', getline(4))
|
||||||
|
|
||||||
|
normal .
|
||||||
|
call assert_equal('barfoo', getline(3))
|
||||||
|
call assert_equal('bar', getline(4))
|
||||||
|
call assert_equal('c', getline(5))
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_paste_insert_mode()
|
||||||
|
new
|
||||||
|
call setline(1, ['a', 'b', 'c'])
|
||||||
|
2
|
||||||
|
call feedkeys("i\<Esc>[200~foo\<CR>bar\<Esc>[201~ done\<Esc>", 'xt')
|
||||||
|
call assert_equal('foo', getline(2))
|
||||||
|
call assert_equal('bar doneb', getline(3))
|
||||||
|
call assert_equal('c', getline(4))
|
||||||
|
|
||||||
|
normal .
|
||||||
|
call assert_equal('bar donfoo', getline(3))
|
||||||
|
call assert_equal('bar doneeb', getline(4))
|
||||||
|
call assert_equal('c', getline(5))
|
||||||
|
|
||||||
|
set ai et tw=10
|
||||||
|
call setline(1, ['a', ' b', 'c'])
|
||||||
|
2
|
||||||
|
call feedkeys("A\<Esc>[200~foo\<CR> bar bar bar\<Esc>[201~\<Esc>", 'xt')
|
||||||
|
call assert_equal(' bfoo', getline(2))
|
||||||
|
call assert_equal(' bar bar bar', getline(3))
|
||||||
|
call assert_equal('c', getline(4))
|
||||||
|
|
||||||
|
set ai& et& tw=0
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_paste_cmdline()
|
||||||
|
call feedkeys(":a\<Esc>[200~foo\<CR>bar\<Esc>[201~b\<Home>\"\<CR>", 'xt')
|
||||||
|
call assert_equal("\"afoo\<CR>barb", getreg(':'))
|
||||||
|
endfunc
|
||||||
@@ -7,10 +7,10 @@ func! ListMonths()
|
|||||||
if g:setting != ''
|
if g:setting != ''
|
||||||
exe ":set" g:setting
|
exe ":set" g:setting
|
||||||
endif
|
endif
|
||||||
let mth=copy(g:months)
|
let mth = copy(g:months)
|
||||||
let entered = strcharpart(getline('.'),0,col('.'))
|
let entered = strcharpart(getline('.'),0,col('.'))
|
||||||
if !empty(entered)
|
if !empty(entered)
|
||||||
let mth=filter(mth, 'v:val=~"^".entered')
|
let mth = filter(mth, 'v:val=~"^".entered')
|
||||||
endif
|
endif
|
||||||
call complete(1, mth)
|
call complete(1, mth)
|
||||||
return ''
|
return ''
|
||||||
@@ -468,7 +468,7 @@ endfunc
|
|||||||
" auto-wrap text.
|
" auto-wrap text.
|
||||||
func Test_completion_ctrl_e_without_autowrap()
|
func Test_completion_ctrl_e_without_autowrap()
|
||||||
new
|
new
|
||||||
let tw_save=&tw
|
let tw_save = &tw
|
||||||
set tw=78
|
set tw=78
|
||||||
let li = [
|
let li = [
|
||||||
\ '" zzz',
|
\ '" zzz',
|
||||||
@@ -478,8 +478,37 @@ func Test_completion_ctrl_e_without_autowrap()
|
|||||||
call feedkeys("A\<C-X>\<C-N>\<C-E>\<Esc>", "tx")
|
call feedkeys("A\<C-X>\<C-N>\<C-E>\<Esc>", "tx")
|
||||||
call assert_equal(li, getline(1, '$'))
|
call assert_equal(li, getline(1, '$'))
|
||||||
|
|
||||||
let &tw=tw_save
|
let &tw = tw_save
|
||||||
q!
|
q!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
function! DummyCompleteSix()
|
||||||
|
call complete(1, ['Hello', 'World'])
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" complete() correctly clears the list of autocomplete candidates
|
||||||
|
" See #1411
|
||||||
|
func Test_completion_clear_candidate_list()
|
||||||
|
new
|
||||||
|
%d
|
||||||
|
" select first entry from the completion popup
|
||||||
|
call feedkeys("a xxx\<C-N>\<C-R>=DummyCompleteSix()\<CR>", "tx")
|
||||||
|
call assert_equal('Hello', getline(1))
|
||||||
|
%d
|
||||||
|
" select second entry from the completion popup
|
||||||
|
call feedkeys("a xxx\<C-N>\<C-R>=DummyCompleteSix()\<CR>\<C-N>", "tx")
|
||||||
|
call assert_equal('World', getline(1))
|
||||||
|
%d
|
||||||
|
" select original text
|
||||||
|
call feedkeys("a xxx\<C-N>\<C-R>=DummyCompleteSix()\<CR>\<C-N>\<C-N>", "tx")
|
||||||
|
call assert_equal(' xxx', getline(1))
|
||||||
|
%d
|
||||||
|
" back at first entry from completion list
|
||||||
|
call feedkeys("a xxx\<C-N>\<C-R>=DummyCompleteSix()\<CR>\<C-N>\<C-N>\<C-N>", "tx")
|
||||||
|
call assert_equal('Hello', getline(1))
|
||||||
|
|
||||||
|
bw!
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
|||||||
@@ -21,3 +21,16 @@ func Test_put_char_block()
|
|||||||
call assert_equal(['Xfile_put 1', 'Xfile_put 2'], getline(1,2))
|
call assert_equal(['Xfile_put 1', 'Xfile_put 2'], getline(1,2))
|
||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_put_char_block2()
|
||||||
|
new
|
||||||
|
let a = [ getreg('a'), getregtype('a') ]
|
||||||
|
call setreg('a', ' one ', 'v')
|
||||||
|
call setline(1, ['Line 1', '', 'Line 3', ''])
|
||||||
|
" visually select the first 3 lines and put register a over it
|
||||||
|
exe "norm! ggl\<c-v>2j2l\"ap"
|
||||||
|
call assert_equal(['L one 1', '', 'L one 3', ''], getline(1,4))
|
||||||
|
" clean up
|
||||||
|
bw!
|
||||||
|
call setreg('a', a[0], a[1])
|
||||||
|
endfunc
|
||||||
|
|||||||
74
src/testdir/test_pyx2.vim
Normal file
74
src/testdir/test_pyx2.vim
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
" Test for pyx* commands and functions with Python 2.
|
||||||
|
|
||||||
|
set pyx=2
|
||||||
|
if !has('python')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:py2pattern = '^2\.[0-7]\.\d\+'
|
||||||
|
let s:py3pattern = '^3\.\d\+\.\d\+'
|
||||||
|
|
||||||
|
|
||||||
|
func Test_has_pythonx()
|
||||||
|
call assert_true(has('pythonx'))
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
|
func Test_pyx()
|
||||||
|
redir => var
|
||||||
|
pyx << EOF
|
||||||
|
import sys
|
||||||
|
print(sys.version)
|
||||||
|
EOF
|
||||||
|
redir END
|
||||||
|
call assert_match(s:py2pattern, split(var)[0])
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
|
func Test_pyxdo()
|
||||||
|
pyx import sys
|
||||||
|
enew
|
||||||
|
pyxdo return sys.version.split("\n")[0]
|
||||||
|
call assert_match(s:py2pattern, split(getline('.'))[0])
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
|
func Test_pyxeval()
|
||||||
|
pyx import sys
|
||||||
|
call assert_match(s:py2pattern, split(pyxeval('sys.version'))[0])
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
|
func Test_pyxfile()
|
||||||
|
" No special comments nor shebangs
|
||||||
|
redir => var
|
||||||
|
pyxfile pyxfile/pyx.py
|
||||||
|
redir END
|
||||||
|
call assert_match(s:py2pattern, split(var)[0])
|
||||||
|
|
||||||
|
" Python 2 special comment
|
||||||
|
redir => var
|
||||||
|
pyxfile pyxfile/py2_magic.py
|
||||||
|
redir END
|
||||||
|
call assert_match(s:py2pattern, split(var)[0])
|
||||||
|
|
||||||
|
" Python 2 shebang
|
||||||
|
redir => var
|
||||||
|
pyxfile pyxfile/py2_shebang.py
|
||||||
|
redir END
|
||||||
|
call assert_match(s:py2pattern, split(var)[0])
|
||||||
|
|
||||||
|
if has('python3')
|
||||||
|
" Python 3 special comment
|
||||||
|
redir => var
|
||||||
|
pyxfile pyxfile/py3_magic.py
|
||||||
|
redir END
|
||||||
|
call assert_match(s:py3pattern, split(var)[0])
|
||||||
|
|
||||||
|
" Python 3 shebang
|
||||||
|
redir => var
|
||||||
|
pyxfile pyxfile/py3_shebang.py
|
||||||
|
redir END
|
||||||
|
call assert_match(s:py3pattern, split(var)[0])
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
74
src/testdir/test_pyx3.vim
Normal file
74
src/testdir/test_pyx3.vim
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
" Test for pyx* commands and functions with Python 3.
|
||||||
|
|
||||||
|
set pyx=3
|
||||||
|
if !has('python3')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:py2pattern = '^2\.[0-7]\.\d\+'
|
||||||
|
let s:py3pattern = '^3\.\d\+\.\d\+'
|
||||||
|
|
||||||
|
|
||||||
|
func Test_has_pythonx()
|
||||||
|
call assert_true(has('pythonx'))
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
|
func Test_pyx()
|
||||||
|
redir => var
|
||||||
|
pyx << EOF
|
||||||
|
import sys
|
||||||
|
print(sys.version)
|
||||||
|
EOF
|
||||||
|
redir END
|
||||||
|
call assert_match(s:py3pattern, split(var)[0])
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
|
func Test_pyxdo()
|
||||||
|
pyx import sys
|
||||||
|
enew
|
||||||
|
pyxdo return sys.version.split("\n")[0]
|
||||||
|
call assert_match(s:py3pattern, split(getline('.'))[0])
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
|
func Test_pyxeval()
|
||||||
|
pyx import sys
|
||||||
|
call assert_match(s:py3pattern, split(pyxeval('sys.version'))[0])
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
|
func Test_pyxfile()
|
||||||
|
" No special comments nor shebangs
|
||||||
|
redir => var
|
||||||
|
pyxfile pyxfile/pyx.py
|
||||||
|
redir END
|
||||||
|
call assert_match(s:py3pattern, split(var)[0])
|
||||||
|
|
||||||
|
" Python 3 special comment
|
||||||
|
redir => var
|
||||||
|
pyxfile pyxfile/py3_magic.py
|
||||||
|
redir END
|
||||||
|
call assert_match(s:py3pattern, split(var)[0])
|
||||||
|
|
||||||
|
" Python 3 shebang
|
||||||
|
redir => var
|
||||||
|
pyxfile pyxfile/py3_shebang.py
|
||||||
|
redir END
|
||||||
|
call assert_match(s:py3pattern, split(var)[0])
|
||||||
|
|
||||||
|
if has('python')
|
||||||
|
" Python 2 special comment
|
||||||
|
redir => var
|
||||||
|
pyxfile pyxfile/py2_magic.py
|
||||||
|
redir END
|
||||||
|
call assert_match(s:py2pattern, split(var)[0])
|
||||||
|
|
||||||
|
" Python 2 shebang
|
||||||
|
redir => var
|
||||||
|
pyxfile pyxfile/py2_shebang.py
|
||||||
|
redir END
|
||||||
|
call assert_match(s:py2pattern, split(var)[0])
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
@@ -102,3 +102,107 @@ func Test_CmdUndefined()
|
|||||||
call assert_fails('Dothat', 'E492:')
|
call assert_fails('Dothat', 'E492:')
|
||||||
call assert_equal('yes', g:didnot)
|
call assert_equal('yes', g:didnot)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_CmdErrors()
|
||||||
|
call assert_fails('com! docmd :', 'E183:')
|
||||||
|
call assert_fails('com! \<Tab> :', 'E182:')
|
||||||
|
call assert_fails('com! _ :', 'E182:')
|
||||||
|
call assert_fails('com! X :', 'E841:')
|
||||||
|
call assert_fails('com! - DoCmd :', 'E175:')
|
||||||
|
call assert_fails('com! -xxx DoCmd :', 'E181:')
|
||||||
|
call assert_fails('com! -addr DoCmd :', 'E179:')
|
||||||
|
call assert_fails('com! -complete DoCmd :', 'E179:')
|
||||||
|
call assert_fails('com! -complete=xxx DoCmd :', 'E180:')
|
||||||
|
call assert_fails('com! -complete=custom DoCmd :', 'E467:')
|
||||||
|
call assert_fails('com! -complete=customlist DoCmd :', 'E467:')
|
||||||
|
call assert_fails('com! -complete=behave,CustomComplete DoCmd :', 'E468:')
|
||||||
|
call assert_fails('com! -nargs=x DoCmd :', 'E176:')
|
||||||
|
call assert_fails('com! -count=1 -count=2 DoCmd :', 'E177:')
|
||||||
|
call assert_fails('com! -count=x DoCmd :', 'E178:')
|
||||||
|
call assert_fails('com! -range=x DoCmd :', 'E178:')
|
||||||
|
|
||||||
|
com! -nargs=0 DoCmd :
|
||||||
|
call assert_fails('DoCmd x', 'E488:')
|
||||||
|
|
||||||
|
com! -nargs=1 DoCmd :
|
||||||
|
call assert_fails('DoCmd', 'E471:')
|
||||||
|
|
||||||
|
com! -nargs=+ DoCmd :
|
||||||
|
call assert_fails('DoCmd', 'E471:')
|
||||||
|
|
||||||
|
call assert_fails('com DoCmd :', 'E174:')
|
||||||
|
comclear
|
||||||
|
call assert_fails('delcom DoCmd', 'E184:')
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func CustomComplete(A, L, P)
|
||||||
|
return "January\nFebruary\nMars\n"
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func CustomCompleteList(A, L, P)
|
||||||
|
return [ "Monday", "Tuesday", "Wednesday" ]
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_CmdCompletion()
|
||||||
|
call feedkeys(":com -\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
call assert_equal('"com -addr bang bar buffer complete count nargs range register', @:)
|
||||||
|
|
||||||
|
call feedkeys(":com -nargs=0 -\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
call assert_equal('"com -nargs=0 -addr bang bar buffer complete count nargs range register', @:)
|
||||||
|
|
||||||
|
call feedkeys(":com -nargs=\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
call assert_equal('"com -nargs=* + 0 1 ?', @:)
|
||||||
|
|
||||||
|
call feedkeys(":com -addr=\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
call assert_equal('"com -addr=arguments buffers lines loaded_buffers quickfix tabs windows', @:)
|
||||||
|
|
||||||
|
call feedkeys(":com -complete=co\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
call assert_equal('"com -complete=color command compiler', @:)
|
||||||
|
|
||||||
|
command! DoCmd1 :
|
||||||
|
command! DoCmd2 :
|
||||||
|
call feedkeys(":com \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
call assert_equal('"com DoCmd1 DoCmd2', @:)
|
||||||
|
|
||||||
|
call feedkeys(":DoC\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
call assert_equal('"DoCmd1 DoCmd2', @:)
|
||||||
|
|
||||||
|
call feedkeys(":delcom DoC\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
call assert_equal('"delcom DoCmd1 DoCmd2', @:)
|
||||||
|
|
||||||
|
delcom DoCmd1
|
||||||
|
call feedkeys(":delcom DoC\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
call assert_equal('"delcom DoCmd2', @:)
|
||||||
|
|
||||||
|
call feedkeys(":com DoC\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
call assert_equal('"com DoCmd2', @:)
|
||||||
|
|
||||||
|
delcom DoCmd2
|
||||||
|
call feedkeys(":delcom DoC\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
call assert_equal('"delcom DoC', @:)
|
||||||
|
|
||||||
|
call feedkeys(":com DoC\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
call assert_equal('"com DoC', @:)
|
||||||
|
|
||||||
|
com! -complete=behave DoCmd :
|
||||||
|
call feedkeys(":DoCmd \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
call assert_equal('"DoCmd mswin xterm', @:)
|
||||||
|
|
||||||
|
" This does not work. Why?
|
||||||
|
"call feedkeys(":DoCmd x\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
"call assert_equal('"DoCmd xterm', @:)
|
||||||
|
|
||||||
|
com! -complete=custom,CustomComplete DoCmd :
|
||||||
|
call feedkeys(":DoCmd \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
call assert_equal('"DoCmd January February Mars', @:)
|
||||||
|
|
||||||
|
com! -complete=customlist,CustomCompleteList DoCmd :
|
||||||
|
call feedkeys(":DoCmd \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
call assert_equal('"DoCmd Monday Tuesday Wednesday', @:)
|
||||||
|
|
||||||
|
com! -complete=custom,CustomCompleteList DoCmd :
|
||||||
|
call assert_fails("call feedkeys(':DoCmd \<C-D>', 'tx')", 'E730:')
|
||||||
|
|
||||||
|
com! -complete=customlist,CustomComp DoCmd :
|
||||||
|
call assert_fails("call feedkeys(':DoCmd \<C-D>', 'tx')", 'E117:')
|
||||||
|
endfunc
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
Tests for Unicode manipulations vim: set ft=vim :
|
|
||||||
|
|
||||||
STARTTEST
|
|
||||||
:so small.vim
|
|
||||||
:set encoding=utf-8
|
|
||||||
:"
|
|
||||||
:" Visual block Insert adjusts for multi-byte char
|
|
||||||
:new
|
|
||||||
:call setline(1, ["aaa", "あああ", "bbb"])
|
|
||||||
:exe ":norm! gg0l\<C-V>jjIx\<Esc>"
|
|
||||||
:let r = getline(1, '$')
|
|
||||||
:"
|
|
||||||
:bwipeout!
|
|
||||||
:$put=r
|
|
||||||
:"
|
|
||||||
:" Test for built-in function strchars()
|
|
||||||
:for str in ["a", "あいa", "A\u20dd", "A\u20dd\u20dd", "\u20dd"]
|
|
||||||
: $put=strchars(str)
|
|
||||||
: $put=strchars(str, 0)
|
|
||||||
: $put=strchars(str, 1)
|
|
||||||
:endfor
|
|
||||||
:"
|
|
||||||
:" Test for customlist completion
|
|
||||||
:function! CustomComplete1(lead, line, pos)
|
|
||||||
: return ['あ', 'い']
|
|
||||||
:endfunction
|
|
||||||
:command -nargs=1 -complete=customlist,CustomComplete1 Test1 echo
|
|
||||||
:call feedkeys(":Test1 \<C-L>'\<C-B>$put='\<CR>", 'it')
|
|
||||||
:"
|
|
||||||
:function! CustomComplete2(lead, line, pos)
|
|
||||||
: return ['あたし', 'あたま', 'あたりめ']
|
|
||||||
:endfunction
|
|
||||||
:command -nargs=1 -complete=customlist,CustomComplete2 Test2 echo
|
|
||||||
:call feedkeys(":Test2 \<C-L>'\<C-B>$put='\<CR>", 'it')
|
|
||||||
:"
|
|
||||||
:function! CustomComplete3(lead, line, pos)
|
|
||||||
: return ['Nこ', 'Nん', 'Nぶ']
|
|
||||||
:endfunction
|
|
||||||
:command -nargs=1 -complete=customlist,CustomComplete3 Test3 echo
|
|
||||||
:call feedkeys(":Test3 \<C-L>'\<C-B>$put='\<CR>", 'it')
|
|
||||||
:"
|
|
||||||
:call garbagecollect(1)
|
|
||||||
:/^start:/,$wq! test.out
|
|
||||||
ENDTEST
|
|
||||||
|
|
||||||
start:
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
start:
|
|
||||||
axaa
|
|
||||||
xあああ
|
|
||||||
bxbb
|
|
||||||
1
|
|
||||||
1
|
|
||||||
1
|
|
||||||
3
|
|
||||||
3
|
|
||||||
3
|
|
||||||
2
|
|
||||||
2
|
|
||||||
1
|
|
||||||
3
|
|
||||||
3
|
|
||||||
1
|
|
||||||
1
|
|
||||||
1
|
|
||||||
1
|
|
||||||
Test1
|
|
||||||
Test2 あた
|
|
||||||
Test3 N
|
|
||||||
65
src/testdir/test_utf8.vim
Normal file
65
src/testdir/test_utf8.vim
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
" Tests for Unicode manipulations
|
||||||
|
if !has('multi_byte')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
" Visual block Insert adjusts for multi-byte char
|
||||||
|
func Test_visual_block_insert()
|
||||||
|
new
|
||||||
|
call setline(1, ["aaa", "あああ", "bbb"])
|
||||||
|
exe ":norm! gg0l\<C-V>jjIx\<Esc>"
|
||||||
|
call assert_equal(['axaa', 'xあああ', 'bxbb'], getline(1, '$'))
|
||||||
|
bwipeout!
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
" Test for built-in function strchars()
|
||||||
|
func Test_strchars()
|
||||||
|
let inp = ["a", "あいa", "A\u20dd", "A\u20dd\u20dd", "\u20dd"]
|
||||||
|
let exp = [[1, 1, 1], [3, 3, 3], [2, 2, 1], [3, 3, 1], [1, 1, 1]]
|
||||||
|
for i in range(len(inp))
|
||||||
|
call assert_equal(exp[i][0], strchars(inp[i]))
|
||||||
|
call assert_equal(exp[i][1], strchars(inp[i], 0))
|
||||||
|
call assert_equal(exp[i][2], strchars(inp[i], 1))
|
||||||
|
endfor
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
" Test for customlist completion
|
||||||
|
function! CustomComplete1(lead, line, pos)
|
||||||
|
return ['あ', 'い']
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! CustomComplete2(lead, line, pos)
|
||||||
|
return ['あたし', 'あたま', 'あたりめ']
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! CustomComplete3(lead, line, pos)
|
||||||
|
return ['Nこ', 'Nん', 'Nぶ']
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
func Test_customlist_completion()
|
||||||
|
command -nargs=1 -complete=customlist,CustomComplete1 Test1 echo
|
||||||
|
call feedkeys(":Test1 \<C-L>\<C-B>\"\<CR>", 'itx')
|
||||||
|
call assert_equal('"Test1 ', getreg(':'))
|
||||||
|
|
||||||
|
command -nargs=1 -complete=customlist,CustomComplete2 Test2 echo
|
||||||
|
call feedkeys(":Test2 \<C-L>\<C-B>\"\<CR>", 'itx')
|
||||||
|
call assert_equal('"Test2 あた', getreg(':'))
|
||||||
|
|
||||||
|
command -nargs=1 -complete=customlist,CustomComplete3 Test3 echo
|
||||||
|
call feedkeys(":Test3 \<C-L>\<C-B>\"\<CR>", 'itx')
|
||||||
|
call assert_equal('"Test3 N', getreg(':'))
|
||||||
|
|
||||||
|
call garbagecollect(1)
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
" Yank one 3 byte character and check the mark columns.
|
||||||
|
func Test_getvcol()
|
||||||
|
new
|
||||||
|
call setline(1, "x\u2500x")
|
||||||
|
normal 0lvy
|
||||||
|
call assert_equal(2, col("'["))
|
||||||
|
call assert_equal(4, col("']"))
|
||||||
|
call assert_equal(2, virtcol("'["))
|
||||||
|
call assert_equal(2, virtcol("']"))
|
||||||
|
endfunc
|
||||||
@@ -2102,7 +2102,9 @@ ex_function(exarg_T *eap)
|
|||||||
arg = skipwhite(skiptowhite(p));
|
arg = skipwhite(skiptowhite(p));
|
||||||
if (arg[0] == '<' && arg[1] =='<'
|
if (arg[0] == '<' && arg[1] =='<'
|
||||||
&& ((p[0] == 'p' && p[1] == 'y'
|
&& ((p[0] == 'p' && p[1] == 'y'
|
||||||
&& (!ASCII_ISALPHA(p[2]) || p[2] == 't'))
|
&& (!ASCII_ISALNUM(p[2]) || p[2] == 't'
|
||||||
|
|| ((p[2] == '3' || p[2] == 'x')
|
||||||
|
&& !ASCII_ISALPHA(p[3]))))
|
||||||
|| (p[0] == 'p' && p[1] == 'e'
|
|| (p[0] == 'p' && p[1] == 'e'
|
||||||
&& (!ASCII_ISALPHA(p[2]) || p[2] == 'r'))
|
&& (!ASCII_ISALPHA(p[2]) || p[2] == 'r'))
|
||||||
|| (p[0] == 't' && p[1] == 'c'
|
|| (p[0] == 't' && p[1] == 'c'
|
||||||
|
|||||||
@@ -764,6 +764,64 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
258,
|
||||||
|
/**/
|
||||||
|
257,
|
||||||
|
/**/
|
||||||
|
256,
|
||||||
|
/**/
|
||||||
|
255,
|
||||||
|
/**/
|
||||||
|
254,
|
||||||
|
/**/
|
||||||
|
253,
|
||||||
|
/**/
|
||||||
|
252,
|
||||||
|
/**/
|
||||||
|
251,
|
||||||
|
/**/
|
||||||
|
250,
|
||||||
|
/**/
|
||||||
|
249,
|
||||||
|
/**/
|
||||||
|
248,
|
||||||
|
/**/
|
||||||
|
247,
|
||||||
|
/**/
|
||||||
|
246,
|
||||||
|
/**/
|
||||||
|
245,
|
||||||
|
/**/
|
||||||
|
244,
|
||||||
|
/**/
|
||||||
|
243,
|
||||||
|
/**/
|
||||||
|
242,
|
||||||
|
/**/
|
||||||
|
241,
|
||||||
|
/**/
|
||||||
|
240,
|
||||||
|
/**/
|
||||||
|
239,
|
||||||
|
/**/
|
||||||
|
238,
|
||||||
|
/**/
|
||||||
|
237,
|
||||||
|
/**/
|
||||||
|
236,
|
||||||
|
/**/
|
||||||
|
235,
|
||||||
|
/**/
|
||||||
|
234,
|
||||||
|
/**/
|
||||||
|
233,
|
||||||
|
/**/
|
||||||
|
232,
|
||||||
|
/**/
|
||||||
|
231,
|
||||||
|
/**/
|
||||||
|
230,
|
||||||
/**/
|
/**/
|
||||||
229,
|
229,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
11
src/vim.h
11
src/vim.h
@@ -1714,15 +1714,8 @@ typedef unsigned short disptick_T; /* display tick type */
|
|||||||
|
|
||||||
typedef void *vim_acl_T; /* dummy to pass an ACL to a function */
|
typedef void *vim_acl_T; /* dummy to pass an ACL to a function */
|
||||||
|
|
||||||
/*
|
#ifndef mch_memmove
|
||||||
* Include a prototype for mch_memmove(), it may not be in alloc.pro.
|
# define mch_memmove(to, from, len) memmove((char*)(to), (char*)(from), (size_t)(len))
|
||||||
*/
|
|
||||||
#ifdef VIM_MEMMOVE
|
|
||||||
void mch_memmove(void *, void *, size_t);
|
|
||||||
#else
|
|
||||||
# ifndef mch_memmove
|
|
||||||
# define mch_memmove(to, from, len) memmove(to, from, len)
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user