mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-02 11:19:22 +02:00
Compare commits
153 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 67c67d1bd2 | |||
| 54e5082d7c | |||
| 03ff9bcbc9 | |||
| fd8983b09c | |||
| 7a073549a3 | |||
| 79da563cf9 | |||
| e5f2a075e3 | |||
| a2f28859bf | |||
| 23fa81d222 | |||
| 04e87b72c5 | |||
| 21d7c9b601 | |||
| 4e032e1b17 | |||
| c7d9eacefa | |||
| 88f75a70df | |||
| ed465e81f9 | |||
| 648ec8d5f2 | |||
| c10f0e7cb0 | |||
| c386267ffe | |||
| b245559fa9 | |||
| e90858d022 | |||
| b9818a953c | |||
| a8c5796d0d | |||
| 0b5c93a7f2 | |||
| 1266d678bf | |||
| 7c23d1d9d9 | |||
| 168dd00f72 | |||
| f1ab9c1370 | |||
| 56e6bd7ba2 | |||
| 3954e3c4b5 | |||
| e3caa11090 | |||
| 070b33da93 | |||
| 3df2134ed1 | |||
| c4a249a736 | |||
| 432c839ebd | |||
| f0b4353248 | |||
| a311d0da6f | |||
| a4c906a4a1 | |||
| c593fee0e5 | |||
| 85b5743d3e | |||
| d58f03b1c2 | |||
| 6fe2eb43d2 | |||
| c625155ea4 | |||
| a58883b4ea | |||
| d297f35eb0 | |||
| 80627cf51f | |||
| ddf662a1c8 | |||
| 24c2e48ef8 | |||
| dea2570740 | |||
| 2f72c70657 | |||
| c9b56b2ceb | |||
| 7b046c06fa | |||
| e0b66da691 | |||
| 690afe1fef | |||
| 3a29abcb61 | |||
| f13e00b2cf | |||
| c7b831ca15 | |||
| 36ae89c550 | |||
| 4019cf90b8 | |||
| f42dd3c390 | |||
| 0c0590d982 | |||
| 4bc2f2e9fd | |||
| 45600ce8f2 | |||
| aed6d0b81a | |||
| 3a118be150 | |||
| 16038d50c4 | |||
| d9c60648e5 | |||
| 8a17c52926 | |||
| cc5b22b3bf | |||
| 65c836e600 | |||
| 52c0de1de1 | |||
| 4f7090b93d | |||
| 1e07633a5d | |||
| a27eb06c50 | |||
| 9e817c8a31 | |||
| 4cefe0c276 | |||
| 97ed4ba2f8 | |||
| ba47b51ff8 | |||
| 6a717f17ec | |||
| b031c4ea04 | |||
| 941c12da3c | |||
| bff6ad1331 | |||
| 48c9f3b123 | |||
| 076e502199 | |||
| 915350edec | |||
| 24a2d416ec | |||
| e80371bfbb | |||
| 43ac38d613 | |||
| abbc448bc0 | |||
| 2aa5f696b9 | |||
| 1695f99d08 | |||
| 9957a10d0f | |||
| 7a2699e868 | |||
| fffbf308dd | |||
| 831e48f10b | |||
| e091a4b25c | |||
| c81299684b | |||
| 6a8ede99dd | |||
| 15eedf1d62 | |||
| 7a40ea2138 | |||
| 2b2207ba69 | |||
| e2d74dbe19 | |||
| e2c6037da3 | |||
| e362c3d2c3 | |||
| d7a96151e0 | |||
| ca24e2cfcf | |||
| 423977d3ce | |||
| 88c8df3f81 | |||
| 560379d7ae | |||
| 33ed6029da | |||
| ec2da36ca4 | |||
| 41baa7983a | |||
| bf5eddebf1 | |||
| 25b0e6b701 | |||
| 23c9e8b3bc | |||
| a5f2cc0333 | |||
| 8822744b4d | |||
| 5e4e1b1299 | |||
| eb46f8fa14 | |||
| 6e78e27b8a | |||
| 4007ed4a5e | |||
| d61e8aaae5 | |||
| 58f60ca2fc | |||
| 6d721c7e10 | |||
| de318c5c35 | |||
| 369b6f57c4 | |||
| 97d62d4321 | |||
| c011a3d083 | |||
| a9d23c2087 | |||
| e32bbded64 | |||
| 1b9750d805 | |||
| 42b8d916c7 | |||
| 4f391796b7 | |||
| 810f9c361c | |||
| 296b1f28ca | |||
| 9506cad7a1 | |||
| d5069d644e | |||
| fe6ce331d9 | |||
| 5869cf060e | |||
| fad609d067 | |||
| 2b7bc567b9 | |||
| 7173b47958 | |||
| e47683a091 | |||
| 519d7785f4 | |||
| 83381f7129 | |||
| 9be7c04e6c | |||
| 40bc4e9b8d | |||
| 9b73c4a215 | |||
| e13b9afe12 | |||
| 0bdef250b2 | |||
| 70bcd7336f | |||
| 972c3b8f1b | |||
| b8f7bd68f6 | |||
| a1fa892939 |
@@ -81,6 +81,7 @@ src/testdir/viminfo
|
||||
src/memfile_test
|
||||
src/json_test
|
||||
src/message_test
|
||||
src/kword_test
|
||||
|
||||
# From MacVim
|
||||
.*.swp
|
||||
|
||||
@@ -45,6 +45,7 @@ SRC_ALL = \
|
||||
src/hashtab.c \
|
||||
src/json.c \
|
||||
src/json_test.c \
|
||||
src/kword_test.c \
|
||||
src/list.c \
|
||||
src/keymap.h \
|
||||
src/macros.h \
|
||||
@@ -122,6 +123,7 @@ SRC_ALL = \
|
||||
src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py \
|
||||
src/testdir/python_after/*.py \
|
||||
src/testdir/python_before/*.py \
|
||||
src/testdir/pyxfile/*.py \
|
||||
src/testdir/bench*.in \
|
||||
src/testdir/bench*.vim \
|
||||
src/testdir/samples/*.txt \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 8.0. Last change: 2016 Sep 27
|
||||
*autocmd.txt* For Vim version 8.0. Last change: 2017 Jan 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -33,7 +33,7 @@ files matching *.c. You can also use autocommands to implement advanced
|
||||
features, such as editing compressed files (see |gzip-example|). The usual
|
||||
place to put autocommands is in your .vimrc or .exrc file.
|
||||
|
||||
*E203* *E204* *E143* *E855*
|
||||
*E203* *E204* *E143* *E855* *E937*
|
||||
WARNING: Using autocommands is very powerful, and may lead to unexpected side
|
||||
effects. Be careful not to destroy your text.
|
||||
- It's a good idea to do some testing on an expendable copy of a file first.
|
||||
|
||||
+43
-18
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Jan 08
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -2222,8 +2222,8 @@ matchstr({expr}, {pat}[, {start}[, {count}]])
|
||||
String {count}'th match of {pat} in {expr}
|
||||
matchstrpos({expr}, {pat}[, {start}[, {count}]])
|
||||
List {count}'th match of {pat} in {expr}
|
||||
max({list}) Number maximum value of items in {list}
|
||||
min({list}) Number minimum value of items in {list}
|
||||
max({expr}) Number maximum value of items in {expr}
|
||||
min({expr}) Number minimum value of items in {expr}
|
||||
mkdir({name} [, {path} [, {prot}]])
|
||||
Number create directory {name}
|
||||
mode([expr]) String current editing mode
|
||||
@@ -2239,6 +2239,7 @@ printf({fmt}, {expr1}...) String format text
|
||||
pumvisible() Number whether popup menu is visible
|
||||
pyeval({expr}) any evaluate |Python| expression
|
||||
py3eval({expr}) any evaluate |python3| expression
|
||||
pyxeval({expr}) any evaluate |python_x| expression
|
||||
range({expr} [, {max} [, {stride}]])
|
||||
List items from {expr} to {max}
|
||||
readfile({fname} [, {binary} [, {max}]])
|
||||
@@ -4171,6 +4172,10 @@ getchar([expr]) *getchar()*
|
||||
exe "normal " . v:mouse_col . "|"
|
||||
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
|
||||
user that a character has to be typed.
|
||||
There is no mapping for the character.
|
||||
@@ -5256,6 +5261,7 @@ json_decode({string}) *json_decode()*
|
||||
- A trailing comma in an array and object is ignored.
|
||||
- More floating point numbers are recognized, e.g. "1." for
|
||||
"1.0".
|
||||
However, a duplicate key in an object is not allowed. *E938*
|
||||
The result must be a valid Vim type:
|
||||
- An empty object member name is not allowed.
|
||||
- Duplicate object member names are not allowed.
|
||||
@@ -5795,16 +5801,20 @@ matchstrpos({expr}, {pat}[, {start}[, {count}]]) *matchstrpos()*
|
||||
The type isn't changed, it's not necessarily a String.
|
||||
|
||||
*max()*
|
||||
max({list}) Return the maximum value of all items in {list}.
|
||||
If {list} is not a list or one of the items in {list} cannot
|
||||
be used as a Number this results in an error.
|
||||
An empty |List| results in zero.
|
||||
max({expr}) Return the maximum value of all items in {expr}.
|
||||
{expr} can be a list or a dictionary. For a dictionary,
|
||||
it returns the maximum of all values in the dictionary.
|
||||
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({list}) Return the minimum value of all items in {list}.
|
||||
If {list} is not a list or one of the items in {list} cannot
|
||||
be used as a Number this results in an error.
|
||||
An empty |List| results in zero.
|
||||
min({expr}) Return the minimum value of all items in {expr}.
|
||||
{expr} can be a list or a dictionary. For a dictionary,
|
||||
it returns the minimum of all values in the dictionary.
|
||||
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({name} [, {path} [, {prot}]])
|
||||
@@ -5838,9 +5848,13 @@ mode([expr]) Return a string that indicates the current mode.
|
||||
S Select by line
|
||||
CTRL-S Select blockwise
|
||||
i Insert
|
||||
ic Insert mode completion |compl-generic|
|
||||
ix Insert mode |i_CTRL-X| completion
|
||||
R Replace |R|
|
||||
Rc Replace mode completion |compl-generic|
|
||||
Rv Virtual Replace |gR|
|
||||
c Command-line
|
||||
Rx Replace mode |i_CTRL-X| completion
|
||||
c Command-line editing
|
||||
cv Vim Ex mode |gQ|
|
||||
ce Normal Ex mode |Q|
|
||||
r Hit-enter prompt
|
||||
@@ -6162,6 +6176,14 @@ pyeval({expr}) *pyeval()*
|
||||
non-string keys result in error.
|
||||
{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*
|
||||
range({expr} [, {max} [, {stride}]]) *range()*
|
||||
Returns a |List| with Numbers:
|
||||
@@ -6788,10 +6810,12 @@ setpos({expr}, {list})
|
||||
[bufnum, lnum, col, off, curswant]
|
||||
|
||||
"bufnum" is the buffer number. Zero can be used for the
|
||||
current buffer. Setting the cursor is only possible for
|
||||
the current buffer. To set a mark in another buffer you can
|
||||
use the |bufnr()| function to turn a file name into a buffer
|
||||
number.
|
||||
current buffer. When setting an uppercase mark "bufnum" is
|
||||
used for the mark position. For other marks it specifies the
|
||||
buffer to set the mark in. You can use the |bufnr()| function
|
||||
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.
|
||||
|
||||
"lnum" and "col" are the position in the buffer. The first
|
||||
@@ -7249,7 +7273,7 @@ strcharpart({src}, {start}[, {len}]) *strcharpart()*
|
||||
Like |strpart()| but using character index and length instead
|
||||
of byte index and length.
|
||||
When a character index is used where a character does not
|
||||
exist it is assumed to be one byte. For example: >
|
||||
exist it is assumed to be one character. For example: >
|
||||
strcharpart('abc', -1, 2)
|
||||
< results in 'a'.
|
||||
|
||||
@@ -8134,7 +8158,7 @@ winnr([{arg}]) The result is a Number, which is the number of the current
|
||||
is returned.
|
||||
The number can be used with |CTRL-W_w| and ":wincmd w"
|
||||
|:wincmd|.
|
||||
Also see |tabpagewinnr()|.
|
||||
Also see |tabpagewinnr()| and |win_getid()|.
|
||||
|
||||
*winrestcmd()*
|
||||
winrestcmd() Returns a sequence of |:resize| commands that should restore
|
||||
@@ -8404,6 +8428,7 @@ printer Compiled with |:hardcopy| support.
|
||||
profile Compiled with |:profile| support.
|
||||
python Compiled with Python 2.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.
|
||||
quickfix Compiled with |quickfix| support.
|
||||
reltime Compiled with |reltime()| support.
|
||||
|
||||
+67
-1
@@ -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
|
||||
@@ -16,6 +16,7 @@ The Python Interface to Vim *python* *Python*
|
||||
8. pyeval(), py3eval() Vim functions |python-pyeval|
|
||||
9. Dynamic loading |python-dynamic|
|
||||
10. Python 3 |python3|
|
||||
11. Python X |python_x|
|
||||
|
||||
{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()|
|
||||
functions to evaluate Python expressions and pass their values to VimL.
|
||||
|pyxeval()| is also available.
|
||||
|
||||
==============================================================================
|
||||
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
|
||||
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:
|
||||
|
||||
@@ -1442,6 +1442,10 @@ tag command action ~
|
||||
|:python| :py[thon] execute Python command
|
||||
|:pydo| :pyd[o] execute Python command for each line
|
||||
|: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)
|
||||
|:quitall| :quita[ll] quit Vim
|
||||
|:qall| :qa[ll] quit Vim
|
||||
|
||||
+33
-3
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Jan 02
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -3430,7 +3430,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
*'formatprg'* *'fp'*
|
||||
'formatprg' 'fp' string (default "")
|
||||
global
|
||||
global or local to buffer |global-local|
|
||||
{not in Vi}
|
||||
The name of an external program that will be used to format the lines
|
||||
selected with the |gq| operator. The program must take the input on
|
||||
@@ -5296,7 +5296,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
{not in Vi} *E21*
|
||||
When off the buffer contents cannot be changed. The 'fileformat' and
|
||||
'fileencoding' options also can't be changed.
|
||||
Can be reset with the |-M| command line argument.
|
||||
Can be reset on startup with the |-M| command line argument.
|
||||
|
||||
*'modified'* *'mod'* *'nomodified'* *'nomod'*
|
||||
'modified' 'mod' boolean (default off)
|
||||
@@ -5968,6 +5968,35 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
PYTHON3_HOME, which was specified at compile time, will be used for
|
||||
the Python 3 home directory.
|
||||
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
|
||||
security reasons.
|
||||
|
||||
@@ -5991,6 +6020,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
buffer, unless the 'Z' flag is in 'cpoptions'.
|
||||
{not in Vi:} When using the ":view" command the 'readonly' option is
|
||||
set for the newly edited buffer.
|
||||
See 'modifiable' for disallowing changes to the buffer.
|
||||
|
||||
*'redrawtime'* *'rdt'*
|
||||
'redrawtime' 'rdt' number (default 2000)
|
||||
|
||||
@@ -843,6 +843,7 @@ Short explanation of each option: *option-list*
|
||||
'pythonhome' name of the Python 2 home directory
|
||||
'pythonthreedll' name of the Python 3 dynamic library
|
||||
'pythonthreehome' name of the Python 3 home directory
|
||||
'pyxversion' 'pyx' Python version used for pyx* commands
|
||||
'quoteescape' 'qe' escape characters used in a string
|
||||
'readonly' 'ro' disallow writing the buffer
|
||||
'redrawtime' 'rdt' timeout for 'hlsearch' and |:match| highlighting
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*starting.txt* For Vim version 8.0. Last change: 2016 Nov 24
|
||||
*starting.txt* For Vim version 8.0. Last change: 2017 Jan 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -230,6 +230,7 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
|
||||
the executable "view" has the same effect as the -R argument.
|
||||
The 'updatecount' option will be set to 10000, meaning that
|
||||
the swap file will not be updated automatically very often.
|
||||
See |-M| for disallowing modifications.
|
||||
|
||||
*-m*
|
||||
-m Modifications not allowed to be written. The 'write' option
|
||||
@@ -1220,7 +1221,7 @@ There are several ways to exit Vim:
|
||||
- Use `:cquit`. Also when there are changes.
|
||||
|
||||
When using `:cquit` or when there was an error message Vim exits with exit
|
||||
code 1. Errors can be avoided by using `:silent!`.
|
||||
code 1. Errors can be avoided by using `:silent!` or with `:catch`.
|
||||
|
||||
==============================================================================
|
||||
8. Saving settings *save-settings*
|
||||
|
||||
+11
-1
@@ -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
|
||||
@@ -3479,6 +3479,8 @@ DEFINING CASE *:syn-case* *E390*
|
||||
"ignore". Note that any items before this are not affected, and all
|
||||
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*
|
||||
|
||||
@@ -3496,6 +3498,11 @@ SPELL CHECKING *:syn-spell*
|
||||
|
||||
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*
|
||||
|
||||
: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
|
||||
given explicitly.
|
||||
|
||||
:sy[ntax] conceal
|
||||
Show either "syntax conceal on" or "syntax conceal off" (translated).
|
||||
|
||||
==============================================================================
|
||||
7. Syntax patterns *:syn-pattern* *E401* *E402*
|
||||
|
||||
|
||||
@@ -790,6 +790,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'pvw' options.txt /*'pvw'*
|
||||
'pythondll' options.txt /*'pythondll'*
|
||||
'pythonthreedll' options.txt /*'pythonthreedll'*
|
||||
'pyx' options.txt /*'pyx'*
|
||||
'pyxversion' options.txt /*'pyxversion'*
|
||||
'qe' options.txt /*'qe'*
|
||||
'quote motion.txt /*'quote*
|
||||
'quoteescape' options.txt /*'quoteescape'*
|
||||
@@ -939,6 +941,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
't_AB' term.txt /*'t_AB'*
|
||||
't_AF' term.txt /*'t_AF'*
|
||||
'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_CV' term.txt /*'t_CV'*
|
||||
't_Ce' term.txt /*'t_Ce'*
|
||||
@@ -2747,6 +2751,10 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:pyfile if_pyth.txt /*:pyfile*
|
||||
:python if_pyth.txt /*:python*
|
||||
: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*
|
||||
:qa editing.txt /*:qa*
|
||||
:qall editing.txt /*:qall*
|
||||
@@ -4539,6 +4547,8 @@ E933 eval.txt /*E933*
|
||||
E934 sign.txt /*E934*
|
||||
E935 eval.txt /*E935*
|
||||
E936 autocmd.txt /*E936*
|
||||
E937 autocmd.txt /*E937*
|
||||
E938 eval.txt /*E938*
|
||||
E94 windows.txt /*E94*
|
||||
E95 message.txt /*E95*
|
||||
E96 diff.txt /*E96*
|
||||
@@ -4821,6 +4831,8 @@ W16 message.txt /*W16*
|
||||
W17 arabic.txt /*W17*
|
||||
W18 syntax.txt /*W18*
|
||||
W19 autocmd.txt /*W19*
|
||||
W20 if_pyth.txt /*W20*
|
||||
W21 if_pyth.txt /*W21*
|
||||
WORD motion.txt /*WORD*
|
||||
WWW intro.txt /*WWW*
|
||||
Win32 os_win32.txt /*Win32*
|
||||
@@ -6662,6 +6674,7 @@ hangulin.txt hangulin.txt /*hangulin.txt*
|
||||
has() eval.txt /*has()*
|
||||
has-patch eval.txt /*has-patch*
|
||||
has-python if_pyth.txt /*has-python*
|
||||
has-pythonx if_pyth.txt /*has-pythonx*
|
||||
has_key() eval.txt /*has_key()*
|
||||
haskell.vim syntax.txt /*haskell.vim*
|
||||
haslocaldir() eval.txt /*haslocaldir()*
|
||||
@@ -7995,7 +8008,11 @@ python.vim syntax.txt /*python.vim*
|
||||
python2-directory if_pyth.txt /*python2-directory*
|
||||
python3 if_pyth.txt /*python3*
|
||||
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*
|
||||
pyxeval() eval.txt /*pyxeval()*
|
||||
q repeat.txt /*q*
|
||||
q/ cmdline.txt /*q\/*
|
||||
q: cmdline.txt /*q:*
|
||||
@@ -8537,6 +8554,8 @@ t_@7 term.txt /*t_@7*
|
||||
t_AB term.txt /*t_AB*
|
||||
t_AF term.txt /*t_AF*
|
||||
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_CV term.txt /*t_CV*
|
||||
t_Ce term.txt /*t_Ce*
|
||||
@@ -8575,6 +8594,8 @@ t_KI term.txt /*t_KI*
|
||||
t_KJ term.txt /*t_KJ*
|
||||
t_KK term.txt /*t_KK*
|
||||
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_RI term.txt /*t_RI*
|
||||
t_RV term.txt /*t_RV*
|
||||
@@ -9426,6 +9447,7 @@ xterm-8-bit term.txt /*xterm-8-bit*
|
||||
xterm-8bit term.txt /*xterm-8bit*
|
||||
xterm-blink syntax.txt /*xterm-blink*
|
||||
xterm-blinking-cursor syntax.txt /*xterm-blinking-cursor*
|
||||
xterm-bracketed-paste term.txt /*xterm-bracketed-paste*
|
||||
xterm-clipboard term.txt /*xterm-clipboard*
|
||||
xterm-codes term.txt /*xterm-codes*
|
||||
xterm-color syntax.txt /*xterm-color*
|
||||
|
||||
+29
-1
@@ -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 Feb 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -89,6 +89,28 @@ an external command (e.g., "!!"), the terminal will be put into Normal mode
|
||||
for a moment. This means that you can stop the output to the screen by
|
||||
hitting a printing key. Output resumes when you hit <BS>.
|
||||
|
||||
*xterm-bracketed-paste*
|
||||
When the 't_BE' option is set then 't_BE' will be sent to the
|
||||
terminal when entering "raw" mode and 't_BD' when leaving "raw" mode. The
|
||||
terminal is then expected to put 't_PS' before pasted text and 't_PE' after
|
||||
pasted text. This way Vim can separate text that is pasted from characters
|
||||
that are typed. The pasted text is handled like when the middle mouse button
|
||||
is used, it is inserted literally and not interpreted as commands.
|
||||
|
||||
When the cursor is in the first column, the pasted text will be inserted
|
||||
before it. Otherwise the pasted text is appended after the cursor position.
|
||||
This means one cannot paste after the first column. Unfortunately Vim does
|
||||
not have a way to tell where the mouse pointer was.
|
||||
|
||||
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
|
||||
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*
|
||||
Note: If the terminal settings are changed after running Vim, you might have
|
||||
an illegal combination of settings. This has been reported on Solaris 2.5
|
||||
@@ -306,6 +328,10 @@ Added by Vim (there are no standard codes for these):
|
||||
|xterm-true-color|
|
||||
t_8b set background color (R, G, B) *t_8b* *'t_8b'*
|
||||
|xterm-true-color|
|
||||
t_BE enable bracketed paste mode *t_BE* *'t_BE'*
|
||||
|xterm-bracketed-paste|
|
||||
t_BD disable bracketed paste mode *t_BD* *'t_BD'*
|
||||
|xterm-bracketed-paste|
|
||||
|
||||
KEY CODES
|
||||
Note: Use the <> form if possible
|
||||
@@ -398,6 +424,8 @@ Note: Use the <> form if possible
|
||||
t_KK <k8> keypad 8 *<k8>* *t_KK* *'t_KK'*
|
||||
t_KL <k9> keypad 9 *<k9>* *t_KL* *'t_KL'*
|
||||
<Mouse> leader of mouse code *<Mouse>*
|
||||
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'
|
||||
|
||||
Note about t_so and t_mr: When the termcap entry "so" is not present the
|
||||
entry for "mr" is used. And vice versa. The same is done for "se" and "me".
|
||||
|
||||
+27
-58
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Jan 09
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -58,6 +58,7 @@ entered there will not be repeated below, unless there is extra information.
|
||||
connecting in the main loop with zero timeout.
|
||||
- job_start(): run job in a newly opened terminal.
|
||||
With xterm could use -S{pty}.
|
||||
Although user could use "xterm -e 'cmd arg'".
|
||||
|
||||
Regexp problems:
|
||||
- Since 7.4.704 the old regex engine fails to match [[:print:]] in 0xf6.
|
||||
@@ -106,75 +107,42 @@ Regexp problems:
|
||||
|
||||
'] 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
|
||||
position in 'runtimepath'. (Dugan Chen, 2016 Nov 18)
|
||||
|
||||
json_encode(): should convert to utf-8. (Nikolai Pavlov, 2016 Jan 23)
|
||||
What if there is an invalid character?
|
||||
|
||||
Include rust files. (Klabnik, #1356)
|
||||
|
||||
More float tests. (Dominique, #1364)
|
||||
|
||||
Patch to avoid ubsan warning for integer overflow. (Dominique, 2016 Dec 26)
|
||||
|
||||
Bug: Json with same key should not give internal error. (Lcd, 2016 Oct 26)
|
||||
Make dict_add give a duplicate key error.
|
||||
|
||||
Patch to make str2nr and str2float work with signed values.
|
||||
(Lemonbody, 2016 Dec 18, #1332)
|
||||
|
||||
Should json_encode()/json_decode() restrict recursiveness?
|
||||
Or avoid recursiveness.
|
||||
|
||||
Patch to fix UBSan error. Is this actually needed?
|
||||
(Yegappan, 2016 Dec 18)
|
||||
|
||||
Allow using json with empty key? Dict already has it.
|
||||
|
||||
Json string with trailing \u should be an error. (Lcd)
|
||||
|
||||
Patch to reset ex_exitvalue after catch. (Christian Brabandt, 2016 Oct 23)
|
||||
|
||||
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)
|
||||
|
||||
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
|
||||
Lakshmanan, 2016 Dec 13)
|
||||
With Visual selection of a multi-byte character the '] mark is on the last
|
||||
byte, should be first byte?
|
||||
|
||||
Patch for :pyx, run python commands depending on the supported version.
|
||||
(Marc Weber, update from Ken Takata, 2016 Sep 19, 2017 Jan 6)
|
||||
When session file has name in argument list but the buffer was deleted, the
|
||||
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
|
||||
like the item was not a match for :cnext.
|
||||
|
||||
Wrong diff highlighting with three files. (2016 Oct 20, #1186)
|
||||
Also get E749 on exit.
|
||||
Another example in #1309
|
||||
|
||||
Patch to fix vim_iswordp() works differently on chars <256 that are two bytes.
|
||||
Ozaki Kiichi, 2016 Dec 11.
|
||||
Completion for user-defined commands does not work if a few chararacters were
|
||||
already typed. (Dominique, 2017 Jan 26)
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
Patch for better explanation of 'compatible' side effects.
|
||||
@@ -212,6 +180,10 @@ Patch for restoring wide characters in the console buffer.
|
||||
Patch to fix escaping of job arguments. (Yasuhiro Matsumoto, 2016 Oct 5)
|
||||
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
|
||||
about /S and /D options (Ken Takata, 2016 Apr 13)
|
||||
Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases
|
||||
@@ -219,9 +191,6 @@ Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases
|
||||
Problem passing non-UTF-8 strings to Python 3. (Björn Linse, 2016 Sep 11,
|
||||
#1053) With patch, does it work?
|
||||
|
||||
Patch to make finding duplicate tags much faster, using a hashtab. (James
|
||||
McCoy, 2016 Sept 14, #1046) Should work now. Updated Nov 12.
|
||||
>
|
||||
Use ADDR_OTHER instead of ADDR_LINES for many more commands.
|
||||
Add tests for using number larger than number of lines in buffer.
|
||||
|
||||
@@ -236,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.
|
||||
(Ozaki Kiichi, 2016 Nov 25)
|
||||
Does this also fix #1408 ?
|
||||
|
||||
Patch for 'cursorlinenr' option. (Ozaki Kiichi, 2016 Nov 30)
|
||||
|
||||
@@ -251,6 +221,9 @@ Patch to make it possible to extend a list with itself.
|
||||
|
||||
Patch to add Zstandard compressed file support. (Nick Terrell, 2016 Oct 24)
|
||||
|
||||
Patch to add new regexp classes :ident:, :keyword:, :fname:.
|
||||
(ichizok, 2016 Jan 12, #1373)
|
||||
|
||||
Patch to add trim() function. (Bukn, 2016 Nov 25, #1280)
|
||||
|
||||
Patch to add MODIFIED_BY to MSVC build file. (Chen Lei, 2016 Nov 24, #1275)
|
||||
@@ -475,6 +448,9 @@ Should use /usr/local/share/applications or /usr/share/applications.
|
||||
Or use $XDG_DATA_DIRS.
|
||||
Also need to run update-desktop-database (Kuriyama Kazunobu, 2015 Nov 4)
|
||||
|
||||
Test object i{ and it do not behave the same. #1379
|
||||
Do not include the linebreak at the start?
|
||||
|
||||
Patch to have text objects defined by arbitrary single characters. (Daniel
|
||||
Thau, 2013 Nov 20, 2014 Jan 29, 2014 Jan 31)
|
||||
Added tests (James McCoy, 2016 Aug 3). Still needs more work.
|
||||
@@ -579,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
|
||||
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
|
||||
'cursorline'/'cursorcolumn' are a lot faster?
|
||||
|
||||
@@ -972,11 +951,6 @@ highlighted as the cursor line. (Alessandro Ivaldi, 2013 Jun 4)
|
||||
|
||||
Two highlighting bugs. (ZyX, 2013 Aug 18)
|
||||
|
||||
Patch to add the bufferlist() function. (Yegappan Lakshmanan, 2013 May 5)
|
||||
May 17: with winlist() and tabpagelist().
|
||||
May 19: with local variables.
|
||||
May 28: with options
|
||||
|
||||
Patch to support 'u' in interactive substitute. (Christian Brabandt, 2012 Sep
|
||||
28) With tests: Oct 9.
|
||||
|
||||
@@ -1076,9 +1050,6 @@ Aug 16)
|
||||
When there are no command line arguments ":next" and ":argu" give E163, which
|
||||
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:
|
||||
- will get stuck if byte sequence does not contain the expected semicolon.
|
||||
- Use urxvt mouse support also in xterm. Explanations:
|
||||
@@ -1219,8 +1190,6 @@ right type.
|
||||
string() can't parse back "inf" and "nan". Fix documentation or fix code?
|
||||
(ZyX, 2010 Aug 23)
|
||||
|
||||
Make 'formatprg' global-local. (Sung Pae)
|
||||
|
||||
When doing "redir => s:foo" in a script and then "redir END" somewhere else
|
||||
(e.g. in a function) it can't find s:foo.
|
||||
When a script contains "redir => s:foo" but doesn't end redirection, a
|
||||
|
||||
@@ -1000,6 +1000,7 @@ Various: *various-functions*
|
||||
perleval() evaluate Perl expression (|+perl|)
|
||||
py3eval() evaluate Python expression (|+python3|)
|
||||
pyeval() evaluate Python expression (|+python|)
|
||||
pyxeval() evaluate |python_x| expression
|
||||
|
||||
==============================================================================
|
||||
*41.7* Defining a function
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*version8.txt* For Vim version 8.0. Last change: 2016 Dec 10
|
||||
*version8.txt* For Vim version 8.0. Last change: 2017 Jan 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -230,6 +230,7 @@ Ex commands: ~
|
||||
Ex command modifiers: ~
|
||||
|
||||
|:keeppatterns| following command keeps search pattern history
|
||||
|<mods>| supply command modifiers to user defined commands
|
||||
|
||||
|
||||
New and extended functions: ~
|
||||
|
||||
@@ -676,8 +676,14 @@ au BufNewFile,BufRead *.dtd setf dtd
|
||||
" DTS/DSTI (device tree files)
|
||||
au BufNewFile,BufRead *.dts,*.dtsi setf dts
|
||||
|
||||
" EDIF (*.edf,*.edif,*.edn,*.edo)
|
||||
au BufNewFile,BufRead *.ed\(f\|if\|n\|o\) setf edif
|
||||
" EDIF (*.edf,*.edif,*.edn,*.edo) or edn
|
||||
au BufNewFile,BufRead *.ed\(f\|if\|o\) setf edif
|
||||
au BufNewFile,BufRead *.edn
|
||||
\ if getline(1) =~ '^\s*(\s*edif\>' |
|
||||
\ setf edif |
|
||||
\ else |
|
||||
\ setf clojure |
|
||||
\ endif
|
||||
|
||||
" EditorConfig (close enough to dosini)
|
||||
au BufNewFile,BufRead .editorconfig setf dosini
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: man
|
||||
" 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
|
||||
" this script from your startup vimrc file.
|
||||
@@ -97,7 +97,7 @@ func <SID>GetCmdArg(sect, page)
|
||||
endfunc
|
||||
|
||||
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 matchstr(where, " [^ ]*$") !~ "^ /"
|
||||
return 0
|
||||
@@ -176,7 +176,7 @@ func <SID>GetPage(...)
|
||||
let $MANWIDTH = winwidth(0)
|
||||
let unsetwidth = 1
|
||||
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
|
||||
let $MANWIDTH = ''
|
||||
endif
|
||||
|
||||
+10
-15
@@ -2,7 +2,7 @@
|
||||
" Header: "{{{
|
||||
" Maintainer: Bram Moolenaar
|
||||
" Original Author: Andy Wokula <anwoku@yahoo.de>
|
||||
" Last Change: 2016 Mar 30
|
||||
" Last Change: 2017 Jan 17
|
||||
" Version: 1.0
|
||||
" Description: HTML indent script with cached state for faster indenting on a
|
||||
" range of lines.
|
||||
@@ -25,27 +25,22 @@
|
||||
if exists("b:did_indent") "{{{
|
||||
finish
|
||||
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
|
||||
|
||||
setlocal indentexpr=HtmlIndent()
|
||||
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.
|
||||
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.
|
||||
let b:hi_indent = {"lnum": -1}
|
||||
@@ -596,7 +591,7 @@ func! s:Alien3()
|
||||
return eval(b:hi_js1indent)
|
||||
endif
|
||||
if b:hi_indent.scripttype == "javascript"
|
||||
return cindent(v:lnum)
|
||||
return GetJavascriptIndent()
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
|
||||
+5
-1
@@ -940,7 +940,7 @@ if has("folding")
|
||||
call append("$", "foldmarker\tmarkers used when 'foldmethod' is \"marker\"")
|
||||
call append("$", "\t(local to window)")
|
||||
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 <SID>OptionL("fdn")
|
||||
endif
|
||||
@@ -1341,6 +1341,10 @@ if exists("&perldll")
|
||||
call append("$", "perldll\tname of the Perl dynamic library")
|
||||
call <SID>OptionG("perldll", &perldll)
|
||||
endif
|
||||
if has('pythonx')
|
||||
call append("$", "pyxversion\twhether to use Python 2 or 3")
|
||||
call append("$", " \tset pyx=" . &wd)
|
||||
endif
|
||||
if exists("&pythondll")
|
||||
call append("$", "pythondll\tname of the Python 2 dynamic library")
|
||||
call <SID>OptionG("pythondll", &pythondll)
|
||||
|
||||
+107
-81
@@ -1,8 +1,10 @@
|
||||
" Vim syntax file
|
||||
" Language: AutoHotkey script file
|
||||
" Maintainer: SungHyun Nam <goweol@gmail.com>
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2015-10-29
|
||||
" Maintainer: Michael Wong
|
||||
" https://github.com/mmikeww/autohotkey.vim
|
||||
" Latest Revision: 2017-01-23
|
||||
" Previous Maintainers: SungHyun Nam <goweol@gmail.com>
|
||||
" Nikolai Weibull <now@bitwi.se>
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -17,68 +19,11 @@ syn keyword autohotkeyTodo
|
||||
\ contained
|
||||
\ TODO FIXME XXX NOTE
|
||||
|
||||
syn cluster autohotkeyCommentGroup
|
||||
\ contains=
|
||||
\ autohotkeyTodo,
|
||||
\ @Spell
|
||||
|
||||
syn match autohotkeyComment
|
||||
\ display
|
||||
\ contains=@autohotkeyCommentGroup
|
||||
\ '`\@<!;.*$'
|
||||
|
||||
syn region autohotkeyComment
|
||||
\ contains=@autohotkeyCommentGroup
|
||||
\ matchgroup=autohotkeyCommentStart
|
||||
\ start='/\*'
|
||||
\ end='\*/'
|
||||
|
||||
" only these chars are valid as escape sequences: ,%`;nrbtvaf
|
||||
" https://autohotkey.com/docs/commands/_EscapeChar.htm
|
||||
syn match autohotkeyEscape
|
||||
\ display
|
||||
\ '`.'
|
||||
|
||||
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]\)'
|
||||
\ '`[,%`;nrbtvaf]'
|
||||
|
||||
syn region autohotkeyString
|
||||
\ display
|
||||
@@ -88,39 +33,46 @@ syn region autohotkeyString
|
||||
\ end=+"+
|
||||
\ contains=autohotkeyEscape
|
||||
|
||||
syn region autohotkeyVariable
|
||||
syn match autohotkeyVariable
|
||||
\ display
|
||||
\ oneline
|
||||
\ contains=autohotkeyBuiltinVariable
|
||||
\ matchgroup=autohotkeyVariableDelimiter
|
||||
\ start="%"
|
||||
\ end="%"
|
||||
\ keepend
|
||||
\ '%\S\{-}%'
|
||||
|
||||
syn keyword autohotkeyBuiltinVariable
|
||||
\ A_Space A_Tab
|
||||
\ A_WorkingDir A_ScriptDir A_ScriptName A_ScriptFullPath A_LineNumber
|
||||
\ A_LineFile A_AhkVersion A_AhkPAth 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_WorkingDir A_ScriptDir A_ScriptName A_ScriptFullPath A_ScriptHwnd A_LineNumber
|
||||
\ 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_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_IsSuspended A_BatchLines A_TitleMatchMode A_TitleMatchModeSpeed
|
||||
\ A_DetectHiddenWindows A_DetectHiddenText A_AutoTrim A_STringCaseSense
|
||||
\ A_FormatInteger A_FormatFloat A_KeyDelay A_WinDelay A_ControlDelay
|
||||
\ A_MouseDelay A_DefaultMouseSpeed A_IconHidden A_IconTip A_IconFile
|
||||
\ A_IsSuspended A_IsPaused A_IsCritical A_BatchLines A_TitleMatchMode A_TitleMatchModeSpeed
|
||||
\ A_DetectHiddenWindows A_DetectHiddenText A_AutoTrim A_StringCaseSense
|
||||
\ A_FileEncoding A_FormatInteger A_FormatFloat A_KeyDelay A_WinDelay A_ControlDelay
|
||||
\ 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_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_GuiControlEvent A_EventInfo
|
||||
\ 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
|
||||
\ A_Is64BitOS A_PtrSize
|
||||
\ A_WinDir A_ProgramFiles ProgramFiles A_AppData A_AppDataCommon A_Desktop
|
||||
\ A_DesktopCommon A_StartMenu A_StartMenuCommon A_Programs
|
||||
\ 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_Cursor A_CaretX A_CaretY Clipboard ClipboardAll ErrorLevel A_LastError
|
||||
\ 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
|
||||
\ contained
|
||||
@@ -130,7 +82,7 @@ syn match autohotkeyBuiltinVariable
|
||||
syn keyword autohotkeyCommand
|
||||
\ ClipWait EnvGet EnvSet EnvUpdate
|
||||
\ Drive DriveGet DriveSpaceFree FileAppend FileCopy FileCopyDir
|
||||
\ FileCreateDir FileCreateShortcut FileDelete FileGetAttrib
|
||||
\ FileCreateDir FileCreateShortcut FileDelete FileGetAttrib FileEncoding
|
||||
\ FileGetShortcut FileGetSize FileGetTime FileGetVersion FileInstall
|
||||
\ FileMove FileMoveDir FileReadLine FileRead FileRecycle FileRecycleEmpty
|
||||
\ FileRemoveDir FileSelectFolder FileSelectFile FileSetAttrib FileSetTime
|
||||
@@ -153,7 +105,7 @@ syn keyword autohotkeyCommand
|
||||
\ SoundSetWaveVolume
|
||||
\ FormatTime IfInString IfNotInString Sort StringCaseSense StringGetPos
|
||||
\ StringLeft StringRight StringLower StringUpper StringMid StringReplace
|
||||
\ StringSplit StringTrimLeft StringTrimRight
|
||||
\ StringSplit StringTrimLeft StringTrimRight StringLen
|
||||
\ Control ControlClick ControlFocus ControlGet ControlGetFocus
|
||||
\ ControlGetPos ControlGetText ControlMove ControlSend ControlSendRaw
|
||||
\ ControlSetText Menu PostMessage SendMessage SetControlDelay
|
||||
@@ -164,12 +116,16 @@ syn keyword autohotkeyCommand
|
||||
\ WinGetText WinGetTitle WinHide WinKill WinMaximize WinMinimize
|
||||
\ WinMinimizeAll WinMinimizeAllUndo WinMove WinRestore WinSet
|
||||
\ WinSetTitle WinShow WinWait WinWaitActive WinWaitNotActive WinWaitClose
|
||||
\ SetCapsLockState SetNumLockState SetScrollLockState
|
||||
|
||||
syn keyword autohotkeyFunction
|
||||
\ InStr RegExMatch RegExReplace StrLen SubStr Asc Chr
|
||||
\ DllCall VarSetCapacity WinActive WinExist IsLabel OnMessage
|
||||
\ 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
|
||||
\ Break Continue Exit ExitApp Gosub Goto OnExit Pause Return
|
||||
@@ -180,7 +136,9 @@ syn keyword autohotkeyRepeat
|
||||
|
||||
syn keyword autohotkeyConditional
|
||||
\ IfExist IfNotExist If IfEqual IfLess IfGreater Else
|
||||
\ IfWinExist IfWinNotExist
|
||||
\ IfWinExist IfWinNotExist IfWinActive IfWinNotActive
|
||||
\ IfNotEqual IfLessOrEqual IfGreaterOrEqual
|
||||
\ while until for in
|
||||
|
||||
syn match autohotkeyPreProcStart
|
||||
\ nextgroup=
|
||||
@@ -200,6 +158,7 @@ syn keyword autohotkeyPreProc
|
||||
\ HotkeyInterval HotKeyModifierTimeout
|
||||
\ Hotstring
|
||||
\ IfWinActive IfWinNotActive IfWinExist IfWinNotExist
|
||||
\ If IfTimeout
|
||||
\ MaxHotkeysPerInterval MaxThreads MaxThreadsBuffer MaxThreadsPerHotkey
|
||||
\ UseHook InstallKeybdHook InstallMouseHook
|
||||
\ KeyHistory
|
||||
@@ -213,6 +172,10 @@ syn keyword autohotkeyPreProc
|
||||
\ MaxMem
|
||||
\ NoEnv
|
||||
\ Persistent
|
||||
\ LTrim
|
||||
\ InputLevel
|
||||
\ MenuMaskKey
|
||||
\ Warn
|
||||
|
||||
syn keyword autohotkeyMatchClass
|
||||
\ ahk_group ahk_class ahk_id ahk_pid
|
||||
@@ -243,11 +206,74 @@ syn match autohotkeyFloat
|
||||
syn keyword autohotkeyType
|
||||
\ local
|
||||
\ global
|
||||
\ static
|
||||
\ byref
|
||||
|
||||
syn keyword autohotkeyBoolean
|
||||
\ true
|
||||
\ 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
|
||||
" something?
|
||||
if exists("g:autohotkey_syntax_sync_minlines")
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
" Nikolai Weibull (Add CSS2 support)
|
||||
" Maintainer: Jules Wang <w.jq0722@gmail.com>
|
||||
" URL: https://github.com/JulesWang/css.vim
|
||||
" Last Change: 2015 Apr.17
|
||||
" Last Change: 2017 Jan 14
|
||||
" cssClassName updated by Ryuichi Hayashida Jan 2016
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if !exists("main_syntax")
|
||||
@@ -56,7 +57,7 @@ syn match cssSelectorOp2 "[~|^$*]\?=" contained
|
||||
syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ
|
||||
|
||||
" .class and #id
|
||||
syn match cssClassName "\.[A-Za-z][A-Za-z0-9_-]\+" contains=cssClassNameDot
|
||||
syn match cssClassName "\.-\=[A-Za-z_][A-Za-z0-9_-]*" contains=cssClassNameDot
|
||||
syn match cssClassNameDot contained '\.'
|
||||
|
||||
try
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
|
||||
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
|
||||
" Wichert Akkerman <wakkerma@debian.org>
|
||||
" Last Change: 2016 Aug 30
|
||||
" Last Change: 2016 Nov 12
|
||||
" URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debchangelog.vim
|
||||
|
||||
" Standard syntax initialization
|
||||
@@ -21,7 +21,7 @@ let binNMU='binary-only=yes'
|
||||
syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ "
|
||||
exe 'syn match debchangelogFirstKV contained "; \('.urgency.'\|'.binNMU.'\)"'
|
||||
exe 'syn match debchangelogOtherKV contained ", \('.urgency.'\|'.binNMU.'\)"'
|
||||
syn match debchangelogTarget contained "\v %(frozen|unstable|sid|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile|lts|security)|wheezy-%(backports%(-sloppy)=|security)|jessie%(-backports|-security)=|stretch|%(devel|precise|trusty|vivid|wily|xenial|yakkety)%(-%(security|proposed|updates|backports|commercial|partner))=)+"
|
||||
syn match debchangelogTarget contained "\v %(frozen|unstable|sid|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile|lts|security)|wheezy-%(backports%(-sloppy)=|security)|jessie%(-backports|-security)=|stretch|%(devel|precise|trusty|vivid|wily|xenial|yakkety|zesty)%(-%(security|proposed|updates|backports|commercial|partner))=)+"
|
||||
syn match debchangelogVersion contained "(.\{-})"
|
||||
syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*"
|
||||
syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*"
|
||||
|
||||
@@ -38,7 +38,7 @@ unlet s:kernels s:archs s:pairs
|
||||
syn match debcontrolMultiArch contained "\%(no\|foreign\|allowed\|same\)"
|
||||
syn match debcontrolName contained "[a-z0-9][a-z0-9+.-]\+"
|
||||
syn match debcontrolPriority contained "\(extra\|important\|optional\|required\|standard\)"
|
||||
syn match debcontrolSection contained "\v((contrib|non-free|non-US/main|non-US/contrib|non-US/non-free|restricted|universe|multiverse)/)?(admin|cli-mono|comm|database|debian-installer|debug|devel|doc|editors|education|electronics|embedded|fonts|games|gnome|gnustep|gnu-r|graphics|hamradio|haskell|httpd|interpreters|introspection|java|kde|kernel|libs|libdevel|lisp|localization|mail|math|metapackages|misc|net|news|ocaml|oldlibs|otherosfs|perl|php|python|ruby|science|shells|sound|text|tex|utils|vcs|video|web|x11|xfce|zope)"
|
||||
syn match debcontrolSection contained "\v((contrib|non-free|non-US/main|non-US/contrib|non-US/non-free|restricted|universe|multiverse)/)?(admin|cli-mono|comm|database|debian-installer|debug|devel|doc|editors|education|electronics|embedded|fonts|games|gnome|gnustep|gnu-r|graphics|hamradio|haskell|httpd|interpreters|introspection|java|javascript|kde|kernel|libs|libdevel|lisp|localization|mail|math|metapackages|misc|net|news|ocaml|oldlibs|otherosfs|perl|php|python|ruby|rust|science|shells|sound|text|tex|utils|vcs|video|web|x11|xfce|zope)"
|
||||
syn match debcontrolPackageType contained "u\?deb"
|
||||
syn match debcontrolVariable contained "\${.\{-}}"
|
||||
syn match debcontrolDmUpload contained "\cyes"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: Debian sources.list
|
||||
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
|
||||
" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
|
||||
" Last Change: 2016 Sep 27
|
||||
" Last Change: 2016 Nov 12
|
||||
" URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debsources.vim
|
||||
|
||||
" Standard syntax initialization
|
||||
@@ -25,7 +25,7 @@ let s:supported = [
|
||||
\ 'oldstable', 'stable', 'testing', 'unstable', 'experimental',
|
||||
\ 'squeeze', 'wheezy', 'jessie', 'stretch', 'sid', 'rc-buggy',
|
||||
\
|
||||
\ 'precise', 'trusty', 'xenial', 'yakkety', 'devel'
|
||||
\ 'precise', 'trusty', 'xenial', 'yakkety', 'zesty', 'devel'
|
||||
\ ]
|
||||
let s:unsupported = [
|
||||
\ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
|
||||
|
||||
+15
-6
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
|
||||
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
||||
" Repository: https://notabug.org/jorgesumle/vim-html-syntax
|
||||
" Last Change: 2017 Jan 04
|
||||
" Last Change: 2017 Jan 21
|
||||
" included patch from Jorge Maldonado Ventura
|
||||
|
||||
" 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
|
||||
|
||||
" new html 5 tags
|
||||
syn keyword htmlTagName contained article aside audio bdi canvas datalist
|
||||
syn keyword htmlTagName contained details embed figcaption figure
|
||||
syn keyword htmlTagName contained footer header hgroup main mark
|
||||
syn keyword htmlTagName contained article aside audio bdi canvas data
|
||||
syn keyword htmlTagName contained datalist details embed figcaption figure
|
||||
syn keyword htmlTagName contained footer header hgroup keygen main mark
|
||||
syn keyword htmlTagName contained menuitem meter nav output picture
|
||||
syn keyword htmlTagName contained progress rb rp rt rtc ruby section
|
||||
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
|
||||
|
||||
" html 5 arg names
|
||||
syn keyword htmlArg contained contenteditable contextmenu draggable dropzone
|
||||
syn keyword htmlArg contained hidden spellcheck title translate
|
||||
syn keyword htmlArg contained allowfullscreen async autocomplete autofocus
|
||||
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
|
||||
syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
" Vim syntax file
|
||||
" Language: Matlab
|
||||
" Maintainer: Maurizio Tranchero - maurizio(.)tranchero(@)gmail(.)com
|
||||
" Maintainer: Alex Burka <vim@alexburka.com>
|
||||
" Credits: Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
|
||||
" Maurizio Tranchero - maurizio(.)tranchero(@)gmail(.)com
|
||||
" Original author: Mario Eusebio
|
||||
" Last Change: Wed Jan 13 11:12:34 CET 2010
|
||||
" sinh added to matlab implicit commands
|
||||
" Last Change: Mon Jan 23 2017
|
||||
" added support for cell mode
|
||||
" Change History:
|
||||
" - now highlights cell-mode separator comments
|
||||
" - 'global' and 'persistent' keyword are now recognized
|
||||
|
||||
" 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
|
||||
syn match matlabComment "\.\.\..*$" 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 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 matlabComment Comment
|
||||
hi def link matlabMultilineComment Comment
|
||||
hi def link matlabCellComment Todo
|
||||
hi def link matlabScope Type
|
||||
|
||||
hi def link matlabArithmeticOperator matlabOperator
|
||||
|
||||
+22
-3
@@ -1,9 +1,10 @@
|
||||
" Vim syntax file
|
||||
" 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>
|
||||
" 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/
|
||||
|
||||
|
||||
@@ -67,8 +68,23 @@ syn match nasmLabelError "\<\~\s*\(\k*\s*:\|\$\=\.\k*\)"
|
||||
|
||||
|
||||
" 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 +\("[^"]\{-}"\|'[^']\{-}'\)+
|
||||
" 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\>"lc=1
|
||||
syn match nasmOctNumber "\<\o\+q\>"
|
||||
@@ -443,7 +459,10 @@ hi def link nasmInCommentTodo Todo
|
||||
|
||||
" Constant Group:
|
||||
hi def link nasmString String
|
||||
hi def link nasmCString String
|
||||
hi def link nasmStringError Error
|
||||
hi def link nasmCStringEscape SpecialChar
|
||||
hi def link nasmCStringFormat SpecialChar
|
||||
hi def link nasmBinNumber Number
|
||||
hi def link nasmOctNumber Number
|
||||
hi def link nasmDecNumber Number
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
" Language: shell (sh) Korn shell (ksh) bash (sh)
|
||||
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
|
||||
" Last Change: Sep 22, 2016
|
||||
" Version: 165
|
||||
" Last Change: Jan 03, 2017
|
||||
" Version: 167
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
|
||||
" For options and settings, please use: :help ft-sh-syntax
|
||||
" This file includes many ideas from Eric Brunet (eric.brunet@ens.fr)
|
||||
@@ -305,7 +305,7 @@ if exists("b:is_bash")
|
||||
syn cluster shCommandSubList add=bashSpecialVariables,bashStatement
|
||||
syn cluster shCaseList add=bashAdminStatement,bashStatement
|
||||
syn keyword bashSpecialVariables contained auto_resume BASH BASH_ALIASES BASH_ALIASES BASH_ARGC BASH_ARGC BASH_ARGV BASH_ARGV BASH_CMDS BASH_CMDS BASH_COMMAND BASH_COMMAND BASH_ENV BASH_EXECUTION_STRING BASH_EXECUTION_STRING BASH_LINENO BASH_LINENO BASHOPTS BASHOPTS BASHPID BASHPID BASH_REMATCH BASH_REMATCH BASH_SOURCE BASH_SOURCE BASH_SUBSHELL BASH_SUBSHELL BASH_VERSINFO BASH_VERSION BASH_XTRACEFD BASH_XTRACEFD CDPATH COLUMNS COLUMNS COMP_CWORD COMP_CWORD COMP_KEY COMP_KEY COMP_LINE COMP_LINE COMP_POINT COMP_POINT COMPREPLY COMPREPLY COMP_TYPE COMP_TYPE COMP_WORDBREAKS COMP_WORDBREAKS COMP_WORDS COMP_WORDS COPROC COPROC DIRSTACK EMACS EMACS ENV ENV EUID FCEDIT FIGNORE FUNCNAME FUNCNAME FUNCNEST FUNCNEST GLOBIGNORE GROUPS histchars HISTCMD HISTCONTROL HISTFILE HISTFILESIZE HISTIGNORE HISTSIZE HISTTIMEFORMAT HISTTIMEFORMAT HOME HOSTFILE HOSTNAME HOSTTYPE IFS IGNOREEOF INPUTRC LANG LC_ALL LC_COLLATE LC_CTYPE LC_CTYPE LC_MESSAGES LC_NUMERIC LC_NUMERIC LINENO LINES LINES MACHTYPE MAIL MAILCHECK MAILPATH MAPFILE MAPFILE OLDPWD OPTARG OPTERR OPTIND OSTYPE PATH PIPESTATUS POSIXLY_CORRECT POSIXLY_CORRECT PPID PROMPT_COMMAND PS1 PS2 PS3 PS4 PWD RANDOM READLINE_LINE READLINE_LINE READLINE_POINT READLINE_POINT REPLY SECONDS SHELL SHELL SHELLOPTS SHLVL TIMEFORMAT TIMEOUT TMPDIR TMPDIR UID
|
||||
syn keyword bashStatement chmod clear complete du egrep expr fgrep find gnufind gnugrep grep less ls mkdir mv rm rmdir rpm sed sleep sort strip tail
|
||||
syn keyword bashStatement chmod clear complete du egrep expr fgrep find gnufind gnugrep grep less ls mkdir mv rm rmdir rpm sed sleep sort strip tail
|
||||
syn keyword bashAdminStatement daemon killall killproc nice reload restart start status stop
|
||||
syn keyword bashStatement command compgen
|
||||
endif
|
||||
@@ -376,8 +376,8 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*\"\z([^ \
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc07 end="^\z1\s*$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\\\_$\_s*'\z([^ \t|>]\+\)'" matchgroup=shHereDoc08 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\"\z([^ \t|>]\+\)\"" matchgroup=shHereDoc09 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*'\z([^ \t|>]\+\)'" matchgroup=shHereDoc12 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^ \t|>]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$"
|
||||
@@ -386,7 +386,7 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \
|
||||
" Here Strings: {{{1
|
||||
" =============
|
||||
" 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
|
||||
endif
|
||||
|
||||
@@ -407,7 +407,7 @@ else
|
||||
endif
|
||||
|
||||
" Functions: {{{1
|
||||
if !exists("g:is_posix")
|
||||
if !exists("b:is_posix")
|
||||
syn keyword shFunctionKey function skipwhite skipnl nextgroup=shFunctionTwo
|
||||
endif
|
||||
|
||||
@@ -533,7 +533,7 @@ endif
|
||||
" ====================
|
||||
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
|
||||
if exists("g:is_posix")
|
||||
if exists("b:is_posix")
|
||||
syn keyword shStatement command
|
||||
else
|
||||
syn keyword shStatement time
|
||||
@@ -542,7 +542,7 @@ if exists("b:is_kornshell") || exists("b:is_bash")
|
||||
" Useful bash Keywords: {{{1
|
||||
" =====================
|
||||
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
|
||||
syn keyword shStatement login newgrp
|
||||
endif
|
||||
|
||||
+32
-4
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: TeX
|
||||
" Maintainer: Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM>
|
||||
" Last Change: Sep 20, 2016
|
||||
" Version: 101
|
||||
" Last Change: Dec 07, 2016
|
||||
" Version: 102
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
|
||||
"
|
||||
" Notes: {{{1
|
||||
@@ -494,13 +494,11 @@ if !exists("g:tex_no_math")
|
||||
\ ['\\backslash' , '\'] ,
|
||||
\ ['\\downarrow' , '↓'] ,
|
||||
\ ['\\Downarrow' , '⇓'] ,
|
||||
\ ['\\langle' , '<'] ,
|
||||
\ ['\\lbrace' , '['] ,
|
||||
\ ['\\lceil' , '⌈'] ,
|
||||
\ ['\\lfloor' , '⌊'] ,
|
||||
\ ['\\lgroup' , '⌊'] ,
|
||||
\ ['\\lmoustache' , '⎛'] ,
|
||||
\ ['\\rangle' , '>'] ,
|
||||
\ ['\\rbrace' , ']'] ,
|
||||
\ ['\\rceil' , '⌉'] ,
|
||||
\ ['\\rfloor' , '⌋'] ,
|
||||
@@ -510,6 +508,15 @@ if !exists("g:tex_no_math")
|
||||
\ ['\\Uparrow' , '↑'] ,
|
||||
\ ['\\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
|
||||
for texmath in s:texMathDelimList
|
||||
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' , '∖'],
|
||||
\ ['barwedge' , '⊼'],
|
||||
\ ['because' , '∵'],
|
||||
\ ['beth' , 'ܒ'],
|
||||
\ ['between' , '≬'],
|
||||
\ ['bigcap' , '∩'],
|
||||
\ ['bigcirc' , '○'],
|
||||
@@ -699,6 +707,7 @@ if has("conceal") && &enc == 'utf-8'
|
||||
\ ['boxminus' , '⊟'],
|
||||
\ ['boxplus' , '⊞'],
|
||||
\ ['boxtimes' , '⊠'],
|
||||
\ ['Box' , '☐'],
|
||||
\ ['bullet' , '•'],
|
||||
\ ['bumpeq' , '≏'],
|
||||
\ ['Bumpeq' , '≎'],
|
||||
@@ -748,6 +757,7 @@ if has("conceal") && &enc == 'utf-8'
|
||||
\ ['eqslantgtr' , '⪖'],
|
||||
\ ['eqslantless' , '⪕'],
|
||||
\ ['equiv' , '≡'],
|
||||
\ ['eth' , 'ð'],
|
||||
\ ['exists' , '∃'],
|
||||
\ ['fallingdotseq' , '≒'],
|
||||
\ ['flat' , '♭'],
|
||||
@@ -757,6 +767,7 @@ if has("conceal") && &enc == 'utf-8'
|
||||
\ ['geq' , '≥'],
|
||||
\ ['geqq' , '≧'],
|
||||
\ ['gets' , '←'],
|
||||
\ ['gimel' , 'ℷ'],
|
||||
\ ['gg' , '⟫'],
|
||||
\ ['gneqq' , '≩'],
|
||||
\ ['gtrdot' , '⋗'],
|
||||
@@ -767,13 +778,17 @@ if has("conceal") && &enc == 'utf-8'
|
||||
\ ['heartsuit' , '♡'],
|
||||
\ ['hookleftarrow' , '↩'],
|
||||
\ ['hookrightarrow' , '↪'],
|
||||
\ ['iff' , '⇔'],
|
||||
\ ['iiint' , '∭'],
|
||||
\ ['iint' , '∬'],
|
||||
\ ['Im' , 'ℑ'],
|
||||
\ ['imath' , 'ɩ'],
|
||||
\ ['implies' , '⇒'],
|
||||
\ ['in' , '∈'],
|
||||
\ ['infty' , '∞'],
|
||||
\ ['int' , '∫'],
|
||||
\ ['jmath' , '𝚥'],
|
||||
\ ['land' , '∧'],
|
||||
\ ['lceil' , '⌈'],
|
||||
\ ['ldots' , '…'],
|
||||
\ ['le' , '≤'],
|
||||
@@ -800,6 +815,7 @@ if has("conceal") && &enc == 'utf-8'
|
||||
\ ['ll' , '≪'],
|
||||
\ ['lmoustache' , '╭'],
|
||||
\ ['lneqq' , '≨'],
|
||||
\ ['lor' , '∨'],
|
||||
\ ['ltimes' , '⋉'],
|
||||
\ ['mapsto' , '↦'],
|
||||
\ ['measuredangle' , '∡'],
|
||||
@@ -826,6 +842,7 @@ if has("conceal") && &enc == 'utf-8'
|
||||
\ ['nless' , '≮'],
|
||||
\ ['nmid' , '∤'],
|
||||
\ ['notin' , '∉'],
|
||||
\ ['nparallel' , '∦'],
|
||||
\ ['nprec' , '⊀'],
|
||||
\ ['nrightarrow' , '↛'],
|
||||
\ ['nRightarrow' , '⇏'],
|
||||
@@ -927,10 +944,12 @@ if has("conceal") && &enc == 'utf-8'
|
||||
\ ['trianglerighteq', '⊵'],
|
||||
\ ['twoheadleftarrow', '↞'],
|
||||
\ ['twoheadrightarrow', '↠'],
|
||||
\ ['ulcorner' , '⌜'],
|
||||
\ ['uparrow' , '↑'],
|
||||
\ ['Uparrow' , '⇑'],
|
||||
\ ['updownarrow' , '↕'],
|
||||
\ ['Updownarrow' , '⇕'],
|
||||
\ ['urcorner' , '⌝'],
|
||||
\ ['varnothing' , '∅'],
|
||||
\ ['vartriangle' , '∆'],
|
||||
\ ['vdash' , '⊢'],
|
||||
@@ -946,6 +965,15 @@ if has("conceal") && &enc == 'utf-8'
|
||||
" \ ['jmath' , 'X']
|
||||
" \ ['uminus' , '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
|
||||
if texmath[0] =~# '\w$'
|
||||
exe "syn match texMathSymbol '\\\\".texmath[0]."\\>' contained conceal cchar=".texmath[1]
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim 8.0 script
|
||||
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||
" Last Change: September 29, 2016
|
||||
" Version: 8.0-01
|
||||
" Last Change: Jan 19, 2017
|
||||
" Version: 8.0-02
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
|
||||
" 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 "\<0[xX]\x\+"
|
||||
syn match vimNumber "\<0[bB][01]\+"
|
||||
syn match vimNumber "\%(^\|[^a-zA-Z]\)\zs#\x\{6}"
|
||||
|
||||
" 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
|
||||
" =========
|
||||
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
|
||||
|
||||
if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
|
||||
|
||||
@@ -123,7 +123,7 @@ NOTE : En avan
|
||||
Leçon 1.5 : ÉDITION DE TEXTE - AJOUTER
|
||||
|
||||
|
||||
** Appuyez A pour ajouter du text. **
|
||||
** Appuyez A pour ajouter du texte. **
|
||||
|
||||
1. Déplacez le curseur sur la première ligne ci-dessous marquée --->.
|
||||
Peu importe sur quel caractère se trouve le curseur sur cette ligne.
|
||||
@@ -574,7 +574,7 @@ NOTE : Quand la recherche atteint la fin du fichier, elle reprend au d
|
||||
|
||||
2. Puis tapez le caractère % .
|
||||
|
||||
3. Le curseur se déplacera sur la parenthèse out crochet correspondant.
|
||||
3. Le curseur se déplacera sur la parenthèse ou crochet correspondant.
|
||||
|
||||
4. Tapez % pour replacer le curseur sur la parenthèse ou crochet
|
||||
correspondant.
|
||||
@@ -854,17 +854,17 @@ NOTE : Le mode Remplacement est comme le mode Insertion, mais tous les
|
||||
5. Tapez p pour coller le texte. Puis tapez : un second <Échap> .
|
||||
|
||||
6. Utilisez le mode Visuel pour sélectionner "élément", copiez-le avec y ,
|
||||
déplacez-vous à la fin de la ligne suivant avec j$ et collez le texte
|
||||
déplacez-vous à la fin de la ligne suivante avec j$ et collez le texte
|
||||
à cet endroit avec p .
|
||||
|
||||
---> a) ceci est le premier élément.
|
||||
b)
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Leçon 6.4 : RÉGLAGE DES OPTIONS
|
||||
Leçon 6.5 : RÉGLAGE DES OPTIONS
|
||||
|
||||
|
||||
** Réglons une option afin que la recherche et la substitution ignore la
|
||||
** Réglons une option afin que la recherche et la substitution ignorent la
|
||||
casse des caractères. **
|
||||
|
||||
1. Recherchez 'ignore' en tapant : /ignore <Entrée>
|
||||
@@ -1034,5 +1034,5 @@ NOTE : Le compl
|
||||
Dernières mises à jour par Dominique Pellé.
|
||||
|
||||
E-mail : dominique.pelle@gmail.com
|
||||
Last Change : 2016 Nov 08
|
||||
Last Change : 2017 Jan 16
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -123,7 +123,7 @@ NOTE : En avançant dans ce cours, n'essayez pas de mémoriser, apprenez par
|
||||
Leçon 1.5 : ÉDITION DE TEXTE - AJOUTER
|
||||
|
||||
|
||||
** Appuyez A pour ajouter du text. **
|
||||
** Appuyez A pour ajouter du texte. **
|
||||
|
||||
1. Déplacez le curseur sur la première ligne ci-dessous marquée --->.
|
||||
Peu importe sur quel caractère se trouve le curseur sur cette ligne.
|
||||
@@ -574,7 +574,7 @@ NOTE : Quand la recherche atteint la fin du fichier, elle reprend au début
|
||||
|
||||
2. Puis tapez le caractère % .
|
||||
|
||||
3. Le curseur se déplacera sur la parenthèse out crochet correspondant.
|
||||
3. Le curseur se déplacera sur la parenthèse ou crochet correspondant.
|
||||
|
||||
4. Tapez % pour replacer le curseur sur la parenthèse ou crochet
|
||||
correspondant.
|
||||
@@ -854,17 +854,17 @@ NOTE : Le mode Remplacement est comme le mode Insertion, mais tous les
|
||||
5. Tapez p pour coller le texte. Puis tapez : un second <Échap> .
|
||||
|
||||
6. Utilisez le mode Visuel pour sélectionner "élément", copiez-le avec y ,
|
||||
déplacez-vous à la fin de la ligne suivant avec j$ et collez le texte
|
||||
déplacez-vous à la fin de la ligne suivante avec j$ et collez le texte
|
||||
à cet endroit avec p .
|
||||
|
||||
---> a) ceci est le premier élément.
|
||||
b)
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Leçon 6.4 : RÉGLAGE DES OPTIONS
|
||||
Leçon 6.5 : RÉGLAGE DES OPTIONS
|
||||
|
||||
|
||||
** Réglons une option afin que la recherche et la substitution ignore la
|
||||
** Réglons une option afin que la recherche et la substitution ignorent la
|
||||
casse des caractères. **
|
||||
|
||||
1. Recherchez 'ignore' en tapant : /ignore <Entrée>
|
||||
@@ -1034,5 +1034,5 @@ NOTE : Le complètement fonctionne pour de nombreuses commandes. Essayez
|
||||
Dernières mises à jour par Dominique Pellé.
|
||||
|
||||
E-mail : dominique.pelle@gmail.com
|
||||
Last Change : 2016 Nov 08
|
||||
Last Change : 2017 Jan 16
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -1238,7 +1238,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>8.0</string>
|
||||
<string>${VIM_SHORT_VERSION_STRING}</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>VIMM</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
@@ -1255,7 +1255,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>121</string>
|
||||
<string>126</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
|
||||
+3
-1
@@ -285,8 +285,10 @@ MSVCRT_VER = ($(MSVCVER) / 10 - 50)
|
||||
# Base name of the msvcrXX.dll
|
||||
!if $(MSVCRT_VER) <= 60
|
||||
MSVCRT_NAME = msvcrt
|
||||
!else
|
||||
!elseif $(MSVCRT_VER) <= 130
|
||||
MSVCRT_NAME = msvcr$(MSVCRT_VER)
|
||||
!else
|
||||
MSVCRT_NAME = vcruntime$(MSVCRT_VER)
|
||||
!endif
|
||||
|
||||
!if $(MSVC_MAJOR) == 6
|
||||
|
||||
+64
-18
@@ -1601,14 +1601,16 @@ EXTRA_SRC = hangulin.c if_lua.c if_mzsch.c auto/if_perl.c if_perlsfio.c \
|
||||
# Unittest files
|
||||
JSON_TEST_SRC = json_test.c
|
||||
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_TARGET = memfile_test$(EXEEXT)
|
||||
MESSAGE_TEST_SRC = message_test.c
|
||||
MESSAGE_TEST_TARGET = message_test$(EXEEXT)
|
||||
|
||||
UNITTEST_SRC = $(JSON_TEST_SRC) $(MEMFILE_TEST_SRC) $(MESSAGE_TEST_SRC)
|
||||
UNITTEST_TARGETS = $(JSON_TEST_TARGET) $(MEMFILE_TEST_TARGET) $(MESSAGE_TEST_TARGET)
|
||||
RUN_UNITTESTS = run_json_test run_memfile_test run_message_test
|
||||
UNITTEST_SRC = $(JSON_TEST_SRC) $(KWORD_TEST_SRC) $(MEMFILE_TEST_SRC) $(MESSAGE_TEST_SRC)
|
||||
UNITTEST_TARGETS = $(JSON_TEST_TARGET) $(KWORD_TEST_TARGET) $(MEMFILE_TEST_TARGET) $(MESSAGE_TEST_TARGET)
|
||||
RUN_UNITTESTS = run_json_test run_kword_test run_memfile_test run_message_test
|
||||
|
||||
# All sources, also the ones that are not configured
|
||||
ALL_SRC = $(BASIC_SRC) $(ALL_GUI_SRC) $(UNITTEST_SRC) $(EXTRA_SRC)
|
||||
@@ -1628,7 +1630,6 @@ OBJ_COMMON = \
|
||||
objects/arabic.o \
|
||||
objects/buffer.o \
|
||||
objects/blowfish.o \
|
||||
objects/charset.o \
|
||||
objects/crypt.o \
|
||||
objects/crypt_zip.o \
|
||||
objects/dict.o \
|
||||
@@ -1696,6 +1697,7 @@ OBJ_COMMON = \
|
||||
|
||||
# The files included by tests are not in OBJ_COMMON.
|
||||
OBJ_MAIN = \
|
||||
objects/charset.o \
|
||||
objects/json.o \
|
||||
objects/main.o \
|
||||
objects/memfile.o \
|
||||
@@ -1704,13 +1706,23 @@ OBJ_MAIN = \
|
||||
OBJ = $(OBJ_COMMON) $(OBJ_MAIN)
|
||||
|
||||
OBJ_JSON_TEST = \
|
||||
objects/charset.o \
|
||||
objects/memfile.o \
|
||||
objects/message.o \
|
||||
objects/json_test.o
|
||||
|
||||
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 = \
|
||||
objects/charset.o \
|
||||
objects/json.o \
|
||||
objects/message.o \
|
||||
objects/memfile_test.o
|
||||
@@ -1718,6 +1730,7 @@ OBJ_MEMFILE_TEST = \
|
||||
MEMFILE_TEST_OBJ = $(OBJ_COMMON) $(OBJ_MEMFILE_TEST)
|
||||
|
||||
OBJ_MESSAGE_TEST = \
|
||||
objects/charset.o \
|
||||
objects/json.o \
|
||||
objects/memfile.o \
|
||||
objects/message_test.o
|
||||
@@ -1727,6 +1740,7 @@ MESSAGE_TEST_OBJ = $(OBJ_COMMON) $(OBJ_MESSAGE_TEST)
|
||||
ALL_OBJ = $(OBJ_COMMON) \
|
||||
$(OBJ_MAIN) \
|
||||
$(OBJ_JSON_TEST) \
|
||||
$(OBJ_KWORD_TEST) \
|
||||
$(OBJ_MEMFILE_TEST) \
|
||||
$(OBJ_MESSAGE_TEST)
|
||||
|
||||
@@ -1894,7 +1908,9 @@ myself:
|
||||
|
||||
|
||||
# The normal command to compile a .c file to its .o file.
|
||||
CCC = $(CC) -c -I$(srcdir) $(ALL_CFLAGS)
|
||||
# Without or with ALL_CFLAGS.
|
||||
CCC_NF = $(CC) -c -I$(srcdir)
|
||||
CCC = $(CCC_NF) $(ALL_CFLAGS)
|
||||
|
||||
|
||||
# Link the target for normal use or debugging.
|
||||
@@ -2051,6 +2067,9 @@ unittest unittests: $(RUN_UNITTESTS)
|
||||
run_json_test: $(JSON_TEST_TARGET)
|
||||
$(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)
|
||||
$(VALGRIND) ./$(MEMFILE_TEST_TARGET) || exit 1; echo $* passed;
|
||||
|
||||
@@ -2073,7 +2092,6 @@ test1 \
|
||||
test_listlbr \
|
||||
test_listlbr_utf8 \
|
||||
test_search_mbyte \
|
||||
test_utf8 \
|
||||
test_wordcount \
|
||||
test3 test4 test5 test6 test7 test8 test9 \
|
||||
test11 test12 test14 test15 test17 test18 test19 \
|
||||
@@ -2126,8 +2144,9 @@ test_arglist \
|
||||
test_fnameescape \
|
||||
test_fnamemodify \
|
||||
test_fold \
|
||||
test_glob2regpat \
|
||||
test_ga \
|
||||
test_gf \
|
||||
test_glob2regpat \
|
||||
test_gn \
|
||||
test_goto \
|
||||
test_gui \
|
||||
@@ -2146,6 +2165,7 @@ test_arglist \
|
||||
test_langmap \
|
||||
test_largefile \
|
||||
test_lispwords \
|
||||
test_lua \
|
||||
test_man \
|
||||
test_mapping \
|
||||
test_marks \
|
||||
@@ -2162,20 +2182,28 @@ test_arglist \
|
||||
test_options \
|
||||
test_packadd \
|
||||
test_partial \
|
||||
test_paste \
|
||||
test_perl \
|
||||
test_popup \
|
||||
test_profile \
|
||||
test_put \
|
||||
test_python2 \
|
||||
test_python3 \
|
||||
test_pyx2 \
|
||||
test_pyx3 \
|
||||
test_quickfix \
|
||||
test_regexp_latin \
|
||||
test_regexp_utf8 \
|
||||
test_reltime \
|
||||
test_retab \
|
||||
test_ruby \
|
||||
test_search \
|
||||
test_searchpos \
|
||||
test_set \
|
||||
test_signs \
|
||||
test_smartindent \
|
||||
test_sort \
|
||||
test_source_utf8 \
|
||||
test_smartindent \
|
||||
test_startup \
|
||||
test_startup_utf8 \
|
||||
test_stat \
|
||||
@@ -2188,12 +2216,14 @@ test_arglist \
|
||||
test_tabpage \
|
||||
test_tagcase \
|
||||
test_tagjump \
|
||||
test_tcl \
|
||||
test_textobjects \
|
||||
test_timers \
|
||||
test_true_false \
|
||||
test_undo \
|
||||
test_unlet \
|
||||
test_usercommands \
|
||||
test_utf8 \
|
||||
test_viminfo \
|
||||
test_viml \
|
||||
test_visual \
|
||||
@@ -2231,6 +2261,13 @@ $(JSON_TEST_TARGET): auto/config.mk objects $(JSON_TEST_OBJ)
|
||||
MAKE="$(MAKE)" LINK_AS_NEEDED=$(LINK_AS_NEEDED) \
|
||||
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)
|
||||
$(CCC) version.c -o objects/version.o
|
||||
@LINK="$(PURIFY) $(SHRPENV) $(CClink) $(ALL_LIB_DIRS) $(LDFLAGS) \
|
||||
@@ -2765,6 +2802,7 @@ shadow: runtime pixmaps
|
||||
../../testdir/*.vim \
|
||||
../../testdir/*.py \
|
||||
../../testdir/python* \
|
||||
../../testdir/pyxfile \
|
||||
../../testdir/sautest \
|
||||
../../testdir/samples \
|
||||
../../testdir/test83-tags? \
|
||||
@@ -2998,7 +3036,7 @@ objects/gui_gtk_f.o: gui_gtk_f.c
|
||||
$(CCC) -o $@ gui_gtk_f.c
|
||||
|
||||
objects/gui_gtk_gresources.o: auto/gui_gtk_gresources.c
|
||||
$(CCC) $(PERL_CFLAGS) -o $@ auto/gui_gtk_gresources.c
|
||||
$(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) -o $@ auto/gui_gtk_gresources.c
|
||||
|
||||
objects/gui_gtk_x11.o: gui_gtk_x11.c
|
||||
$(CCC) -o $@ gui_gtk_x11.c
|
||||
@@ -3034,7 +3072,7 @@ objects/if_xcmdsrv.o: if_xcmdsrv.c
|
||||
$(CCC) -o $@ if_xcmdsrv.c
|
||||
|
||||
objects/if_lua.o: if_lua.c
|
||||
$(CCC) $(LUA_CFLAGS) -o $@ if_lua.c
|
||||
$(CCC_NF) $(LUA_CFLAGS) $(ALL_CFLAGS) -o $@ if_lua.c
|
||||
|
||||
objects/if_mzsch.o: if_mzsch.c $(MZSCHEME_EXTRA)
|
||||
$(CCC) -o $@ $(MZSCHEME_CFLAGS_EXTRA) if_mzsch.c
|
||||
@@ -3043,27 +3081,28 @@ mzscheme_base.c:
|
||||
$(MZSCHEME_MZC) --c-mods mzscheme_base.c ++lib scheme/base
|
||||
|
||||
objects/if_perl.o: auto/if_perl.c
|
||||
$(CCC) $(PERL_CFLAGS) -o $@ auto/if_perl.c
|
||||
$(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) -o $@ auto/if_perl.c
|
||||
|
||||
objects/if_perlsfio.o: if_perlsfio.c
|
||||
$(CCC) $(PERL_CFLAGS) -o $@ if_perlsfio.c
|
||||
$(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) -o $@ if_perlsfio.c
|
||||
|
||||
objects/py_getpath.o: $(PYTHON_CONFDIR)/getpath.c
|
||||
$(CCC) $(PYTHON_CFLAGS) -o $@ $(PYTHON_CONFDIR)/getpath.c \
|
||||
$(CCC_NF) $(PYTHON_CFLAGS) $(ALL_CFLAGS) -o $@ \
|
||||
$(PYTHON_CONFDIR)/getpath.c \
|
||||
-I$(PYTHON_CONFDIR) -DHAVE_CONFIG_H -DNO_MAIN \
|
||||
$(PYTHON_GETPATH_CFLAGS)
|
||||
|
||||
objects/if_python.o: if_python.c if_py_both.h
|
||||
$(CCC) $(PYTHON_CFLAGS) $(PYTHON_CFLAGS_EXTRA) -o $@ if_python.c
|
||||
$(CCC_NF) $(PYTHON_CFLAGS) $(PYTHON_CFLAGS_EXTRA) $(ALL_CFLAGS) -o $@ if_python.c
|
||||
|
||||
objects/if_python3.o: if_python3.c if_py_both.h
|
||||
$(CCC) $(PYTHON3_CFLAGS) $(PYTHON3_CFLAGS_EXTRA) -o $@ if_python3.c
|
||||
$(CCC_NF) $(PYTHON3_CFLAGS) $(PYTHON3_CFLAGS_EXTRA) $(ALL_CFLAGS) -o $@ if_python3.c
|
||||
|
||||
objects/if_ruby.o: if_ruby.c
|
||||
$(CCC) $(RUBY_CFLAGS) -o $@ if_ruby.c
|
||||
$(CCC_NF) $(RUBY_CFLAGS) $(ALL_CFLAGS) -o $@ if_ruby.c
|
||||
|
||||
objects/if_tcl.o: if_tcl.c
|
||||
$(CCC) $(TCL_CFLAGS) -o $@ if_tcl.c
|
||||
$(CCC_NF) $(TCL_CFLAGS) $(ALL_CFLAGS) -o $@ if_tcl.c
|
||||
|
||||
objects/integration.o: integration.c
|
||||
$(CCC) -o $@ integration.c
|
||||
@@ -3074,6 +3113,9 @@ objects/json.o: json.c
|
||||
objects/json_test.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
|
||||
$(CCC) -o $@ list.c
|
||||
|
||||
@@ -3120,7 +3162,7 @@ objects/ops.o: ops.c
|
||||
$(CCC) -o $@ ops.c
|
||||
|
||||
objects/option.o: option.c
|
||||
$(CCC) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS) -o $@ option.c
|
||||
$(CCC_NF) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS) $(ALL_CFLAGS) -o $@ option.c
|
||||
|
||||
objects/os_beos.o: os_beos.c
|
||||
$(CCC) -o $@ os_beos.c
|
||||
@@ -3646,6 +3688,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 \
|
||||
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
|
||||
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 \
|
||||
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 \
|
||||
|
||||
Vendored
+5
@@ -14192,6 +14192,11 @@ $as_echo "using default" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
vim_short_version_string=`grep 'define.*VIM_VERSION_SHORT' $srcdir/version.h|sed -E -e 's/.*"([0-9.]*)".*/\1/'`
|
||||
snapshot=`grep -C2 "Add new patch number below this line" $srcdir/version.c|tail -1|sed -E -e 's/^ *([0-9]+),.*/\1/'`
|
||||
vim_short_version_string="$vim_short_version_string.$snapshot"
|
||||
XCODEFLAGS="$XCODEFLAGS VIM_SHORT_VERSION_STRING=$vim_short_version_string"
|
||||
|
||||
|
||||
fi
|
||||
|
||||
|
||||
+9
-5
@@ -113,16 +113,19 @@ read_buffer(
|
||||
* it can be changed there. */
|
||||
if (!readonlymode && !bufempty())
|
||||
changed();
|
||||
else if (retval != FAIL)
|
||||
else if (retval == OK)
|
||||
unchanged(curbuf, FALSE);
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (retval == OK)
|
||||
{
|
||||
# ifdef FEAT_EVAL
|
||||
apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
|
||||
apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
|
||||
curbuf, &retval);
|
||||
# else
|
||||
apply_autocmds(EVENT_STDINREADPOST, NULL, NULL, FALSE, curbuf);
|
||||
apply_autocmds(EVENT_STDINREADPOST, NULL, NULL, FALSE, curbuf);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return retval;
|
||||
@@ -294,7 +297,7 @@ open_buffer(
|
||||
#endif
|
||||
)
|
||||
changed();
|
||||
else if (retval != FAIL && !read_stdin && !read_fifo)
|
||||
else if (retval == OK && !read_stdin && !read_fifo)
|
||||
unchanged(curbuf, FALSE);
|
||||
save_file_ff(curbuf); /* keep this fileformat */
|
||||
|
||||
@@ -328,7 +331,7 @@ open_buffer(
|
||||
# endif
|
||||
#endif
|
||||
|
||||
if (retval != FAIL)
|
||||
if (retval == OK)
|
||||
{
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/*
|
||||
@@ -2154,6 +2157,7 @@ free_buf_options(
|
||||
#if defined(FEAT_CRYPT)
|
||||
clear_string_option(&buf->b_p_cm);
|
||||
#endif
|
||||
clear_string_option(&buf->b_p_fp);
|
||||
#if defined(FEAT_EVAL)
|
||||
clear_string_option(&buf->b_p_fex);
|
||||
#endif
|
||||
|
||||
+8
-1
@@ -731,7 +731,14 @@ channel_open(
|
||||
channel_free(channel);
|
||||
return NULL;
|
||||
}
|
||||
memcpy((char *)&server.sin_addr, host->h_addr, host->h_length);
|
||||
{
|
||||
char *p;
|
||||
|
||||
/* When using host->h_addr directly ubsan warns for it to not be
|
||||
* aligned. First copy the pointer to aviod that. */
|
||||
memcpy(&p, &host->h_addr, sizeof(p));
|
||||
memcpy((char *)&server.sin_addr, p, host->h_length);
|
||||
}
|
||||
|
||||
/* On Mac and Solaris a zero timeout almost never works. At least wait
|
||||
* one millisecond. Let's do it for all systems, because we don't know why
|
||||
|
||||
+49
-17
@@ -899,16 +899,17 @@ vim_iswordc(int c)
|
||||
int
|
||||
vim_iswordc_buf(int c, buf_T *buf)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (c >= 0x100)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (enc_dbcs != 0)
|
||||
return dbcs_class((unsigned)c >> 8, (unsigned)(c & 0xff)) >= 2;
|
||||
if (enc_utf8)
|
||||
return utf_class(c) >= 2;
|
||||
}
|
||||
return utf_class_buf(c, buf) >= 2;
|
||||
#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
|
||||
vim_iswordp(char_u *p)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte && MB_BYTE2LEN(*p) > 1)
|
||||
return mb_get_class(p) >= 2;
|
||||
#endif
|
||||
return GET_CHARTAB(curbuf, *p) != 0;
|
||||
return vim_iswordp_buf(p, curbuf);
|
||||
}
|
||||
|
||||
int
|
||||
vim_iswordp_buf(char_u *p, buf_T *buf)
|
||||
{
|
||||
int c = *p;
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte && MB_BYTE2LEN(*p) > 1)
|
||||
return mb_get_class(p) >= 2;
|
||||
if (has_mbyte && MB_BYTE2LEN(c) > 1)
|
||||
c = (*mb_ptr2char)(p);
|
||||
#endif
|
||||
return (GET_CHARTAB(buf, *p) != 0);
|
||||
return vim_iswordc_buf(c, buf);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1296,7 +1295,14 @@ getvcol(
|
||||
if (pos->col == MAXCOL)
|
||||
posptr = NULL; /* continue until the NUL */
|
||||
else
|
||||
{
|
||||
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.
|
||||
@@ -1901,7 +1907,11 @@ vim_str2nr(
|
||||
n += 2; /* skip over "0b" */
|
||||
while ('0' <= *ptr && *ptr <= '1')
|
||||
{
|
||||
un = 2 * un + (unsigned long)(*ptr - '0');
|
||||
/* avoid ubsan error for overflow */
|
||||
if (un < UVARNUM_MAX / 2)
|
||||
un = 2 * un + (unsigned long)(*ptr - '0');
|
||||
else
|
||||
un = UVARNUM_MAX;
|
||||
++ptr;
|
||||
if (n++ == maxlen)
|
||||
break;
|
||||
@@ -1912,7 +1922,11 @@ vim_str2nr(
|
||||
/* octal */
|
||||
while ('0' <= *ptr && *ptr <= '7')
|
||||
{
|
||||
un = 8 * un + (uvarnumber_T)(*ptr - '0');
|
||||
/* avoid ubsan error for overflow */
|
||||
if (un < UVARNUM_MAX / 8)
|
||||
un = 8 * un + (uvarnumber_T)(*ptr - '0');
|
||||
else
|
||||
un = UVARNUM_MAX;
|
||||
++ptr;
|
||||
if (n++ == maxlen)
|
||||
break;
|
||||
@@ -1925,7 +1939,11 @@ vim_str2nr(
|
||||
n += 2; /* skip over "0x" */
|
||||
while (vim_isxdigit(*ptr))
|
||||
{
|
||||
un = 16 * un + (uvarnumber_T)hex2nr(*ptr);
|
||||
/* avoid ubsan error for overflow */
|
||||
if (un < UVARNUM_MAX / 16)
|
||||
un = 16 * un + (uvarnumber_T)hex2nr(*ptr);
|
||||
else
|
||||
un = UVARNUM_MAX;
|
||||
++ptr;
|
||||
if (n++ == maxlen)
|
||||
break;
|
||||
@@ -1936,7 +1954,11 @@ vim_str2nr(
|
||||
/* decimal */
|
||||
while (VIM_ISDIGIT(*ptr))
|
||||
{
|
||||
un = 10 * un + (uvarnumber_T)(*ptr - '0');
|
||||
/* avoid ubsan error for overflow */
|
||||
if (un < UVARNUM_MAX / 10)
|
||||
un = 10 * un + (uvarnumber_T)(*ptr - '0');
|
||||
else
|
||||
un = UVARNUM_MAX;
|
||||
++ptr;
|
||||
if (n++ == maxlen)
|
||||
break;
|
||||
@@ -1950,9 +1972,19 @@ vim_str2nr(
|
||||
if (nptr != NULL)
|
||||
{
|
||||
if (negative) /* account for leading '-' for decimal numbers */
|
||||
*nptr = -(varnumber_T)un;
|
||||
{
|
||||
/* avoid ubsan error for overflow */
|
||||
if (un > VARNUM_MAX)
|
||||
*nptr = VARNUM_MIN;
|
||||
else
|
||||
*nptr = -(varnumber_T)un;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (un > VARNUM_MAX)
|
||||
un = VARNUM_MAX;
|
||||
*nptr = (varnumber_T)un;
|
||||
}
|
||||
}
|
||||
if (unptr != NULL)
|
||||
*unptr = un;
|
||||
|
||||
@@ -4347,6 +4347,12 @@ if test "x$MACOSX" = "xyes"; then
|
||||
AC_MSG_RESULT($withval) ],
|
||||
[ AC_MSG_RESULT(using default) ])
|
||||
|
||||
dnl Set CFBundleShortVersionString of Info.plist
|
||||
vim_short_version_string=`grep 'define.*VIM_VERSION_SHORT' $srcdir/version.h|sed -E -e 's/.*"([[0-9.]]*)".*/\1/'`
|
||||
snapshot=`grep -C2 "Add new patch number below this line" $srcdir/version.c|tail -1|sed -E -e 's/^ *([[0-9]]+),.*/\1/'`
|
||||
vim_short_version_string="$vim_short_version_string.$snapshot"
|
||||
XCODEFLAGS="$XCODEFLAGS VIM_SHORT_VERSION_STRING=$vim_short_version_string"
|
||||
|
||||
AC_SUBST(XCODEFLAGS)
|
||||
fi
|
||||
|
||||
|
||||
+134
-10
@@ -309,6 +309,7 @@ static int dont_sync_undo = FALSE; /* CTRL-G U prevents syncing undo for
|
||||
* "cmdchar" can be:
|
||||
* 'i' normal insert command
|
||||
* 'a' normal append command
|
||||
* K_PS bracketed paste
|
||||
* 'R' replace command
|
||||
* 'r' "r<CR>" command: insert one <CR>. Note: count can be > 1, for redo,
|
||||
* but still only one <CR> is inserted. The <Esc> is not used for redo.
|
||||
@@ -462,7 +463,10 @@ edit(
|
||||
else
|
||||
#endif
|
||||
{
|
||||
AppendCharToRedobuff(cmdchar);
|
||||
if (cmdchar == K_PS)
|
||||
AppendCharToRedobuff('a');
|
||||
else
|
||||
AppendCharToRedobuff(cmdchar);
|
||||
if (cmdchar == 'g') /* "gI" command */
|
||||
AppendCharToRedobuff('I');
|
||||
else if (cmdchar == 'r') /* "r<CR>" command */
|
||||
@@ -530,6 +534,10 @@ edit(
|
||||
revins_legal = 0;
|
||||
revins_scol = -1;
|
||||
#endif
|
||||
if (!p_ek)
|
||||
/* Disable bracketed paste mode, we won't recognize the escape
|
||||
* sequences. */
|
||||
out_str(T_BD);
|
||||
|
||||
/*
|
||||
* Handle restarting Insert mode.
|
||||
@@ -782,10 +790,14 @@ edit(
|
||||
dont_sync_undo = TRUE;
|
||||
else
|
||||
dont_sync_undo = FALSE;
|
||||
do
|
||||
{
|
||||
c = safe_vgetc();
|
||||
} while (c == K_IGNORE);
|
||||
if (cmdchar == K_PS)
|
||||
/* Got here from normal mode when bracketed paste started. */
|
||||
c = K_PS;
|
||||
else
|
||||
do
|
||||
{
|
||||
c = safe_vgetc();
|
||||
} while (c == K_IGNORE);
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* Don't want K_CURSORHOLD for the second key, e.g., after CTRL-V. */
|
||||
@@ -1025,7 +1037,7 @@ doESCkey:
|
||||
case Ctrl_Z: /* suspend when 'insertmode' set */
|
||||
if (!p_im)
|
||||
goto normalchar; /* insert CTRL-Z as normal char */
|
||||
stuffReadbuff((char_u *)":st\r");
|
||||
do_cmdline_cmd((char_u *)"stop");
|
||||
c = Ctrl_O;
|
||||
/*FALLTHROUGH*/
|
||||
|
||||
@@ -1202,6 +1214,16 @@ doESCkey:
|
||||
break;
|
||||
# endif
|
||||
#endif
|
||||
case K_PS:
|
||||
bracketed_paste(PASTE_INSERT, FALSE, NULL);
|
||||
if (cmdchar == K_PS)
|
||||
/* invoked from normal mode, bail out */
|
||||
goto doESCkey;
|
||||
break;
|
||||
case K_PE:
|
||||
/* Got K_PE without K_PS, ignore. */
|
||||
break;
|
||||
|
||||
#ifdef FEAT_GUI_TABLINE
|
||||
case K_TABLINE:
|
||||
case K_TABMENU:
|
||||
@@ -2808,6 +2830,7 @@ set_completion(colnr_T startcol, list_T *list)
|
||||
if (ctrl_x_mode != 0)
|
||||
ins_compl_prep(' ');
|
||||
ins_compl_clear();
|
||||
ins_compl_free();
|
||||
|
||||
compl_direction = FORWARD;
|
||||
if (startcol > curwin->w_cursor.col)
|
||||
@@ -6157,6 +6180,9 @@ insertchar(
|
||||
&& (!has_mbyte || MB_BYTE2LEN_CHECK(c) == 1)
|
||||
#endif
|
||||
&& i < INPUT_BUFLEN
|
||||
# ifdef FEAT_FKMAP
|
||||
&& !(p_fkmap && KeyTyped) /* Farsi mode mapping moves cursor */
|
||||
# endif
|
||||
&& (textwidth == 0
|
||||
|| (virtcol += byte2cells(buf[i - 1])) < (colnr_T)textwidth)
|
||||
&& !(!no_abbr && !vim_iswordc(c) && vim_iswordc(buf[i - 1])))
|
||||
@@ -6165,10 +6191,6 @@ insertchar(
|
||||
c = vgetc();
|
||||
if (p_hkmap && KeyTyped)
|
||||
c = hkmap(c); /* Hebrew mode mapping */
|
||||
# ifdef FEAT_FKMAP
|
||||
if (p_fkmap && KeyTyped)
|
||||
c = fkmap(c); /* Farsi mode mapping */
|
||||
# endif
|
||||
buf[i++] = c;
|
||||
#else
|
||||
buf[i++] = vgetc();
|
||||
@@ -8619,6 +8641,9 @@ ins_esc(
|
||||
#ifdef CURSOR_SHAPE
|
||||
ui_cursor_shape(); /* may show different cursor shape */
|
||||
#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.
|
||||
@@ -9457,6 +9482,105 @@ ins_mousescroll(int dir)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Handle receiving P_PS: start paste mode. Inserts the following text up to
|
||||
* P_PE literally.
|
||||
* When "drop" is TRUE then consume the text and drop it.
|
||||
*/
|
||||
int
|
||||
bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
|
||||
{
|
||||
int c;
|
||||
char_u buf[NUMBUFLEN + MB_MAXBYTES];
|
||||
int idx = 0;
|
||||
char_u *end = find_termcode((char_u *)"PE");
|
||||
int ret_char = -1;
|
||||
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 (STRLEN(end) >= NUMBUFLEN)
|
||||
end = NULL;
|
||||
++no_mapping;
|
||||
allow_keys = 0;
|
||||
p_paste = TRUE;
|
||||
curbuf->b_p_ai = FALSE;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
/* When the end is not defined read everything. */
|
||||
if (end == NULL && vpeekc() == NUL)
|
||||
break;
|
||||
c = plain_vgetc();
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
idx += (*mb_char2bytes)(c, buf + idx);
|
||||
else
|
||||
#endif
|
||||
buf[idx++] = c;
|
||||
buf[idx] = NUL;
|
||||
if (end != NUL && STRNCMP(buf, end, idx) == 0)
|
||||
{
|
||||
if (end[idx] == NUL)
|
||||
break; /* Found the end of paste code. */
|
||||
continue;
|
||||
}
|
||||
if (!drop)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case PASTE_CMDLINE:
|
||||
put_on_cmdline(buf, idx, TRUE);
|
||||
break;
|
||||
|
||||
case PASTE_EX:
|
||||
if (gap != NULL && ga_grow(gap, idx) == OK)
|
||||
{
|
||||
mch_memmove((char *)gap->ga_data + gap->ga_len,
|
||||
buf, (size_t)idx);
|
||||
gap->ga_len += idx;
|
||||
}
|
||||
break;
|
||||
|
||||
case PASTE_INSERT:
|
||||
if (stop_arrow() == OK)
|
||||
{
|
||||
c = buf[0];
|
||||
if (idx == 1 && (c == CAR || c == K_KENTER || c == NL))
|
||||
ins_eol(c);
|
||||
else
|
||||
{
|
||||
ins_char_bytes(buf, idx);
|
||||
AppendToRedobuffLit(buf, idx);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case PASTE_ONE_CHAR:
|
||||
if (ret_char == -1)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
ret_char = (*mb_ptr2char)(buf);
|
||||
else
|
||||
#endif
|
||||
ret_char = buf[0];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
idx = 0;
|
||||
}
|
||||
|
||||
--no_mapping;
|
||||
allow_keys = save_allow_keys;
|
||||
p_paste = save_paste;
|
||||
curbuf->b_p_ai = save_ai;
|
||||
|
||||
return ret_char;
|
||||
}
|
||||
|
||||
#if defined(FEAT_GUI_TABLINE) || defined(PROTO)
|
||||
static void
|
||||
ins_tabline(int c)
|
||||
|
||||
+48
-31
@@ -242,14 +242,38 @@ static void list_one_var(dictitem_T *v, char_u *prefix, int *first);
|
||||
static void list_one_var_a(char_u *prefix, char_u *name, int type, char_u *string, int *first);
|
||||
static char_u *find_option_end(char_u **arg, int *opt_flags);
|
||||
|
||||
#ifdef EBCDIC
|
||||
static int compare_func_name(const void *s1, const void *s2);
|
||||
static void sortFunctions();
|
||||
#endif
|
||||
|
||||
/* for VIM_VERSION_ defines */
|
||||
#include "version.h"
|
||||
|
||||
|
||||
#if defined(EBCDIC) || defined(PROTO)
|
||||
/*
|
||||
* Compare struct fst by function name.
|
||||
*/
|
||||
static int
|
||||
compare_func_name(const void *s1, const void *s2)
|
||||
{
|
||||
struct fst *p1 = (struct fst *)s1;
|
||||
struct fst *p2 = (struct fst *)s2;
|
||||
|
||||
return STRCMP(p1->f_name, p2->f_name);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sort the function table by function name.
|
||||
* The sorting of the table above is ASCII dependant.
|
||||
* On machines using EBCDIC we have to sort it.
|
||||
*/
|
||||
static void
|
||||
sortFunctions(void)
|
||||
{
|
||||
int funcCnt = (int)(sizeof(functions) / sizeof(struct fst)) - 1;
|
||||
|
||||
qsort(functions, (size_t)funcCnt, sizeof(struct fst), compare_func_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Initialize the global and v: variables.
|
||||
*/
|
||||
@@ -4085,21 +4109,12 @@ eval6(
|
||||
{
|
||||
if (n2 == 0) /* give an error message? */
|
||||
{
|
||||
#ifdef FEAT_NUM64
|
||||
if (n1 == 0)
|
||||
n1 = -0x7fffffffffffffffLL - 1; /* similar to NaN */
|
||||
n1 = VARNUM_MIN; /* similar to NaN */
|
||||
else if (n1 < 0)
|
||||
n1 = -0x7fffffffffffffffLL;
|
||||
n1 = -VARNUM_MAX;
|
||||
else
|
||||
n1 = 0x7fffffffffffffffLL;
|
||||
#else
|
||||
if (n1 == 0)
|
||||
n1 = -0x7fffffffL - 1L; /* similar to NaN */
|
||||
else if (n1 < 0)
|
||||
n1 = -0x7fffffffL;
|
||||
else
|
||||
n1 = 0x7fffffffL;
|
||||
#endif
|
||||
n1 = VARNUM_MAX;
|
||||
}
|
||||
else
|
||||
n1 = n1 / n2;
|
||||
@@ -9225,28 +9240,30 @@ fill_assert_error(
|
||||
|
||||
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);
|
||||
}
|
||||
else
|
||||
ga_concat_esc(gap, exp_str);
|
||||
if (atype != ASSERT_NOTEQUAL)
|
||||
{
|
||||
if (atype == ASSERT_MATCH || atype == ASSERT_NOTMATCH)
|
||||
ga_concat(gap, (char_u *)"Pattern ");
|
||||
else
|
||||
ga_concat(gap, (char_u *)"Expected ");
|
||||
if (exp_str == NULL)
|
||||
{
|
||||
ga_concat_esc(gap, tv2string(exp_tv, &tofree, numbuf, 0));
|
||||
vim_free(tofree);
|
||||
}
|
||||
else
|
||||
ga_concat_esc(gap, exp_str);
|
||||
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 if (atype == ASSERT_NOTEQUAL)
|
||||
ga_concat(gap, (char_u *)" differs from ");
|
||||
else
|
||||
ga_concat(gap, (char_u *)" but got ");
|
||||
ga_concat_esc(gap, tv2string(got_tv, &tofree, numbuf, 0));
|
||||
|
||||
+96
-111
@@ -289,6 +289,9 @@ static void f_py3eval(typval_T *argvars, typval_T *rettv);
|
||||
#ifdef FEAT_PYTHON
|
||||
static void f_pyeval(typval_T *argvars, typval_T *rettv);
|
||||
#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_readfile(typval_T *argvars, typval_T *rettv);
|
||||
static void f_reltime(typval_T *argvars, typval_T *rettv);
|
||||
@@ -715,6 +718,9 @@ static struct fst
|
||||
#endif
|
||||
#ifdef FEAT_PYTHON
|
||||
{"pyeval", 1, 1, f_pyeval},
|
||||
#endif
|
||||
#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
|
||||
{"pyxeval", 1, 1, f_pyxeval},
|
||||
#endif
|
||||
{"range", 1, 3, f_range},
|
||||
{"readfile", 1, 3, f_readfile},
|
||||
@@ -923,34 +929,6 @@ get_expr_name(expand_T *xp, int idx)
|
||||
|
||||
#endif /* FEAT_CMDL_COMPL */
|
||||
|
||||
#if defined(EBCDIC) || defined(PROTO)
|
||||
/*
|
||||
* Compare struct fst by function name.
|
||||
*/
|
||||
static int
|
||||
compare_func_name(const void *s1, const void *s2)
|
||||
{
|
||||
struct fst *p1 = (struct fst *)s1;
|
||||
struct fst *p2 = (struct fst *)s2;
|
||||
|
||||
return STRCMP(p1->f_name, p2->f_name);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sort the function table by function name.
|
||||
* The sorting of the table above is ASCII dependant.
|
||||
* On machines using EBCDIC we have to sort it.
|
||||
*/
|
||||
static void
|
||||
sortFunctions(void)
|
||||
{
|
||||
int funcCnt = (int)(sizeof(functions) / sizeof(struct fst)) - 1;
|
||||
|
||||
qsort(functions, (size_t)funcCnt, sizeof(struct fst), compare_func_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Find internal function in table above.
|
||||
* Return index, or -1 if not found
|
||||
@@ -2841,7 +2819,17 @@ f_execute(typval_T *argvars, typval_T *rettv)
|
||||
--list->lv_refcount;
|
||||
}
|
||||
|
||||
rettv->vval.v_string = redir_execute_ga.ga_data;
|
||||
/* Need to append a NUL to the result. */
|
||||
if (ga_grow(&redir_execute_ga, 1) == OK)
|
||||
{
|
||||
((char *)redir_execute_ga.ga_data)[redir_execute_ga.ga_len] = NUL;
|
||||
rettv->vval.v_string = redir_execute_ga.ga_data;
|
||||
}
|
||||
else
|
||||
{
|
||||
ga_clear(&redir_execute_ga);
|
||||
rettv->vval.v_string = NULL;
|
||||
}
|
||||
msg_silent = save_msg_silent;
|
||||
emsg_silent = save_emsg_silent;
|
||||
emsg_noredir = save_emsg_noredir;
|
||||
@@ -3332,21 +3320,12 @@ f_float2nr(typval_T *argvars, typval_T *rettv)
|
||||
|
||||
if (get_float_arg(argvars, &f) == OK)
|
||||
{
|
||||
# ifdef FEAT_NUM64
|
||||
if (f < -0x7fffffffffffffffLL)
|
||||
rettv->vval.v_number = -0x7fffffffffffffffLL;
|
||||
else if (f > 0x7fffffffffffffffLL)
|
||||
rettv->vval.v_number = 0x7fffffffffffffffLL;
|
||||
if (f < -VARNUM_MAX)
|
||||
rettv->vval.v_number = -VARNUM_MAX;
|
||||
else if (f > VARNUM_MAX)
|
||||
rettv->vval.v_number = VARNUM_MAX;
|
||||
else
|
||||
rettv->vval.v_number = (varnumber_T)f;
|
||||
# else
|
||||
if (f < -0x7fffffff)
|
||||
rettv->vval.v_number = -0x7fffffff;
|
||||
else if (f > 0x7fffffff)
|
||||
rettv->vval.v_number = 0x7fffffff;
|
||||
else
|
||||
rettv->vval.v_number = (varnumber_T)f;
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4259,7 +4238,7 @@ f_getchar(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
if (argvars[0].v_type == VAR_UNKNOWN)
|
||||
/* getchar(): blocking wait. */
|
||||
n = safe_vgetc();
|
||||
n = plain_vgetc();
|
||||
else if (get_tv_number_chk(&argvars[0], &error) == 1)
|
||||
/* getchar(1): only check if char avail */
|
||||
n = vpeekc_any();
|
||||
@@ -4268,7 +4247,7 @@ f_getchar(typval_T *argvars, typval_T *rettv)
|
||||
n = 0;
|
||||
else
|
||||
/* getchar(0) and char avail: return char */
|
||||
n = safe_vgetc();
|
||||
n = plain_vgetc();
|
||||
|
||||
if (n == K_IGNORE)
|
||||
continue;
|
||||
@@ -5784,15 +5763,13 @@ f_has(typval_T *argvars, typval_T *rettv)
|
||||
#ifdef FEAT_PERSISTENT_UNDO
|
||||
"persistent_undo",
|
||||
#endif
|
||||
#ifdef FEAT_PYTHON
|
||||
#ifndef DYNAMIC_PYTHON
|
||||
#if defined(FEAT_PYTHON) && !defined(DYNAMIC_PYTHON)
|
||||
"python",
|
||||
"pythonx",
|
||||
#endif
|
||||
#endif
|
||||
#ifdef FEAT_PYTHON3
|
||||
#ifndef DYNAMIC_PYTHON3
|
||||
#if defined(FEAT_PYTHON3) && !defined(DYNAMIC_PYTHON3)
|
||||
"python3",
|
||||
#endif
|
||||
"pythonx",
|
||||
#endif
|
||||
#ifdef FEAT_POSTSCRIPT
|
||||
"postscript",
|
||||
@@ -6028,17 +6005,30 @@ f_has(typval_T *argvars, typval_T *rettv)
|
||||
else if (STRICMP(name, "ruby") == 0)
|
||||
n = ruby_enabled(FALSE);
|
||||
#endif
|
||||
#ifdef FEAT_PYTHON
|
||||
#ifdef DYNAMIC_PYTHON
|
||||
else if (STRICMP(name, "python") == 0)
|
||||
n = python_enabled(FALSE);
|
||||
#endif
|
||||
#endif
|
||||
#ifdef FEAT_PYTHON3
|
||||
#ifdef DYNAMIC_PYTHON3
|
||||
else if (STRICMP(name, "python3") == 0)
|
||||
n = python3_enabled(FALSE);
|
||||
#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
|
||||
#ifdef DYNAMIC_PERL
|
||||
else if (STRICMP(name, "perl") == 0)
|
||||
@@ -6906,10 +6896,8 @@ f_len(typval_T *argvars, typval_T *rettv)
|
||||
}
|
||||
}
|
||||
|
||||
static void libcall_common(typval_T *argvars, typval_T *rettv, int type);
|
||||
|
||||
static void
|
||||
libcall_common(typval_T *argvars, typval_T *rettv, int type)
|
||||
libcall_common(typval_T *argvars UNUSED, typval_T *rettv, int type)
|
||||
{
|
||||
#ifdef FEAT_LIBCALL
|
||||
char_u *string_in;
|
||||
@@ -7814,21 +7802,26 @@ f_mode(typval_T *argvars, typval_T *rettv)
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (State & REPLACE_FLAG)
|
||||
buf[0] = 'R';
|
||||
else
|
||||
buf[0] = 'i';
|
||||
{
|
||||
if (State & REPLACE_FLAG)
|
||||
buf[0] = 'R';
|
||||
else
|
||||
buf[0] = 'i';
|
||||
#ifdef FEAT_INS_EXPAND
|
||||
if (ins_compl_active())
|
||||
buf[1] = 'c';
|
||||
else if (ctrl_x_mode == 1)
|
||||
buf[1] = 'x';
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (State & CMDLINE)
|
||||
else if ((State & CMDLINE) || exmode_active)
|
||||
{
|
||||
buf[0] = 'c';
|
||||
if (exmode_active)
|
||||
if (exmode_active == EXMODE_VIM)
|
||||
buf[1] = 'v';
|
||||
}
|
||||
else if (exmode_active)
|
||||
{
|
||||
buf[0] = 'c';
|
||||
buf[1] = 'e';
|
||||
else if (exmode_active == EXMODE_NORMAL)
|
||||
buf[1] = 'e';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -8065,6 +8058,9 @@ f_py3eval(typval_T *argvars, typval_T *rettv)
|
||||
char_u *str;
|
||||
char_u buf[NUMBUFLEN];
|
||||
|
||||
if (p_pyx == 0)
|
||||
p_pyx = 3;
|
||||
|
||||
str = get_tv_string_buf(&argvars[0], buf);
|
||||
do_py3eval(str, rettv);
|
||||
}
|
||||
@@ -8080,11 +8076,35 @@ f_pyeval(typval_T *argvars, typval_T *rettv)
|
||||
char_u *str;
|
||||
char_u buf[NUMBUFLEN];
|
||||
|
||||
if (p_pyx == 0)
|
||||
p_pyx = 2;
|
||||
|
||||
str = get_tv_string_buf(&argvars[0], buf);
|
||||
do_pyeval(str, rettv);
|
||||
}
|
||||
#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
|
||||
*/
|
||||
@@ -10158,20 +10178,15 @@ f_setpos(typval_T *argvars, typval_T *rettv)
|
||||
pos.col = 0;
|
||||
if (name[0] == '.' && name[1] == NUL)
|
||||
{
|
||||
/* set cursor */
|
||||
if (fnum == curbuf->b_fnum)
|
||||
/* set cursor; "fnum" is ignored */
|
||||
curwin->w_cursor = pos;
|
||||
if (curswant >= 0)
|
||||
{
|
||||
curwin->w_cursor = pos;
|
||||
if (curswant >= 0)
|
||||
{
|
||||
curwin->w_curswant = curswant - 1;
|
||||
curwin->w_set_curswant = FALSE;
|
||||
}
|
||||
check_cursor();
|
||||
rettv->vval.v_number = 0;
|
||||
curwin->w_curswant = curswant - 1;
|
||||
curwin->w_set_curswant = FALSE;
|
||||
}
|
||||
else
|
||||
EMSG(_(e_invarg));
|
||||
check_cursor();
|
||||
rettv->vval.v_number = 0;
|
||||
}
|
||||
else if (name[0] == '\'' && name[1] != NUL && name[2] == NUL)
|
||||
{
|
||||
@@ -11889,6 +11904,7 @@ get_cmd_output_as_rettv(
|
||||
if (buf == NULL)
|
||||
{
|
||||
EMSGN(_(e_nobufnr), argvars[1].vval.v_number);
|
||||
fclose(fd);
|
||||
goto errret;
|
||||
}
|
||||
|
||||
@@ -12568,39 +12584,8 @@ f_timer_stopall(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
static void
|
||||
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->vval.v_string = p;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
rettv->vval.v_string = strlow_save(get_tv_string(&argvars[0]));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+5
-1
@@ -1313,7 +1313,7 @@ do_filter(
|
||||
if (otmp != NULL)
|
||||
{
|
||||
if (readfile(otmp, NULL, line2, (linenr_T)0, (linenr_T)MAXLNUM,
|
||||
eap, READ_FILTER) == FAIL)
|
||||
eap, READ_FILTER) != OK)
|
||||
{
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
if (!aborting())
|
||||
@@ -5263,6 +5263,10 @@ do_sub(exarg_T *eap)
|
||||
setmouse(); /* disable mouse in xterm */
|
||||
#endif
|
||||
curwin->w_cursor.col = regmatch.startpos[0].col;
|
||||
#ifdef FEAT_CURSORBIND
|
||||
if (curwin->w_p_crb)
|
||||
do_check_cursorbind();
|
||||
#endif
|
||||
|
||||
/* When 'cpoptions' contains "u" don't sync undo when
|
||||
* asking for confirmation. */
|
||||
|
||||
+27
-14
@@ -65,7 +65,8 @@
|
||||
#define ADDR_LOADED_BUFFERS 3
|
||||
#define ADDR_BUFFERS 4
|
||||
#define ADDR_TABS 5
|
||||
#define ADDR_QUICKFIX 6
|
||||
#define ADDR_TABS_RELATIVE 6 /* Tab page that only relative */
|
||||
#define ADDR_QUICKFIX 7
|
||||
#define ADDR_OTHER 99
|
||||
|
||||
#ifndef DO_DECLARE_EXCMD
|
||||
@@ -1138,6 +1139,18 @@ EX(CMD_python3, "python3", ex_py3,
|
||||
EX(CMD_py3file, "py3file", ex_py3file,
|
||||
RANGE|FILE1|NEEDARG|CMDWIN,
|
||||
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,
|
||||
BANG|RANGE|COUNT|NOTADR|TRLBAR|CMDWIN,
|
||||
ADDR_WINDOWS),
|
||||
@@ -1419,9 +1432,9 @@ EX(CMD_tags, "tags", do_tags,
|
||||
ADDR_LINES),
|
||||
EX(CMD_tab, "tab", ex_wrongmodifier,
|
||||
NEEDARG|EXTRA|NOTRLCOM,
|
||||
ADDR_LINES),
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabclose, "tabclose", ex_tabclose,
|
||||
RANGE|NOTADR|COUNT|BANG|TRLBAR|CMDWIN,
|
||||
BANG|RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR|CMDWIN,
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabdo, "tabdo", ex_listdo,
|
||||
NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
|
||||
@@ -1434,34 +1447,34 @@ EX(CMD_tabfind, "tabfind", ex_splitview,
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabfirst, "tabfirst", ex_tabnext,
|
||||
TRLBAR,
|
||||
ADDR_LINES),
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabmove, "tabmove", ex_tabmove,
|
||||
RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR,
|
||||
ADDR_TABS),
|
||||
EX(CMD_tablast, "tablast", ex_tabnext,
|
||||
TRLBAR,
|
||||
ADDR_LINES),
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabnext, "tabnext", ex_tabnext,
|
||||
RANGE|NOTADR|COUNT|TRLBAR,
|
||||
ADDR_LINES),
|
||||
RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR,
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabnew, "tabnew", ex_splitview,
|
||||
BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR,
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabonly, "tabonly", ex_tabonly,
|
||||
BANG|RANGE|NOTADR|TRLBAR|CMDWIN,
|
||||
BANG|RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR|CMDWIN,
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabprevious, "tabprevious", ex_tabnext,
|
||||
RANGE|NOTADR|COUNT|TRLBAR,
|
||||
ADDR_LINES),
|
||||
RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR,
|
||||
ADDR_TABS_RELATIVE),
|
||||
EX(CMD_tabNext, "tabNext", ex_tabnext,
|
||||
RANGE|NOTADR|COUNT|TRLBAR,
|
||||
ADDR_LINES),
|
||||
RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR,
|
||||
ADDR_TABS_RELATIVE),
|
||||
EX(CMD_tabrewind, "tabrewind", ex_tabnext,
|
||||
TRLBAR,
|
||||
ADDR_LINES),
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabs, "tabs", ex_tabs,
|
||||
TRLBAR|CMDWIN,
|
||||
ADDR_LINES),
|
||||
ADDR_TABS),
|
||||
EX(CMD_tcl, "tcl", ex_tcl,
|
||||
RANGE|EXTRA|NEEDARG|CMDWIN,
|
||||
ADDR_LINES),
|
||||
|
||||
+206
-16
@@ -3748,6 +3748,194 @@ ex_options(
|
||||
}
|
||||
#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}"
|
||||
*/
|
||||
@@ -5164,24 +5352,10 @@ ex_language(exarg_T *eap)
|
||||
# if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
||||
|
||||
static char_u **locales = NULL; /* Array of all available locales */
|
||||
|
||||
# ifndef WIN32
|
||||
static int did_init_locales = FALSE;
|
||||
|
||||
static void init_locales(void);
|
||||
static char_u **find_locales(void);
|
||||
|
||||
/*
|
||||
* Lazy initialization of all available locales.
|
||||
*/
|
||||
static void
|
||||
init_locales(void)
|
||||
{
|
||||
if (!did_init_locales)
|
||||
{
|
||||
did_init_locales = TRUE;
|
||||
locales = find_locales();
|
||||
}
|
||||
}
|
||||
|
||||
/* Return an array of strings for all available locales + NULL for the
|
||||
* last element. Return NULL in case of error. */
|
||||
static char_u **
|
||||
@@ -5222,6 +5396,22 @@ find_locales(void)
|
||||
((char_u **)locales_ga.ga_data)[locales_ga.ga_len] = NULL;
|
||||
return (char_u **)locales_ga.ga_data;
|
||||
}
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Lazy initialization of all available locales.
|
||||
*/
|
||||
static void
|
||||
init_locales(void)
|
||||
{
|
||||
# ifndef WIN32
|
||||
if (!did_init_locales)
|
||||
{
|
||||
did_init_locales = TRUE;
|
||||
locales = find_locales();
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
# if defined(EXITFREE) || defined(PROTO)
|
||||
void
|
||||
|
||||
+225
-87
@@ -290,6 +290,11 @@ static void ex_popup(exarg_T *eap);
|
||||
# define ex_py3do ex_ni
|
||||
# define ex_py3file ex_ni
|
||||
#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
|
||||
# define ex_tcl ex_script_ni
|
||||
# define ex_tcldo ex_ni
|
||||
@@ -2164,8 +2169,7 @@ do_one_cmd(
|
||||
ea.line2 = curwin->w_cursor.lnum;
|
||||
break;
|
||||
case ADDR_WINDOWS:
|
||||
lnum = CURRENT_WIN_NR;
|
||||
ea.line2 = lnum;
|
||||
ea.line2 = CURRENT_WIN_NR;
|
||||
break;
|
||||
case ADDR_ARGUMENTS:
|
||||
ea.line2 = curwin->w_arg_idx + 1;
|
||||
@@ -2177,8 +2181,10 @@ do_one_cmd(
|
||||
ea.line2 = curbuf->b_fnum;
|
||||
break;
|
||||
case ADDR_TABS:
|
||||
lnum = CURRENT_TAB_NR;
|
||||
ea.line2 = lnum;
|
||||
ea.line2 = CURRENT_TAB_NR;
|
||||
break;
|
||||
case ADDR_TABS_RELATIVE:
|
||||
ea.line2 = 1;
|
||||
break;
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case ADDR_QUICKFIX:
|
||||
@@ -2237,6 +2243,10 @@ do_one_cmd(
|
||||
goto doend;
|
||||
}
|
||||
break;
|
||||
case ADDR_TABS_RELATIVE:
|
||||
errormsg = (char_u *)_(e_invrange);
|
||||
goto doend;
|
||||
break;
|
||||
case ADDR_ARGUMENTS:
|
||||
if (ARGCOUNT == 0)
|
||||
ea.line1 = ea.line2 = 0;
|
||||
@@ -2712,6 +2722,9 @@ do_one_cmd(
|
||||
case ADDR_TABS:
|
||||
ea.line2 = LAST_TAB_NR;
|
||||
break;
|
||||
case ADDR_TABS_RELATIVE:
|
||||
ea.line2 = 1;
|
||||
break;
|
||||
case ADDR_ARGUMENTS:
|
||||
if (ARGCOUNT == 0)
|
||||
ea.line1 = ea.line2 = 0;
|
||||
@@ -2788,7 +2801,8 @@ do_one_cmd(
|
||||
/*
|
||||
* Be vi compatible: no error message for out of range.
|
||||
*/
|
||||
if (ea.line2 > curbuf->b_ml.ml_line_count)
|
||||
if (ea.addr_type == ADDR_LINES
|
||||
&& ea.line2 > curbuf->b_ml.ml_line_count)
|
||||
ea.line2 = curbuf->b_ml.ml_line_count;
|
||||
}
|
||||
}
|
||||
@@ -4116,6 +4130,12 @@ set_one_cmd_context(
|
||||
case CMD_echoerr:
|
||||
case CMD_call:
|
||||
case CMD_return:
|
||||
case CMD_cexpr:
|
||||
case CMD_caddexpr:
|
||||
case CMD_cgetexpr:
|
||||
case CMD_lexpr:
|
||||
case CMD_laddexpr:
|
||||
case CMD_lgetexpr:
|
||||
set_context_for_expression(xp, arg, ea.cmdidx);
|
||||
break;
|
||||
|
||||
@@ -4433,6 +4453,11 @@ get_address(
|
||||
case ADDR_TABS:
|
||||
lnum = CURRENT_TAB_NR;
|
||||
break;
|
||||
case ADDR_TABS_RELATIVE:
|
||||
EMSG(_(e_invrange));
|
||||
cmd = NULL;
|
||||
goto error;
|
||||
break;
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case ADDR_QUICKFIX:
|
||||
lnum = qf_get_cur_valid_idx(eap);
|
||||
@@ -4470,6 +4495,11 @@ get_address(
|
||||
case ADDR_TABS:
|
||||
lnum = LAST_TAB_NR;
|
||||
break;
|
||||
case ADDR_TABS_RELATIVE:
|
||||
EMSG(_(e_invrange));
|
||||
cmd = NULL;
|
||||
goto error;
|
||||
break;
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case ADDR_QUICKFIX:
|
||||
lnum = qf_get_size(eap);
|
||||
@@ -4652,6 +4682,9 @@ get_address(
|
||||
case ADDR_TABS:
|
||||
lnum = CURRENT_TAB_NR;
|
||||
break;
|
||||
case ADDR_TABS_RELATIVE:
|
||||
lnum = 1;
|
||||
break;
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case ADDR_QUICKFIX:
|
||||
lnum = qf_get_cur_valid_idx(eap);
|
||||
@@ -4668,7 +4701,14 @@ get_address(
|
||||
n = 1;
|
||||
else
|
||||
n = getdigits(&cmd);
|
||||
if (addr_type == ADDR_LOADED_BUFFERS
|
||||
|
||||
if (addr_type == ADDR_TABS_RELATIVE)
|
||||
{
|
||||
EMSG(_(e_invrange));
|
||||
cmd = NULL;
|
||||
goto error;
|
||||
}
|
||||
else if (addr_type == ADDR_LOADED_BUFFERS
|
||||
|| addr_type == ADDR_BUFFERS)
|
||||
lnum = compute_buffer_local_count(
|
||||
addr_type, lnum, (i == '-') ? -1 * n : n);
|
||||
@@ -4801,6 +4841,9 @@ invalid_range(exarg_T *eap)
|
||||
if (eap->line2 > LAST_TAB_NR)
|
||||
return (char_u *)_(e_invrange);
|
||||
break;
|
||||
case ADDR_TABS_RELATIVE:
|
||||
/* Do nothing */
|
||||
break;
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case ADDR_QUICKFIX:
|
||||
if (eap->line2 != 1 && eap->line2 > qf_get_size(eap))
|
||||
@@ -7442,6 +7485,107 @@ ex_win_close(
|
||||
win_close_othertab(win, !need_hide && !P_HID(buf), tp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle the argument for a tabpage related ex command.
|
||||
* Returns a tabpage number.
|
||||
* When an error is encountered then eap->errmsg is set.
|
||||
*/
|
||||
static int
|
||||
get_tabpage_arg(exarg_T *eap)
|
||||
{
|
||||
int tab_number;
|
||||
int unaccept_arg0 = (eap->cmdidx == CMD_tabmove) ? 0 : 1;
|
||||
|
||||
if (eap->arg && *eap->arg != NUL)
|
||||
{
|
||||
char_u *p = eap->arg;
|
||||
char_u *p_save;
|
||||
int relative = 0; /* argument +N/-N means: go to N places to the
|
||||
* right/left relative to the current position. */
|
||||
|
||||
if (*p == '-')
|
||||
{
|
||||
relative = -1;
|
||||
p++;
|
||||
}
|
||||
else if (*p == '+')
|
||||
{
|
||||
relative = 1;
|
||||
p++;
|
||||
}
|
||||
|
||||
p_save = p;
|
||||
tab_number = getdigits(&p);
|
||||
|
||||
if (relative == 0)
|
||||
{
|
||||
if (STRCMP(p, "$") == 0)
|
||||
tab_number = LAST_TAB_NR;
|
||||
else if (p == p_save || *p_save == '-' || *p != NUL
|
||||
|| tab_number > LAST_TAB_NR)
|
||||
{
|
||||
/* No numbers as argument. */
|
||||
eap->errmsg = e_invarg;
|
||||
goto theend;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*p_save == NUL)
|
||||
tab_number = 1;
|
||||
else if (p == p_save || *p_save == '-' || *p != NUL
|
||||
|| tab_number == 0)
|
||||
{
|
||||
/* No numbers as argument. */
|
||||
eap->errmsg = e_invarg;
|
||||
goto theend;
|
||||
}
|
||||
tab_number = tab_number * relative + tabpage_index(curtab);
|
||||
if (!unaccept_arg0 && relative == -1)
|
||||
--tab_number;
|
||||
}
|
||||
if (tab_number < unaccept_arg0 || tab_number > LAST_TAB_NR)
|
||||
eap->errmsg = e_invarg;
|
||||
}
|
||||
else if (eap->addr_count > 0)
|
||||
{
|
||||
if (unaccept_arg0 && eap->line2 == 0)
|
||||
{
|
||||
eap->errmsg = e_invrange;
|
||||
tab_number = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
tab_number = eap->line2;
|
||||
if (!unaccept_arg0 && **eap->cmdlinep == '-')
|
||||
{
|
||||
--tab_number;
|
||||
if (tab_number < unaccept_arg0)
|
||||
eap->errmsg = e_invarg;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (eap->cmdidx)
|
||||
{
|
||||
case CMD_tabnext:
|
||||
tab_number = tabpage_index(curtab) + 1;
|
||||
if (tab_number > LAST_TAB_NR)
|
||||
tab_number = 1;
|
||||
break;
|
||||
case CMD_tabmove:
|
||||
tab_number = LAST_TAB_NR;
|
||||
break;
|
||||
default:
|
||||
tab_number = tabpage_index(curtab);
|
||||
}
|
||||
}
|
||||
|
||||
theend:
|
||||
return tab_number;
|
||||
}
|
||||
|
||||
/*
|
||||
* ":tabclose": close current tab page, unless it is the last one.
|
||||
* ":tabclose N": close tab page N.
|
||||
@@ -7450,6 +7594,7 @@ ex_win_close(
|
||||
ex_tabclose(exarg_T *eap)
|
||||
{
|
||||
tabpage_T *tp;
|
||||
int tab_number;
|
||||
|
||||
# ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
@@ -7460,9 +7605,10 @@ ex_tabclose(exarg_T *eap)
|
||||
EMSG(_("E784: Cannot close last tab page"));
|
||||
else
|
||||
{
|
||||
if (eap->addr_count > 0)
|
||||
tab_number = get_tabpage_arg(eap);
|
||||
if (eap->errmsg == NULL)
|
||||
{
|
||||
tp = find_tabpage((int)eap->line2);
|
||||
tp = find_tabpage(tab_number);
|
||||
if (tp == NULL)
|
||||
{
|
||||
beep_flush();
|
||||
@@ -7473,13 +7619,13 @@ ex_tabclose(exarg_T *eap)
|
||||
tabpage_close_other(tp, eap->forceit);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!text_locked()
|
||||
else if (!text_locked()
|
||||
#ifdef FEAT_AUTOCMD
|
||||
&& !curbuf_locked()
|
||||
&& !curbuf_locked()
|
||||
#endif
|
||||
)
|
||||
tabpage_close(eap->forceit);
|
||||
)
|
||||
tabpage_close(eap->forceit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7491,6 +7637,7 @@ ex_tabonly(exarg_T *eap)
|
||||
{
|
||||
tabpage_T *tp;
|
||||
int done;
|
||||
int tab_number;
|
||||
|
||||
# ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
@@ -7501,24 +7648,27 @@ ex_tabonly(exarg_T *eap)
|
||||
MSG(_("Already only one tab page"));
|
||||
else
|
||||
{
|
||||
if (eap->addr_count > 0)
|
||||
goto_tabpage(eap->line2);
|
||||
/* Repeat this up to a 1000 times, because autocommands may mess
|
||||
* up the lists. */
|
||||
for (done = 0; done < 1000; ++done)
|
||||
tab_number = get_tabpage_arg(eap);
|
||||
if (eap->errmsg == NULL)
|
||||
{
|
||||
FOR_ALL_TABPAGES(tp)
|
||||
if (tp->tp_topframe != topframe)
|
||||
{
|
||||
tabpage_close_other(tp, eap->forceit);
|
||||
/* if we failed to close it quit */
|
||||
if (valid_tabpage(tp))
|
||||
done = 1000;
|
||||
/* start over, "tp" is now invalid */
|
||||
goto_tabpage(tab_number);
|
||||
/* Repeat this up to a 1000 times, because autocommands may
|
||||
* mess up the lists. */
|
||||
for (done = 0; done < 1000; ++done)
|
||||
{
|
||||
FOR_ALL_TABPAGES(tp)
|
||||
if (tp->tp_topframe != topframe)
|
||||
{
|
||||
tabpage_close_other(tp, eap->forceit);
|
||||
/* if we failed to close it quit */
|
||||
if (valid_tabpage(tp))
|
||||
done = 1000;
|
||||
/* start over, "tp" is now invalid */
|
||||
break;
|
||||
}
|
||||
if (first_tabpage->tp_next == NULL)
|
||||
break;
|
||||
}
|
||||
if (first_tabpage->tp_next == NULL)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8261,6 +8411,8 @@ tabpage_new(void)
|
||||
static void
|
||||
ex_tabnext(exarg_T *eap)
|
||||
{
|
||||
int tab_number;
|
||||
|
||||
switch (eap->cmdidx)
|
||||
{
|
||||
case CMD_tabfirst:
|
||||
@@ -8272,10 +8424,40 @@ ex_tabnext(exarg_T *eap)
|
||||
break;
|
||||
case CMD_tabprevious:
|
||||
case CMD_tabNext:
|
||||
goto_tabpage(eap->addr_count == 0 ? -1 : -(int)eap->line2);
|
||||
if (eap->arg && *eap->arg != NUL)
|
||||
{
|
||||
char_u *p = eap->arg;
|
||||
char_u *p_save = p;
|
||||
|
||||
tab_number = getdigits(&p);
|
||||
if (p == p_save || *p_save == '-' || *p != NUL
|
||||
|| tab_number == 0)
|
||||
{
|
||||
/* No numbers as argument. */
|
||||
eap->errmsg = e_invarg;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (eap->addr_count == 0)
|
||||
tab_number = 1;
|
||||
else
|
||||
{
|
||||
tab_number = eap->line2;
|
||||
if (tab_number < 1)
|
||||
{
|
||||
eap->errmsg = e_invrange;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
goto_tabpage(-tab_number);
|
||||
break;
|
||||
default: /* CMD_tabnext */
|
||||
goto_tabpage(eap->addr_count == 0 ? 0 : (int)eap->line2);
|
||||
tab_number = get_tabpage_arg(eap);
|
||||
if (eap->errmsg == NULL)
|
||||
goto_tabpage(tab_number);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -8288,59 +8470,9 @@ ex_tabmove(exarg_T *eap)
|
||||
{
|
||||
int tab_number;
|
||||
|
||||
if (eap->arg && *eap->arg != NUL)
|
||||
{
|
||||
char_u *p = eap->arg;
|
||||
int relative = 0; /* argument +N/-N means: move N places to the
|
||||
* right/left relative to the current position. */
|
||||
|
||||
if (*eap->arg == '-')
|
||||
{
|
||||
relative = -1;
|
||||
p = eap->arg + 1;
|
||||
}
|
||||
else if (*eap->arg == '+')
|
||||
{
|
||||
relative = 1;
|
||||
p = eap->arg + 1;
|
||||
}
|
||||
else
|
||||
p = eap->arg;
|
||||
|
||||
if (relative == 0)
|
||||
{
|
||||
if (STRCMP(p, "$") == 0)
|
||||
tab_number = LAST_TAB_NR;
|
||||
else if (p == skipdigits(p))
|
||||
{
|
||||
/* No numbers as argument. */
|
||||
eap->errmsg = e_invarg;
|
||||
return;
|
||||
}
|
||||
else
|
||||
tab_number = getdigits(&p);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*p != NUL)
|
||||
tab_number = getdigits(&p);
|
||||
else
|
||||
tab_number = 1;
|
||||
tab_number = tab_number * relative + tabpage_index(curtab);
|
||||
if (relative == -1)
|
||||
--tab_number;
|
||||
}
|
||||
}
|
||||
else if (eap->addr_count != 0)
|
||||
{
|
||||
tab_number = eap->line2;
|
||||
if (**eap->cmdlinep == '-')
|
||||
--tab_number;
|
||||
}
|
||||
else
|
||||
tab_number = LAST_TAB_NR;
|
||||
|
||||
tabpage_move(tab_number);
|
||||
tab_number = get_tabpage_arg(eap);
|
||||
if (eap->errmsg == NULL)
|
||||
tabpage_move(tab_number);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8876,7 +9008,7 @@ ex_read(exarg_T *eap)
|
||||
eap->line2, (linenr_T)0, (linenr_T)MAXLNUM, eap, 0);
|
||||
|
||||
}
|
||||
if (i == FAIL)
|
||||
if (i != OK)
|
||||
{
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
if (!aborting())
|
||||
@@ -11221,8 +11353,10 @@ makeopens(
|
||||
* resized when moving between windows.
|
||||
* Do this before restoring the view, so that the topline and the
|
||||
* 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;
|
||||
if (nr > 1 && ses_winsizes(fd, restore_size, tab_firstwin) == FAIL)
|
||||
return FAIL;
|
||||
@@ -11292,6 +11426,10 @@ makeopens(
|
||||
if (fprintf(fd, "set winheight=%ld winwidth=%ld shortmess=%s",
|
||||
p_wh, p_wiw, p_shm) < 0 || put_eol(fd) == 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.
|
||||
@@ -11687,7 +11825,7 @@ ses_arglist(
|
||||
s = buf;
|
||||
}
|
||||
}
|
||||
if (fputs("argadd ", fd) < 0
|
||||
if (fputs("$argadd ", fd) < 0
|
||||
|| ses_put_fname(fd, s, flagp) == FAIL
|
||||
|| put_eol(fd) == FAIL)
|
||||
{
|
||||
|
||||
+14
-3
@@ -1802,6 +1802,10 @@ getcmdline(
|
||||
goto cmdline_not_changed;
|
||||
#endif
|
||||
|
||||
case K_PS:
|
||||
bracketed_paste(PASTE_CMDLINE, FALSE, NULL);
|
||||
goto cmdline_changed;
|
||||
|
||||
default:
|
||||
#ifdef UNIX
|
||||
if (c == intr_char)
|
||||
@@ -2374,8 +2378,7 @@ getexmodeline(
|
||||
if (ga_grow(&line_ga, 40) == FAIL)
|
||||
break;
|
||||
|
||||
/* Get one character at a time. Don't use inchar(), it can't handle
|
||||
* special characters. */
|
||||
/* Get one character at a time. */
|
||||
prev_char = c1;
|
||||
c1 = vgetc();
|
||||
|
||||
@@ -2390,6 +2393,12 @@ getexmodeline(
|
||||
break;
|
||||
}
|
||||
|
||||
if (c1 == K_PS)
|
||||
{
|
||||
bracketed_paste(PASTE_EX, FALSE, &line_ga);
|
||||
goto redraw;
|
||||
}
|
||||
|
||||
if (!escaped)
|
||||
{
|
||||
/* CR typed means "enter", which is NL */
|
||||
@@ -4368,7 +4377,9 @@ addstar(
|
||||
|| context == EXPAND_OWNSYNTAX
|
||||
|| context == EXPAND_FILETYPE
|
||||
|| context == EXPAND_PACKADD
|
||||
|| (context == EXPAND_TAGS && fname[0] == '/'))
|
||||
|| ((context == EXPAND_TAGS_LISTFILES
|
||||
|| context == EXPAND_TAGS)
|
||||
&& fname[0] == '/'))
|
||||
retval = vim_strnsave(fname, len);
|
||||
else
|
||||
{
|
||||
|
||||
+339
-355
@@ -15,30 +15,11 @@
|
||||
|
||||
#if defined(FEAT_FKMAP) || defined(PROTO)
|
||||
|
||||
static int toF_Xor_X_(int c);
|
||||
static int F_is_TyE(int c);
|
||||
static int F_is_TyC_TyD(int c);
|
||||
static int F_is_TyB_TyC_TyD(int src, int offset);
|
||||
static int toF_TyB(int c);
|
||||
static void put_curr_and_l_to_X(int c);
|
||||
static void put_and_redo(int c);
|
||||
static void chg_c_toX_orX(void);
|
||||
static void chg_c_to_X_orX_(void);
|
||||
static void chg_c_to_X_or_X(void);
|
||||
static void chg_l_to_X_orX_(void);
|
||||
static void chg_l_toXor_X(void);
|
||||
static void chg_r_to_Xor_X_(void);
|
||||
static int toF_leading(int c);
|
||||
static int toF_Rjoin(int c);
|
||||
static int canF_Ljoin(int c);
|
||||
static int canF_Rjoin(int c);
|
||||
static int F_isterm(int c);
|
||||
static int toF_ending(int c);
|
||||
static void lrswapbuf(char_u *buf, int len);
|
||||
|
||||
/*
|
||||
* Convert the given Farsi character into a _X or _X_ type
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
toF_Xor_X_(int c)
|
||||
{
|
||||
@@ -105,7 +86,7 @@ toF_Xor_X_(int c)
|
||||
|
||||
/*
|
||||
* Convert the given Farsi character into Farsi capital character.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
toF_TyA(int c)
|
||||
{
|
||||
@@ -156,7 +137,7 @@ toF_TyA(int c)
|
||||
* Is the character under the cursor+offset in the given buffer a join type.
|
||||
* That is a character that is combined with the others.
|
||||
* Note: the offset is used only for command line buffer.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
F_is_TyB_TyC_TyD(int src, int offset)
|
||||
{
|
||||
@@ -207,7 +188,7 @@ F_is_TyB_TyC_TyD(int src, int offset)
|
||||
|
||||
/*
|
||||
* Is the Farsi character one of the terminating only type.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
F_is_TyE(int c)
|
||||
{
|
||||
@@ -230,7 +211,7 @@ F_is_TyE(int c)
|
||||
|
||||
/*
|
||||
* Is the Farsi character one of the none leading type.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
F_is_TyC_TyD(int c)
|
||||
{
|
||||
@@ -254,7 +235,7 @@ F_is_TyC_TyD(int c)
|
||||
|
||||
/*
|
||||
* Convert a none leading Farsi char into a leading type.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
toF_TyB(int c)
|
||||
{
|
||||
@@ -275,9 +256,18 @@ toF_TyB(int c)
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
put_and_redo(int c)
|
||||
{
|
||||
pchar_cursor(c);
|
||||
AppendCharToRedobuff(K_BS);
|
||||
AppendCharToRedobuff(c);
|
||||
}
|
||||
|
||||
/*
|
||||
* Overwrite the current redo and cursor characters + left adjust.
|
||||
*/
|
||||
*/
|
||||
static void
|
||||
put_curr_and_l_to_X(int c)
|
||||
{
|
||||
@@ -312,17 +302,9 @@ put_curr_and_l_to_X(int c)
|
||||
put_and_redo(c);
|
||||
}
|
||||
|
||||
static void
|
||||
put_and_redo(int c)
|
||||
{
|
||||
pchar_cursor(c);
|
||||
AppendCharToRedobuff(K_BS);
|
||||
AppendCharToRedobuff(c);
|
||||
}
|
||||
|
||||
/*
|
||||
* Change the char. under the cursor to a X_ or X type
|
||||
*/
|
||||
*/
|
||||
static void
|
||||
chg_c_toX_orX(void)
|
||||
{
|
||||
@@ -446,8 +428,7 @@ chg_c_toX_orX(void)
|
||||
|
||||
/*
|
||||
* Change the char. under the cursor to a _X_ or X_ type
|
||||
*/
|
||||
|
||||
*/
|
||||
static void
|
||||
chg_c_to_X_orX_(void)
|
||||
{
|
||||
@@ -498,9 +479,9 @@ chg_c_to_X_orX_(void)
|
||||
|
||||
/*
|
||||
* Change the char. under the cursor to a _X_ or _X type
|
||||
*/
|
||||
*/
|
||||
static void
|
||||
chg_c_to_X_or_X (void)
|
||||
chg_c_to_X_or_X(void)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -529,7 +510,7 @@ chg_c_to_X_or_X (void)
|
||||
|
||||
/*
|
||||
* Change the character left to the cursor to a _X_ or X_ type
|
||||
*/
|
||||
*/
|
||||
static void
|
||||
chg_l_to_X_orX_(void)
|
||||
{
|
||||
@@ -597,10 +578,9 @@ chg_l_to_X_orX_(void)
|
||||
|
||||
/*
|
||||
* Change the character left to the cursor to a X or _X type
|
||||
*/
|
||||
|
||||
*/
|
||||
static void
|
||||
chg_l_toXor_X (void)
|
||||
chg_l_toXor_X(void)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -666,8 +646,7 @@ chg_l_toXor_X (void)
|
||||
|
||||
/*
|
||||
* Change the character right to the cursor to a _X or _X_ type
|
||||
*/
|
||||
|
||||
*/
|
||||
static void
|
||||
chg_r_to_Xor_X_(void)
|
||||
{
|
||||
@@ -691,48 +670,50 @@ chg_r_to_Xor_X_(void)
|
||||
|
||||
/*
|
||||
* Map Farsi keyboard when in fkmap mode.
|
||||
*/
|
||||
|
||||
*/
|
||||
int
|
||||
fkmap(int c)
|
||||
{
|
||||
int tempc;
|
||||
static int revins;
|
||||
int insert_mode = (State & INSERT);
|
||||
static int revins = 0;
|
||||
|
||||
if (IS_SPECIAL(c))
|
||||
return c;
|
||||
|
||||
if (VIM_ISDIGIT(c) || ((c == '.' || c == '+' || c == '-' ||
|
||||
c == '^' || c == '%' || c == '#' || c == '=') && revins))
|
||||
if (insert_mode)
|
||||
{
|
||||
if (!revins)
|
||||
if (VIM_ISDIGIT(c) || ((c == '.' || c == '+' || c == '-' ||
|
||||
c == '^' || c == '%' || c == '#' || c == '=') && revins))
|
||||
{
|
||||
if (curwin->w_cursor.col)
|
||||
/* Numbers are entered left-to-right. */
|
||||
if (!revins)
|
||||
{
|
||||
if (!p_ri)
|
||||
dec_cursor();
|
||||
if (curwin->w_cursor.col)
|
||||
{
|
||||
if (!p_ri)
|
||||
dec_cursor();
|
||||
|
||||
chg_c_toX_orX ();
|
||||
chg_l_toXor_X ();
|
||||
chg_c_toX_orX ();
|
||||
chg_l_toXor_X ();
|
||||
|
||||
if (!p_ri)
|
||||
inc_cursor();
|
||||
if (!p_ri)
|
||||
inc_cursor();
|
||||
}
|
||||
}
|
||||
|
||||
arrow_used = TRUE;
|
||||
(void)stop_arrow();
|
||||
|
||||
if (!curwin->w_p_rl && revins)
|
||||
inc_cursor();
|
||||
|
||||
++revins;
|
||||
p_ri = 1;
|
||||
}
|
||||
|
||||
arrow_used = TRUE;
|
||||
(void)stop_arrow();
|
||||
|
||||
if (!curwin->w_p_rl && revins)
|
||||
inc_cursor();
|
||||
|
||||
++revins;
|
||||
p_ri=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (revins)
|
||||
else if (revins)
|
||||
{
|
||||
/* Stop entering number. */
|
||||
arrow_used = TRUE;
|
||||
(void)stop_arrow();
|
||||
|
||||
@@ -773,14 +754,14 @@ fkmap(int c)
|
||||
if (!revins)
|
||||
{
|
||||
if (curwin->w_p_rl)
|
||||
p_ri=0;
|
||||
p_ri = 0;
|
||||
if (!curwin->w_p_rl)
|
||||
p_ri=1;
|
||||
p_ri = 1;
|
||||
}
|
||||
|
||||
if ((c < 0x100) && (isalpha(c) || c == '&' || c == '^' || c == ';' ||
|
||||
if ((c < 0x100) && (isalpha(c) || c == '&' || c == '^' || c == ';' ||
|
||||
c == '\''|| c == ',' || c == '[' ||
|
||||
c == ']' || c == '{' || c == '}' ))
|
||||
c == ']' || c == '{' || c == '}'))
|
||||
chg_r_to_Xor_X_();
|
||||
|
||||
tempc = 0;
|
||||
@@ -844,13 +825,12 @@ fkmap(int c)
|
||||
case NL:
|
||||
case TAB:
|
||||
|
||||
if (p_ri && c == NL && curwin->w_cursor.col)
|
||||
if (p_ri && c == NL && curwin->w_cursor.col && insert_mode)
|
||||
{
|
||||
/*
|
||||
* If the char before the cursor is _X_ or X_ do not change
|
||||
* the one under the cursor with X type.
|
||||
*/
|
||||
|
||||
*/
|
||||
dec_cursor();
|
||||
|
||||
if (F_isalpha(gchar_cursor()))
|
||||
@@ -920,215 +900,219 @@ fkmap(int c)
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!p_ri)
|
||||
dec_cursor();
|
||||
|
||||
switch ((tempc = gchar_cursor()))
|
||||
if (insert_mode)
|
||||
{
|
||||
case _BE:
|
||||
case _PE:
|
||||
case _TE:
|
||||
case _SE:
|
||||
case _JIM:
|
||||
case _CHE:
|
||||
case _HE_J:
|
||||
case _XE:
|
||||
case _SIN:
|
||||
case _SHIN:
|
||||
case _SAD:
|
||||
case _ZAD:
|
||||
case _FE:
|
||||
case _GHAF:
|
||||
case _KAF:
|
||||
case _KAF_H:
|
||||
case _GAF:
|
||||
case _LAM:
|
||||
case _MIM:
|
||||
case _NOON:
|
||||
case _HE:
|
||||
case _HE_:
|
||||
case _TA:
|
||||
case _ZA:
|
||||
put_curr_and_l_to_X(toF_TyA(tempc));
|
||||
break;
|
||||
case _AYN:
|
||||
case _AYN_:
|
||||
if (!p_ri)
|
||||
dec_cursor();
|
||||
|
||||
if (!p_ri)
|
||||
if (!curwin->w_cursor.col)
|
||||
{
|
||||
put_curr_and_l_to_X(AYN);
|
||||
break;
|
||||
}
|
||||
switch ((tempc = gchar_cursor()))
|
||||
{
|
||||
case _BE:
|
||||
case _PE:
|
||||
case _TE:
|
||||
case _SE:
|
||||
case _JIM:
|
||||
case _CHE:
|
||||
case _HE_J:
|
||||
case _XE:
|
||||
case _SIN:
|
||||
case _SHIN:
|
||||
case _SAD:
|
||||
case _ZAD:
|
||||
case _FE:
|
||||
case _GHAF:
|
||||
case _KAF:
|
||||
case _KAF_H:
|
||||
case _GAF:
|
||||
case _LAM:
|
||||
case _MIM:
|
||||
case _NOON:
|
||||
case _HE:
|
||||
case _HE_:
|
||||
case _TA:
|
||||
case _ZA:
|
||||
put_curr_and_l_to_X(toF_TyA(tempc));
|
||||
break;
|
||||
case _AYN:
|
||||
case _AYN_:
|
||||
|
||||
if (p_ri)
|
||||
inc_cursor();
|
||||
else
|
||||
dec_cursor();
|
||||
if (!p_ri)
|
||||
if (!curwin->w_cursor.col)
|
||||
{
|
||||
put_curr_and_l_to_X(AYN);
|
||||
break;
|
||||
}
|
||||
|
||||
if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
|
||||
tempc = AYN_;
|
||||
else
|
||||
tempc = AYN;
|
||||
if (p_ri)
|
||||
inc_cursor();
|
||||
else
|
||||
dec_cursor();
|
||||
|
||||
if (p_ri)
|
||||
dec_cursor();
|
||||
else
|
||||
inc_cursor();
|
||||
if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
|
||||
tempc = AYN_;
|
||||
else
|
||||
tempc = AYN;
|
||||
|
||||
put_curr_and_l_to_X(tempc);
|
||||
if (p_ri)
|
||||
dec_cursor();
|
||||
else
|
||||
inc_cursor();
|
||||
|
||||
break;
|
||||
case _GHAYN:
|
||||
case _GHAYN_:
|
||||
put_curr_and_l_to_X(tempc);
|
||||
|
||||
if (!p_ri)
|
||||
if (!curwin->w_cursor.col)
|
||||
{
|
||||
put_curr_and_l_to_X(GHAYN);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case _GHAYN:
|
||||
case _GHAYN_:
|
||||
|
||||
if (p_ri)
|
||||
inc_cursor();
|
||||
else
|
||||
dec_cursor();
|
||||
if (!p_ri)
|
||||
if (!curwin->w_cursor.col)
|
||||
{
|
||||
put_curr_and_l_to_X(GHAYN);
|
||||
break;
|
||||
}
|
||||
|
||||
if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
|
||||
tempc = GHAYN_;
|
||||
else
|
||||
tempc = GHAYN;
|
||||
if (p_ri)
|
||||
inc_cursor();
|
||||
else
|
||||
dec_cursor();
|
||||
|
||||
if (p_ri)
|
||||
dec_cursor();
|
||||
else
|
||||
inc_cursor();
|
||||
if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
|
||||
tempc = GHAYN_;
|
||||
else
|
||||
tempc = GHAYN;
|
||||
|
||||
put_curr_and_l_to_X(tempc);
|
||||
break;
|
||||
case _YE:
|
||||
case _IE:
|
||||
case _YEE:
|
||||
if (!p_ri)
|
||||
if (!curwin->w_cursor.col)
|
||||
{
|
||||
put_curr_and_l_to_X((tempc == _YE ? YE :
|
||||
(tempc == _IE ? IE : YEE)));
|
||||
break;
|
||||
}
|
||||
if (p_ri)
|
||||
dec_cursor();
|
||||
else
|
||||
inc_cursor();
|
||||
|
||||
if (p_ri)
|
||||
inc_cursor();
|
||||
else
|
||||
dec_cursor();
|
||||
put_curr_and_l_to_X(tempc);
|
||||
break;
|
||||
case _YE:
|
||||
case _IE:
|
||||
case _YEE:
|
||||
if (!p_ri)
|
||||
if (!curwin->w_cursor.col)
|
||||
{
|
||||
put_curr_and_l_to_X((tempc == _YE ? YE :
|
||||
(tempc == _IE ? IE : YEE)));
|
||||
break;
|
||||
}
|
||||
|
||||
if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
|
||||
tempc = (tempc == _YE ? YE_ :
|
||||
(tempc == _IE ? IE_ : YEE_));
|
||||
else
|
||||
tempc = (tempc == _YE ? YE :
|
||||
(tempc == _IE ? IE : YEE));
|
||||
if (p_ri)
|
||||
inc_cursor();
|
||||
else
|
||||
dec_cursor();
|
||||
|
||||
if (p_ri)
|
||||
dec_cursor();
|
||||
else
|
||||
inc_cursor();
|
||||
if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
|
||||
tempc = (tempc == _YE ? YE_ :
|
||||
(tempc == _IE ? IE_ : YEE_));
|
||||
else
|
||||
tempc = (tempc == _YE ? YE :
|
||||
(tempc == _IE ? IE : YEE));
|
||||
|
||||
put_curr_and_l_to_X(tempc);
|
||||
break;
|
||||
if (p_ri)
|
||||
dec_cursor();
|
||||
else
|
||||
inc_cursor();
|
||||
|
||||
put_curr_and_l_to_X(tempc);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!p_ri)
|
||||
inc_cursor();
|
||||
}
|
||||
|
||||
tempc = 0;
|
||||
tempc = 0;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '0': return FARSI_0;
|
||||
case '1': return FARSI_1;
|
||||
case '2': return FARSI_2;
|
||||
case '3': return FARSI_3;
|
||||
case '4': return FARSI_4;
|
||||
case '5': return FARSI_5;
|
||||
case '6': return FARSI_6;
|
||||
case '7': return FARSI_7;
|
||||
case '8': return FARSI_8;
|
||||
case '9': return FARSI_9;
|
||||
case 'B': return F_PSP;
|
||||
case 'E': return JAZR_N;
|
||||
case 'F': return ALEF_D_H;
|
||||
case 'H': return ALEF_A;
|
||||
case 'I': return TASH;
|
||||
case 'K': return F_LQUOT;
|
||||
case 'L': return F_RQUOT;
|
||||
case 'M': return HAMZE;
|
||||
case 'O': return '[';
|
||||
case 'P': return ']';
|
||||
case 'Q': return OO;
|
||||
case 'R': return MAD_N;
|
||||
case 'T': return OW;
|
||||
case 'U': return MAD;
|
||||
case 'W': return OW_OW;
|
||||
case 'Y': return JAZR;
|
||||
case '`': return F_PCN;
|
||||
case '!': return F_EXCL;
|
||||
case '@': return F_COMMA;
|
||||
case '#': return F_DIVIDE;
|
||||
case '$': return F_CURRENCY;
|
||||
case '%': return F_PERCENT;
|
||||
case '^': return F_MUL;
|
||||
case '&': return F_BCOMMA;
|
||||
case '*': return F_STAR;
|
||||
case '(': return F_LPARENT;
|
||||
case ')': return F_RPARENT;
|
||||
case '-': return F_MINUS;
|
||||
case '_': return F_UNDERLINE;
|
||||
case '=': return F_EQUALS;
|
||||
case '+': return F_PLUS;
|
||||
case '\\': return F_BSLASH;
|
||||
case '|': return F_PIPE;
|
||||
case ':': return F_DCOLON;
|
||||
case '"': return F_SEMICOLON;
|
||||
case '.': return F_PERIOD;
|
||||
case '/': return F_SLASH;
|
||||
case '<': return F_LESS;
|
||||
case '>': return F_GREATER;
|
||||
case '?': return F_QUESTION;
|
||||
case ' ': return F_BLANK;
|
||||
}
|
||||
break;
|
||||
switch (c)
|
||||
{
|
||||
case '0': return FARSI_0;
|
||||
case '1': return FARSI_1;
|
||||
case '2': return FARSI_2;
|
||||
case '3': return FARSI_3;
|
||||
case '4': return FARSI_4;
|
||||
case '5': return FARSI_5;
|
||||
case '6': return FARSI_6;
|
||||
case '7': return FARSI_7;
|
||||
case '8': return FARSI_8;
|
||||
case '9': return FARSI_9;
|
||||
case 'B': return F_PSP;
|
||||
case 'E': return JAZR_N;
|
||||
case 'F': return ALEF_D_H;
|
||||
case 'H': return ALEF_A;
|
||||
case 'I': return TASH;
|
||||
case 'K': return F_LQUOT;
|
||||
case 'L': return F_RQUOT;
|
||||
case 'M': return HAMZE;
|
||||
case 'O': return '[';
|
||||
case 'P': return ']';
|
||||
case 'Q': return OO;
|
||||
case 'R': return MAD_N;
|
||||
case 'T': return OW;
|
||||
case 'U': return MAD;
|
||||
case 'W': return OW_OW;
|
||||
case 'Y': return JAZR;
|
||||
case '`': return F_PCN;
|
||||
case '!': return F_EXCL;
|
||||
case '@': return F_COMMA;
|
||||
case '#': return F_DIVIDE;
|
||||
case '$': return F_CURRENCY;
|
||||
case '%': return F_PERCENT;
|
||||
case '^': return F_MUL;
|
||||
case '&': return F_BCOMMA;
|
||||
case '*': return F_STAR;
|
||||
case '(': return F_LPARENT;
|
||||
case ')': return F_RPARENT;
|
||||
case '-': return F_MINUS;
|
||||
case '_': return F_UNDERLINE;
|
||||
case '=': return F_EQUALS;
|
||||
case '+': return F_PLUS;
|
||||
case '\\': return F_BSLASH;
|
||||
case '|': return F_PIPE;
|
||||
case ':': return F_DCOLON;
|
||||
case '"': return F_SEMICOLON;
|
||||
case '.': return F_PERIOD;
|
||||
case '/': return F_SLASH;
|
||||
case '<': return F_LESS;
|
||||
case '>': return F_GREATER;
|
||||
case '?': return F_QUESTION;
|
||||
case ' ': return F_BLANK;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
tempc = _SHIN;
|
||||
break;
|
||||
tempc = _SHIN;
|
||||
break;
|
||||
case 'A':
|
||||
tempc = WAW_H;
|
||||
break;
|
||||
tempc = WAW_H;
|
||||
break;
|
||||
case 'b':
|
||||
tempc = ZAL;
|
||||
break;
|
||||
tempc = ZAL;
|
||||
break;
|
||||
case 'c':
|
||||
tempc = ZE;
|
||||
break;
|
||||
tempc = ZE;
|
||||
break;
|
||||
case 'C':
|
||||
tempc = JE;
|
||||
break;
|
||||
tempc = JE;
|
||||
break;
|
||||
case 'd':
|
||||
tempc = _YE;
|
||||
break;
|
||||
tempc = _YE;
|
||||
break;
|
||||
case 'D':
|
||||
tempc = _YEE;
|
||||
break;
|
||||
tempc = _YEE;
|
||||
break;
|
||||
case 'e':
|
||||
tempc = _SE;
|
||||
break;
|
||||
tempc = _SE;
|
||||
break;
|
||||
case 'f':
|
||||
tempc = _BE;
|
||||
break;
|
||||
tempc = _BE;
|
||||
break;
|
||||
case 'g':
|
||||
tempc = _LAM;
|
||||
break;
|
||||
tempc = _LAM;
|
||||
break;
|
||||
case 'G':
|
||||
if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
|
||||
{
|
||||
@@ -1230,7 +1214,7 @@ fkmap(int c)
|
||||
inc_cursor();
|
||||
break;
|
||||
case 'j':
|
||||
tempc = _TE;
|
||||
tempc = _TE;
|
||||
break;
|
||||
case 'J':
|
||||
if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
|
||||
@@ -1260,73 +1244,73 @@ fkmap(int c)
|
||||
|
||||
return tempc;
|
||||
case 'k':
|
||||
tempc = _NOON;
|
||||
tempc = _NOON;
|
||||
break;
|
||||
case 'l':
|
||||
tempc = _MIM;
|
||||
tempc = _MIM;
|
||||
break;
|
||||
case 'm':
|
||||
tempc = _PE;
|
||||
tempc = _PE;
|
||||
break;
|
||||
case 'n':
|
||||
case 'N':
|
||||
tempc = DAL;
|
||||
tempc = DAL;
|
||||
break;
|
||||
case 'o':
|
||||
tempc = _XE;
|
||||
tempc = _XE;
|
||||
break;
|
||||
case 'p':
|
||||
tempc = _HE_J;
|
||||
tempc = _HE_J;
|
||||
break;
|
||||
case 'q':
|
||||
tempc = _ZAD;
|
||||
tempc = _ZAD;
|
||||
break;
|
||||
case 'r':
|
||||
tempc = _GHAF;
|
||||
tempc = _GHAF;
|
||||
break;
|
||||
case 's':
|
||||
tempc = _SIN;
|
||||
tempc = _SIN;
|
||||
break;
|
||||
case 'S':
|
||||
tempc = _IE;
|
||||
tempc = _IE;
|
||||
break;
|
||||
case 't':
|
||||
tempc = _FE;
|
||||
tempc = _FE;
|
||||
break;
|
||||
case 'u':
|
||||
if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
|
||||
{
|
||||
if (!p_ri && !F_is_TyE(tempc))
|
||||
chg_c_to_X_orX_ ();
|
||||
if (p_ri)
|
||||
chg_c_to_X_or_X ();
|
||||
if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
|
||||
{
|
||||
if (!p_ri && !F_is_TyE(tempc))
|
||||
chg_c_to_X_orX_ ();
|
||||
if (p_ri)
|
||||
chg_c_to_X_or_X ();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!p_ri && !curwin->w_cursor.col)
|
||||
return _AYN;
|
||||
if (!p_ri && !curwin->w_cursor.col)
|
||||
return _AYN;
|
||||
|
||||
if (!p_ri)
|
||||
dec_cursor();
|
||||
if (!p_ri)
|
||||
dec_cursor();
|
||||
|
||||
if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
|
||||
tempc = _AYN_;
|
||||
else
|
||||
tempc = _AYN;
|
||||
if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
|
||||
tempc = _AYN_;
|
||||
else
|
||||
tempc = _AYN;
|
||||
|
||||
if (!p_ri)
|
||||
inc_cursor();
|
||||
if (!p_ri)
|
||||
inc_cursor();
|
||||
break;
|
||||
case 'v':
|
||||
case 'V':
|
||||
tempc = RE;
|
||||
tempc = RE;
|
||||
break;
|
||||
case 'w':
|
||||
tempc = _SAD;
|
||||
tempc = _SAD;
|
||||
break;
|
||||
case 'x':
|
||||
case 'X':
|
||||
tempc = _TA;
|
||||
tempc = _TA;
|
||||
break;
|
||||
case 'y':
|
||||
if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
|
||||
@@ -1354,36 +1338,36 @@ fkmap(int c)
|
||||
|
||||
break;
|
||||
case 'z':
|
||||
tempc = _ZA;
|
||||
tempc = _ZA;
|
||||
break;
|
||||
case 'Z':
|
||||
tempc = _KAF_H;
|
||||
tempc = _KAF_H;
|
||||
break;
|
||||
case ';':
|
||||
tempc = _KAF;
|
||||
tempc = _KAF;
|
||||
break;
|
||||
case '\'':
|
||||
tempc = _GAF;
|
||||
tempc = _GAF;
|
||||
break;
|
||||
case ',':
|
||||
tempc = WAW;
|
||||
tempc = WAW;
|
||||
break;
|
||||
case '[':
|
||||
tempc = _JIM;
|
||||
tempc = _JIM;
|
||||
break;
|
||||
case ']':
|
||||
tempc = _CHE;
|
||||
tempc = _CHE;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((F_isalpha(tempc) || F_isdigit(tempc)))
|
||||
if (F_isalpha(tempc) || F_isdigit(tempc))
|
||||
{
|
||||
if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
|
||||
if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
|
||||
{
|
||||
if (!p_ri && !F_is_TyE(tempc))
|
||||
chg_c_to_X_orX_ ();
|
||||
chg_c_to_X_orX_();
|
||||
if (p_ri)
|
||||
chg_c_to_X_or_X ();
|
||||
chg_c_to_X_or_X();
|
||||
}
|
||||
|
||||
if (curwin->w_cursor.col)
|
||||
@@ -1392,9 +1376,9 @@ fkmap(int c)
|
||||
dec_cursor();
|
||||
|
||||
if (F_is_TyE(tempc))
|
||||
chg_l_toXor_X ();
|
||||
chg_l_toXor_X();
|
||||
else
|
||||
chg_l_to_X_orX_ ();
|
||||
chg_l_to_X_orX_();
|
||||
|
||||
if (!p_ri)
|
||||
inc_cursor();
|
||||
@@ -1407,7 +1391,7 @@ fkmap(int c)
|
||||
|
||||
/*
|
||||
* Convert a none leading Farsi char into a leading type.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
toF_leading(int c)
|
||||
{
|
||||
@@ -1461,7 +1445,7 @@ toF_leading(int c)
|
||||
|
||||
/*
|
||||
* Convert a given Farsi char into right joining type.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
toF_Rjoin(int c)
|
||||
{
|
||||
@@ -1517,7 +1501,7 @@ toF_Rjoin(int c)
|
||||
|
||||
/*
|
||||
* Can a given Farsi character join via its left edj.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
canF_Ljoin(int c)
|
||||
{
|
||||
@@ -1591,7 +1575,7 @@ canF_Ljoin(int c)
|
||||
|
||||
/*
|
||||
* Can a given Farsi character join via its right edj.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
canF_Rjoin(int c)
|
||||
{
|
||||
@@ -1619,7 +1603,7 @@ canF_Rjoin(int c)
|
||||
|
||||
/*
|
||||
* is a given Farsi character a terminating type.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
F_isterm(int c)
|
||||
{
|
||||
@@ -1646,7 +1630,7 @@ F_isterm(int c)
|
||||
|
||||
/*
|
||||
* Convert the given Farsi character into a ending type .
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
toF_ending(int c)
|
||||
{
|
||||
@@ -1691,7 +1675,7 @@ toF_ending(int c)
|
||||
|
||||
/*
|
||||
* Convert the Farsi 3342 standard into Farsi VIM.
|
||||
*/
|
||||
*/
|
||||
static void
|
||||
conv_to_pvim(void)
|
||||
{
|
||||
@@ -1936,56 +1920,56 @@ cmdl_fkmap(int c)
|
||||
case NL:
|
||||
case TAB:
|
||||
|
||||
switch ((tempc = cmd_gchar(AT_CURSOR)))
|
||||
{
|
||||
case _BE:
|
||||
case _PE:
|
||||
case _TE:
|
||||
case _SE:
|
||||
case _JIM:
|
||||
case _CHE:
|
||||
case _HE_J:
|
||||
case _XE:
|
||||
case _SIN:
|
||||
case _SHIN:
|
||||
case _SAD:
|
||||
case _ZAD:
|
||||
case _AYN:
|
||||
case _GHAYN:
|
||||
case _FE:
|
||||
case _GHAF:
|
||||
case _KAF:
|
||||
case _GAF:
|
||||
case _LAM:
|
||||
case _MIM:
|
||||
case _NOON:
|
||||
case _HE:
|
||||
case _HE_:
|
||||
cmd_pchar(toF_TyA(tempc), AT_CURSOR);
|
||||
break;
|
||||
case _AYN_:
|
||||
cmd_pchar(AYN_, AT_CURSOR);
|
||||
break;
|
||||
case _GHAYN_:
|
||||
cmd_pchar(GHAYN_, AT_CURSOR);
|
||||
break;
|
||||
case _IE:
|
||||
if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR+1))
|
||||
cmd_pchar(IE_, AT_CURSOR);
|
||||
else
|
||||
cmd_pchar(IE, AT_CURSOR);
|
||||
break;
|
||||
case _YEE:
|
||||
if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR+1))
|
||||
cmd_pchar(YEE_, AT_CURSOR);
|
||||
else
|
||||
cmd_pchar(YEE, AT_CURSOR);
|
||||
break;
|
||||
case _YE:
|
||||
if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR+1))
|
||||
cmd_pchar(YE_, AT_CURSOR);
|
||||
else
|
||||
cmd_pchar(YE, AT_CURSOR);
|
||||
switch ((tempc = cmd_gchar(AT_CURSOR)))
|
||||
{
|
||||
case _BE:
|
||||
case _PE:
|
||||
case _TE:
|
||||
case _SE:
|
||||
case _JIM:
|
||||
case _CHE:
|
||||
case _HE_J:
|
||||
case _XE:
|
||||
case _SIN:
|
||||
case _SHIN:
|
||||
case _SAD:
|
||||
case _ZAD:
|
||||
case _AYN:
|
||||
case _GHAYN:
|
||||
case _FE:
|
||||
case _GHAF:
|
||||
case _KAF:
|
||||
case _GAF:
|
||||
case _LAM:
|
||||
case _MIM:
|
||||
case _NOON:
|
||||
case _HE:
|
||||
case _HE_:
|
||||
cmd_pchar(toF_TyA(tempc), AT_CURSOR);
|
||||
break;
|
||||
case _AYN_:
|
||||
cmd_pchar(AYN_, AT_CURSOR);
|
||||
break;
|
||||
case _GHAYN_:
|
||||
cmd_pchar(GHAYN_, AT_CURSOR);
|
||||
break;
|
||||
case _IE:
|
||||
if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR+1))
|
||||
cmd_pchar(IE_, AT_CURSOR);
|
||||
else
|
||||
cmd_pchar(IE, AT_CURSOR);
|
||||
break;
|
||||
case _YEE:
|
||||
if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR+1))
|
||||
cmd_pchar(YEE_, AT_CURSOR);
|
||||
else
|
||||
cmd_pchar(YEE, AT_CURSOR);
|
||||
break;
|
||||
case _YE:
|
||||
if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR+1))
|
||||
cmd_pchar(YE_, AT_CURSOR);
|
||||
else
|
||||
cmd_pchar(YE, AT_CURSOR);
|
||||
}
|
||||
|
||||
switch (c)
|
||||
|
||||
+22
-7
@@ -210,7 +210,7 @@ filemess(
|
||||
* READ_KEEP_UNDO don't clear undo info or read it from a file
|
||||
* READ_FIFO read from fifo/socket instead of a file
|
||||
*
|
||||
* return FAIL for failure, OK otherwise
|
||||
* return FAIL for failure, NOTDONE for directory (failure), or OK
|
||||
*/
|
||||
int
|
||||
readfile(
|
||||
@@ -274,9 +274,9 @@ readfile(
|
||||
int msg_save = msg_scroll;
|
||||
linenr_T read_no_eol_lnum = 0; /* non-zero lnum when last line of
|
||||
* last read was missing the eol */
|
||||
int try_mac = (vim_strchr(p_ffs, 'm') != NULL);
|
||||
int try_dos = (vim_strchr(p_ffs, 'd') != NULL);
|
||||
int try_unix = (vim_strchr(p_ffs, 'x') != NULL);
|
||||
int try_mac;
|
||||
int try_dos;
|
||||
int try_unix;
|
||||
int file_rewind = FALSE;
|
||||
#ifdef FEAT_MBYTE
|
||||
int can_retry;
|
||||
@@ -450,13 +450,18 @@ readfile(
|
||||
# endif
|
||||
)
|
||||
{
|
||||
int retval = FAIL;
|
||||
|
||||
if (S_ISDIR(perm))
|
||||
{
|
||||
filemess(curbuf, fname, (char_u *)_("is a directory"), 0);
|
||||
retval = NOTDONE;
|
||||
}
|
||||
else
|
||||
filemess(curbuf, fname, (char_u *)_("is not a file"), 0);
|
||||
msg_end();
|
||||
msg_scroll = msg_save;
|
||||
return FAIL;
|
||||
return retval;
|
||||
}
|
||||
#endif
|
||||
#if defined(MSWIN)
|
||||
@@ -733,6 +738,10 @@ readfile(
|
||||
curbuf->b_op_start.lnum = ((from == 0) ? 1 : from);
|
||||
curbuf->b_op_start.col = 0;
|
||||
|
||||
try_mac = (vim_strchr(p_ffs, 'm') != NULL);
|
||||
try_dos = (vim_strchr(p_ffs, 'd') != NULL);
|
||||
try_unix = (vim_strchr(p_ffs, 'x') != NULL);
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (!read_buffer)
|
||||
{
|
||||
@@ -764,6 +773,11 @@ readfile(
|
||||
else
|
||||
apply_autocmds_exarg(EVENT_FILEREADPRE, sfname, sfname,
|
||||
FALSE, NULL, eap);
|
||||
/* autocommands may have changed it */
|
||||
try_mac = (vim_strchr(p_ffs, 'm') != NULL);
|
||||
try_dos = (vim_strchr(p_ffs, 'd') != NULL);
|
||||
try_unix = (vim_strchr(p_ffs, 'x') != NULL);
|
||||
|
||||
if (msg_scrolled == n)
|
||||
msg_scroll = m;
|
||||
|
||||
@@ -2237,8 +2251,9 @@ rewind_retry:
|
||||
len = (colnr_T)(ptr - line_start + 1);
|
||||
if (fileformat == EOL_DOS)
|
||||
{
|
||||
if (ptr[-1] == CAR) /* remove CR */
|
||||
if (ptr > line_start && ptr[-1] == CAR)
|
||||
{
|
||||
/* remove CR before NL */
|
||||
ptr[-1] = NUL;
|
||||
--len;
|
||||
}
|
||||
@@ -7174,7 +7189,7 @@ buf_reload(buf_T *buf, int orig_mode)
|
||||
#endif
|
||||
if (readfile(buf->b_ffname, buf->b_fname, (linenr_T)0,
|
||||
(linenr_T)0,
|
||||
(linenr_T)MAXLNUM, &ea, flags) == FAIL)
|
||||
(linenr_T)MAXLNUM, &ea, flags) != OK)
|
||||
{
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
if (!aborting())
|
||||
|
||||
+7
-1
@@ -1817,6 +1817,12 @@ plain_vgetc(void)
|
||||
{
|
||||
c = safe_vgetc();
|
||||
} while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR);
|
||||
|
||||
if (c == K_PS)
|
||||
/* Only handle the first pasted character. Drop the rest, since we
|
||||
* don't know what to do with it. */
|
||||
c = bracketed_paste(PASTE_ONE_CHAR, FALSE, NULL);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -1906,7 +1912,7 @@ vungetc(int c)
|
||||
}
|
||||
|
||||
/*
|
||||
* get a character:
|
||||
* Get a character:
|
||||
* 1. from the stuffbuffer
|
||||
* This is used for abbreviated commands like "D" -> "d$".
|
||||
* Also used to redo a command for ".".
|
||||
|
||||
+9
-6
@@ -3171,9 +3171,9 @@ delete_event_cb(GtkWidget *widget UNUSED,
|
||||
static int
|
||||
get_item_dimensions(GtkWidget *widget, GtkOrientation orientation)
|
||||
{
|
||||
# ifdef FEAT_GUI_GNOME
|
||||
GtkOrientation item_orientation = GTK_ORIENTATION_HORIZONTAL;
|
||||
|
||||
# ifdef FEAT_GUI_GNOME
|
||||
if (using_gnome && widget != NULL)
|
||||
{
|
||||
GtkWidget *parent;
|
||||
@@ -3192,7 +3192,10 @@ get_item_dimensions(GtkWidget *widget, GtkOrientation orientation)
|
||||
item_orientation = bonobo_dock_item_get_orientation(dockitem);
|
||||
}
|
||||
}
|
||||
# else
|
||||
# define item_orientation GTK_ORIENTATION_HORIZONTAL
|
||||
# endif
|
||||
|
||||
# if GTK_CHECK_VERSION(3,0,0)
|
||||
if (widget != NULL
|
||||
&& item_orientation == orientation
|
||||
@@ -3209,16 +3212,16 @@ get_item_dimensions(GtkWidget *widget, GtkOrientation orientation)
|
||||
GtkAllocation allocation;
|
||||
|
||||
gtk_widget_get_allocation(widget, &allocation);
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
return allocation.height;
|
||||
else
|
||||
return allocation.width;
|
||||
return allocation.height;
|
||||
# else
|
||||
# ifdef FEAT_GUI_GNOME
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
return widget->allocation.height;
|
||||
else
|
||||
return widget->allocation.width;
|
||||
# else
|
||||
return widget->allocation.height;
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
return 0;
|
||||
|
||||
+47
-71
@@ -558,13 +558,12 @@ gui_mch_set_blinking(long wait, long on, long off)
|
||||
blink_offtime = off;
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static VOID CALLBACK
|
||||
_OnBlinkTimer(
|
||||
HWND hwnd,
|
||||
UINT uMsg,
|
||||
UINT uMsg UNUSED,
|
||||
UINT idEvent,
|
||||
DWORD dwTime)
|
||||
DWORD dwTime UNUSED)
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
@@ -590,7 +589,7 @@ _OnBlinkTimer(
|
||||
gui_update_cursor(TRUE, FALSE);
|
||||
blink_state = BLINK_ON;
|
||||
blink_timer = (UINT) SetTimer(NULL, 0, (UINT)blink_ontime,
|
||||
(TIMERPROC)_OnBlinkTimer);
|
||||
(TIMERPROC)_OnBlinkTimer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -644,13 +643,12 @@ gui_mch_start_blink(void)
|
||||
* Call-back routines.
|
||||
*/
|
||||
|
||||
/*ARGSUSED*/
|
||||
static VOID CALLBACK
|
||||
_OnTimer(
|
||||
HWND hwnd,
|
||||
UINT uMsg,
|
||||
UINT uMsg UNUSED,
|
||||
UINT idEvent,
|
||||
DWORD dwTime)
|
||||
DWORD dwTime UNUSED)
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
@@ -667,12 +665,11 @@ _OnTimer(
|
||||
s_wait_timer = 0;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
_OnDeadChar(
|
||||
HWND hwnd,
|
||||
UINT ch,
|
||||
int cRepeat)
|
||||
HWND hwnd UNUSED,
|
||||
UINT ch UNUSED,
|
||||
int cRepeat UNUSED)
|
||||
{
|
||||
dead_key = 1;
|
||||
}
|
||||
@@ -752,12 +749,11 @@ char_to_string(int ch, char_u *string, int slen, int had_alt)
|
||||
/*
|
||||
* Key hit, add it to the input buffer.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
_OnChar(
|
||||
HWND hwnd,
|
||||
HWND hwnd UNUSED,
|
||||
UINT ch,
|
||||
int cRepeat)
|
||||
int cRepeat UNUSED)
|
||||
{
|
||||
char_u string[40];
|
||||
int len = 0;
|
||||
@@ -777,12 +773,11 @@ _OnChar(
|
||||
/*
|
||||
* Alt-Key hit, add it to the input buffer.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
_OnSysChar(
|
||||
HWND hwnd,
|
||||
HWND hwnd UNUSED,
|
||||
UINT cch,
|
||||
int cRepeat)
|
||||
int cRepeat UNUSED)
|
||||
{
|
||||
char_u string[40]; /* Enough for multibyte character */
|
||||
int len;
|
||||
@@ -861,11 +856,10 @@ _OnMouseEvent(
|
||||
gui_send_mouse_event(button, x, y, repeated_click, vim_modifiers);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
_OnMouseButtonDown(
|
||||
HWND hwnd,
|
||||
BOOL fDoubleClick,
|
||||
HWND hwnd UNUSED,
|
||||
BOOL fDoubleClick UNUSED,
|
||||
int x,
|
||||
int y,
|
||||
UINT keyFlags)
|
||||
@@ -960,10 +954,9 @@ _OnMouseButtonDown(
|
||||
}
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
_OnMouseMoveOrRelease(
|
||||
HWND hwnd,
|
||||
HWND hwnd UNUSED,
|
||||
int x,
|
||||
int y,
|
||||
UINT keyFlags)
|
||||
@@ -1038,13 +1031,12 @@ gui_mswin_find_menu(
|
||||
return pMenu;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
_OnMenu(
|
||||
HWND hwnd,
|
||||
HWND hwnd UNUSED,
|
||||
int id,
|
||||
HWND hwndCtl,
|
||||
UINT codeNotify)
|
||||
HWND hwndCtl UNUSED,
|
||||
UINT codeNotify UNUSED)
|
||||
{
|
||||
vimmenu_T *pMenu;
|
||||
|
||||
@@ -1527,9 +1519,8 @@ gui_mch_get_font(
|
||||
* Return the name of font "font" in allocated memory.
|
||||
* Don't know how to get the actual name, thus use the provided name.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
char_u *
|
||||
gui_mch_get_fontname(GuiFont font, char_u *name)
|
||||
gui_mch_get_fontname(GuiFont font UNUSED, char_u *name)
|
||||
{
|
||||
if (name == NULL)
|
||||
return NULL;
|
||||
@@ -2175,13 +2166,12 @@ gui_mch_enable_menu(int flag)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
gui_mch_set_menu_pos(
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int h)
|
||||
int x UNUSED,
|
||||
int y UNUSED,
|
||||
int w UNUSED,
|
||||
int h UNUSED)
|
||||
{
|
||||
/* It will be in the right place anyway */
|
||||
}
|
||||
@@ -2817,10 +2807,8 @@ _OnEndSession(void)
|
||||
* Get this message when the user clicks on the cross in the top right corner
|
||||
* of a Windows95 window.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
_OnClose(
|
||||
HWND hwnd)
|
||||
_OnClose(HWND hwnd UNUSED)
|
||||
{
|
||||
gui_shell_closed();
|
||||
}
|
||||
@@ -2829,8 +2817,7 @@ _OnClose(
|
||||
* Get a message when the window is being destroyed.
|
||||
*/
|
||||
static void
|
||||
_OnDestroy(
|
||||
HWND hwnd)
|
||||
_OnDestroy(HWND hwnd)
|
||||
{
|
||||
if (!destroying)
|
||||
_OnClose(hwnd);
|
||||
@@ -2883,11 +2870,10 @@ _OnPaint(
|
||||
}
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
_OnSize(
|
||||
HWND hwnd,
|
||||
UINT state,
|
||||
UINT state UNUSED,
|
||||
int cx,
|
||||
int cy)
|
||||
{
|
||||
@@ -3124,9 +3110,8 @@ gui_mch_insert_lines(
|
||||
}
|
||||
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
gui_mch_exit(int rc)
|
||||
gui_mch_exit(int rc UNUSED)
|
||||
{
|
||||
#if defined(FEAT_DIRECTX)
|
||||
DWriteContext_Close(s_dwc);
|
||||
@@ -3285,9 +3270,8 @@ gui_mch_wide_font_changed(void)
|
||||
* Initialise vim to use the font with the given name.
|
||||
* Return FAIL if the font could not be loaded, OK otherwise.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
gui_mch_init_font(char_u *font_name, int fontset)
|
||||
gui_mch_init_font(char_u *font_name, int fontset UNUSED)
|
||||
{
|
||||
LOGFONT lf;
|
||||
GuiFont font = NOFONT;
|
||||
@@ -3416,11 +3400,10 @@ gui_mch_newfont(void)
|
||||
/*
|
||||
* Set the window title
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
gui_mch_settitle(
|
||||
char_u *title,
|
||||
char_u *icon)
|
||||
char_u *icon UNUSED)
|
||||
{
|
||||
set_window_title(s_hwnd, (title == NULL ? "VIM" : (char *)title));
|
||||
}
|
||||
@@ -3772,10 +3755,9 @@ gui_mch_browse(
|
||||
}
|
||||
#endif /* FEAT_BROWSE */
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
_OnDropFiles(
|
||||
HWND hwnd,
|
||||
HWND hwnd UNUSED,
|
||||
HDROP hDrop)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
@@ -3833,10 +3815,9 @@ _OnDropFiles(
|
||||
#endif
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static int
|
||||
_OnScroll(
|
||||
HWND hwnd,
|
||||
HWND hwnd UNUSED,
|
||||
HWND hwndCtl,
|
||||
UINT code,
|
||||
int pos)
|
||||
@@ -3954,7 +3935,6 @@ _OnScroll(
|
||||
* Return pointer to buffer in "tofree".
|
||||
* Returns zero when out of memory.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
get_cmd_args(char *prog, char *cmdline, char ***argvp, char **tofree)
|
||||
{
|
||||
@@ -5588,10 +5568,14 @@ get_work_area(RECT *spi_rect)
|
||||
/*
|
||||
* Set the size of the window to the given width and height in pixels.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
gui_mch_set_shellsize(int width, int height,
|
||||
int min_width, int min_height, int base_width, int base_height,
|
||||
gui_mch_set_shellsize(
|
||||
int width,
|
||||
int height,
|
||||
int min_width UNUSED,
|
||||
int min_height UNUSED,
|
||||
int base_width UNUSED,
|
||||
int base_height UNUSED,
|
||||
int direction)
|
||||
{
|
||||
RECT workarea_rect;
|
||||
@@ -5752,9 +5736,8 @@ gui_mch_set_sp_color(guicolor_T color)
|
||||
/*
|
||||
* handle WM_IME_NOTIFY message
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
static LRESULT
|
||||
_OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData)
|
||||
_OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData UNUSED)
|
||||
{
|
||||
LRESULT lResult = 0;
|
||||
HIMC hImc;
|
||||
@@ -5802,9 +5785,8 @@ _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData)
|
||||
return lResult;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static LRESULT
|
||||
_OnImeComposition(HWND hwnd, WPARAM dbcs, LPARAM param)
|
||||
_OnImeComposition(HWND hwnd, WPARAM dbcs UNUSED, LPARAM param)
|
||||
{
|
||||
char_u *ret;
|
||||
int len;
|
||||
@@ -6844,13 +6826,12 @@ gui_mch_menu_grey(
|
||||
* pressed, return that button's ID - IDCANCEL (2), which is the button's
|
||||
* number.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
static LRESULT CALLBACK
|
||||
dialog_callback(
|
||||
HWND hwnd,
|
||||
UINT message,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
LPARAM lParam UNUSED)
|
||||
{
|
||||
if (message == WM_INITDIALOG)
|
||||
{
|
||||
@@ -8536,13 +8517,12 @@ delete_tooltip(BalloonEval *beval)
|
||||
PostMessage(beval->balloon, WM_CLOSE, 0, 0);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static VOID CALLBACK
|
||||
BevalTimerProc(
|
||||
HWND hwnd,
|
||||
UINT uMsg,
|
||||
UINT_PTR idEvent,
|
||||
DWORD dwTime)
|
||||
HWND hwnd UNUSED,
|
||||
UINT uMsg UNUSED,
|
||||
UINT_PTR idEvent UNUSED,
|
||||
DWORD dwTime)
|
||||
{
|
||||
POINT pt;
|
||||
RECT rect;
|
||||
@@ -8578,16 +8558,14 @@ BevalTimerProc(
|
||||
}
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
gui_mch_disable_beval_area(BalloonEval *beval)
|
||||
gui_mch_disable_beval_area(BalloonEval *beval UNUSED)
|
||||
{
|
||||
// TRACE0("gui_mch_disable_beval_area {{{");
|
||||
KillTimer(s_textArea, BevalTimerId);
|
||||
// TRACE0("gui_mch_disable_beval_area }}}");
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
gui_mch_enable_beval_area(BalloonEval *beval)
|
||||
{
|
||||
@@ -8619,7 +8597,6 @@ gui_mch_post_balloon(BalloonEval *beval, char_u *mesg)
|
||||
// TRACE0("gui_mch_post_balloon }}}");
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
BalloonEval *
|
||||
gui_mch_create_beval_area(
|
||||
void *target, /* ignored, always use s_textArea */
|
||||
@@ -8659,9 +8636,8 @@ gui_mch_create_beval_area(
|
||||
return beval;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
Handle_WM_Notify(HWND hwnd, LPNMHDR pnmh)
|
||||
Handle_WM_Notify(HWND hwnd UNUSED, LPNMHDR pnmh)
|
||||
{
|
||||
if (pnmh->idFrom != ID_BEVAL_TOOLTIP) /* it is not our tooltip */
|
||||
return;
|
||||
|
||||
@@ -70,7 +70,6 @@ hash_init(hashtab_T *ht)
|
||||
ht->ht_mask = HT_INIT_SIZE - 1;
|
||||
}
|
||||
|
||||
#if defined(FEAT_EVAL) || defined(FEAT_SYN_HL) || defined(PROTO)
|
||||
/*
|
||||
* Free the array of a hash table. Does not free the items it contains!
|
||||
* If "ht" is not freed then you should call hash_init() next!
|
||||
@@ -104,7 +103,6 @@ hash_clear_all(hashtab_T *ht, int off)
|
||||
}
|
||||
hash_clear(ht);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Find "key" in hashtable "ht". "key" must not be NULL.
|
||||
|
||||
+1
-1
@@ -207,7 +207,7 @@ set_context_in_cscope_cmd(
|
||||
static void
|
||||
do_cscope_general(
|
||||
exarg_T *eap,
|
||||
int make_split) /* whether to split window */
|
||||
int make_split UNUSED) /* whether to split window */
|
||||
{
|
||||
cscmd_T *cmdp;
|
||||
|
||||
|
||||
@@ -1716,6 +1716,8 @@ ex_luado(exarg_T *eap)
|
||||
const char *s = (const char *) eap->arg;
|
||||
luaL_Buffer b;
|
||||
size_t len;
|
||||
buf_T *was_curbuf = curbuf;
|
||||
|
||||
if (lua_init() == FAIL) return;
|
||||
if (u_save(eap->line1 - 1, eap->line2 + 1) == FAIL)
|
||||
{
|
||||
@@ -1739,6 +1741,10 @@ ex_luado(exarg_T *eap)
|
||||
lua_replace(L, -2); /* function -> body */
|
||||
for (l = eap->line1; l <= eap->line2; l++)
|
||||
{
|
||||
/* Check the line number, the command my have deleted lines. */
|
||||
if (l > curbuf->b_ml.ml_line_count)
|
||||
break;
|
||||
|
||||
lua_pushvalue(L, -1); /* function */
|
||||
luaV_pushline(L, curbuf, l); /* current line as arg */
|
||||
lua_pushinteger(L, l); /* current line number as arg */
|
||||
@@ -1747,6 +1753,9 @@ ex_luado(exarg_T *eap)
|
||||
luaV_emsg(L);
|
||||
break;
|
||||
}
|
||||
/* Catch the command switching to another buffer. */
|
||||
if (curbuf != was_curbuf)
|
||||
break;
|
||||
if (lua_isstring(L, -1)) /* update line? */
|
||||
{
|
||||
#ifdef HAVE_SANDBOX
|
||||
|
||||
+5
-1
@@ -1286,6 +1286,7 @@ ex_perldo(exarg_T *eap)
|
||||
SV *sv;
|
||||
char *str;
|
||||
linenr_T i;
|
||||
buf_T *was_curbuf = curbuf;
|
||||
|
||||
if (bufempty())
|
||||
return;
|
||||
@@ -1321,11 +1322,14 @@ ex_perldo(exarg_T *eap)
|
||||
SAVETMPS;
|
||||
for (i = eap->line1; i <= eap->line2; i++)
|
||||
{
|
||||
/* Check the line number, the command my have deleted lines. */
|
||||
if (i > curbuf->b_ml.ml_line_count)
|
||||
break;
|
||||
sv_setpv(GvSV(PL_defgv), (char *)ml_get(i));
|
||||
PUSHMARK(sp);
|
||||
perl_call_pv("VIM::perldo", G_SCALAR | G_EVAL);
|
||||
str = SvPV(GvSV(PL_errgv), length);
|
||||
if (length)
|
||||
if (length || curbuf != was_curbuf)
|
||||
break;
|
||||
SPAGAIN;
|
||||
if (SvTRUEx(POPs))
|
||||
|
||||
+14
-1
@@ -5619,6 +5619,7 @@ run_do(const char *cmd, void *arg UNUSED
|
||||
int status;
|
||||
PyObject *pyfunc, *pymain;
|
||||
PyObject *run_ret;
|
||||
buf_T *was_curbuf = curbuf;
|
||||
|
||||
if (u_save((linenr_T)RangeStart - 1, (linenr_T)RangeEnd + 1) != OK)
|
||||
{
|
||||
@@ -5671,7 +5672,9 @@ run_do(const char *cmd, void *arg UNUSED
|
||||
#ifdef PY_CAN_RECURSE
|
||||
*pygilstate = PyGILState_Ensure();
|
||||
#endif
|
||||
if (!(line = GetBufferLine(curbuf, lnum)))
|
||||
/* Check the line number, the command my have deleted lines. */
|
||||
if (lnum > curbuf->b_ml.ml_line_count
|
||||
|| !(line = GetBufferLine(curbuf, lnum)))
|
||||
goto err;
|
||||
if (!(linenr = PyInt_FromLong((long) lnum)))
|
||||
{
|
||||
@@ -5684,9 +5687,19 @@ run_do(const char *cmd, void *arg UNUSED
|
||||
if (!ret)
|
||||
goto err;
|
||||
|
||||
/* Check that the command didn't switch to another buffer. */
|
||||
if (curbuf != was_curbuf)
|
||||
{
|
||||
Py_XDECREF(ret);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (ret != Py_None)
|
||||
if (SetBufferLine(curbuf, lnum, ret, NULL) == FAIL)
|
||||
{
|
||||
Py_XDECREF(ret);
|
||||
goto err;
|
||||
}
|
||||
|
||||
Py_XDECREF(ret);
|
||||
PythonIO_Flush();
|
||||
|
||||
@@ -1122,6 +1122,9 @@ ex_python(exarg_T *eap)
|
||||
{
|
||||
char_u *script;
|
||||
|
||||
if (p_pyx == 0)
|
||||
p_pyx = 2;
|
||||
|
||||
script = script_get(eap, eap->arg);
|
||||
if (!eap->skip)
|
||||
{
|
||||
@@ -1145,6 +1148,9 @@ ex_pyfile(exarg_T *eap)
|
||||
const char *file = (char *)eap->arg;
|
||||
char *p;
|
||||
|
||||
if (p_pyx == 0)
|
||||
p_pyx = 2;
|
||||
|
||||
/* 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
|
||||
* different options under Windows, meaning that stdio pointers aren't
|
||||
@@ -1183,6 +1189,9 @@ ex_pyfile(exarg_T *eap)
|
||||
void
|
||||
ex_pydo(exarg_T *eap)
|
||||
{
|
||||
if (p_pyx == 0)
|
||||
p_pyx = 2;
|
||||
|
||||
DoPyCommand((char *)eap->arg,
|
||||
(rangeinitializer) init_range_cmd,
|
||||
(runner)run_do,
|
||||
|
||||
@@ -1018,6 +1018,9 @@ ex_py3(exarg_T *eap)
|
||||
{
|
||||
char_u *script;
|
||||
|
||||
if (p_pyx == 0)
|
||||
p_pyx = 3;
|
||||
|
||||
script = script_get(eap, eap->arg);
|
||||
if (!eap->skip)
|
||||
{
|
||||
@@ -1042,6 +1045,9 @@ ex_py3file(exarg_T *eap)
|
||||
char *p;
|
||||
int i;
|
||||
|
||||
if (p_pyx == 0)
|
||||
p_pyx = 3;
|
||||
|
||||
/* 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
|
||||
* different options under Windows, meaning that stdio pointers aren't
|
||||
@@ -1094,6 +1100,9 @@ ex_py3file(exarg_T *eap)
|
||||
void
|
||||
ex_py3do(exarg_T *eap)
|
||||
{
|
||||
if (p_pyx == 0)
|
||||
p_pyx = 3;
|
||||
|
||||
DoPyCommand((char *)eap->arg,
|
||||
(rangeinitializer)init_range_cmd,
|
||||
(runner)run_do,
|
||||
|
||||
+13
-4
@@ -312,6 +312,7 @@ static void ruby_vim_init(void);
|
||||
# define ruby_init_loadpath dll_ruby_init_loadpath
|
||||
# ifdef WIN3264
|
||||
# define NtInitialize dll_NtInitialize
|
||||
# define ruby_sysinit dll_ruby_sysinit
|
||||
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
|
||||
# define rb_w32_snprintf dll_rb_w32_snprintf
|
||||
# endif
|
||||
@@ -414,6 +415,7 @@ static void (*dll_ruby_init) (void);
|
||||
static void (*dll_ruby_init_loadpath) (void);
|
||||
# ifdef WIN3264
|
||||
static void (*dll_NtInitialize) (int*, char***);
|
||||
static void (*dll_ruby_sysinit) (int*, char***);
|
||||
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
|
||||
static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...);
|
||||
# endif
|
||||
@@ -603,13 +605,11 @@ static struct
|
||||
{"ruby_init", (RUBY_PROC*)&dll_ruby_init},
|
||||
{"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath},
|
||||
# ifdef WIN3264
|
||||
{
|
||||
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 19
|
||||
"NtInitialize",
|
||||
{"NtInitialize", (RUBY_PROC*)&dll_NtInitialize},
|
||||
# else
|
||||
"ruby_sysinit",
|
||||
{"ruby_sysinit", (RUBY_PROC*)&dll_ruby_sysinit},
|
||||
# endif
|
||||
(RUBY_PROC*)&dll_NtInitialize},
|
||||
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
|
||||
{"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf},
|
||||
# endif
|
||||
@@ -792,6 +792,7 @@ void ex_rubydo(exarg_T *eap)
|
||||
{
|
||||
int state;
|
||||
linenr_T i;
|
||||
buf_T *was_curbuf = curbuf;
|
||||
|
||||
if (ensure_ruby_initialized())
|
||||
{
|
||||
@@ -801,6 +802,8 @@ void ex_rubydo(exarg_T *eap)
|
||||
{
|
||||
VALUE line;
|
||||
|
||||
if (i > curbuf->b_ml.ml_line_count)
|
||||
break;
|
||||
line = vim_str2rb_enc_str((char *)ml_get(i));
|
||||
rb_lastline_set(line);
|
||||
eval_enc_string_protect((char *) eap->arg, &state);
|
||||
@@ -809,6 +812,8 @@ void ex_rubydo(exarg_T *eap)
|
||||
error_print(state);
|
||||
break;
|
||||
}
|
||||
if (was_curbuf != curbuf)
|
||||
break;
|
||||
line = rb_lastline_get();
|
||||
if (!NIL_P(line))
|
||||
{
|
||||
@@ -871,7 +876,11 @@ static int ensure_ruby_initialized(void)
|
||||
int argc = 1;
|
||||
char *argv[] = {"gvim.exe"};
|
||||
char **argvp = argv;
|
||||
# ifdef RUBY19_OR_LATER
|
||||
ruby_sysinit(&argc, &argvp);
|
||||
# else
|
||||
NtInitialize(&argc, &argvp);
|
||||
# endif
|
||||
#endif
|
||||
{
|
||||
#if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
|
||||
|
||||
+4
-1
@@ -1958,6 +1958,7 @@ ex_tcldo(exarg_T *eap)
|
||||
char var_line[VARNAME_SIZE];
|
||||
linenr_T first_line = 0;
|
||||
linenr_T last_line = 0;
|
||||
buf_T *was_curbuf = curbuf;
|
||||
|
||||
rs = eap->line1;
|
||||
re = eap->line2;
|
||||
@@ -1979,6 +1980,8 @@ ex_tcldo(exarg_T *eap)
|
||||
}
|
||||
while (err == TCL_OK && rs <= re)
|
||||
{
|
||||
if ((linenr_T)rs > curbuf->b_ml.ml_line_count)
|
||||
break;
|
||||
line = (char *)ml_get_buf(curbuf, (linenr_T)rs, FALSE);
|
||||
if (!line)
|
||||
{
|
||||
@@ -1994,7 +1997,7 @@ ex_tcldo(exarg_T *eap)
|
||||
#if (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 5) || TCL_MAJOR_VERSION > 8
|
||||
|| Tcl_LimitExceeded(tclinfo.interp)
|
||||
#endif
|
||||
)
|
||||
|| curbuf != was_curbuf)
|
||||
break;
|
||||
line = (char *)Tcl_GetVar(tclinfo.interp, var_line, 0);
|
||||
if (line)
|
||||
|
||||
+9
-5
@@ -629,10 +629,13 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
|
||||
key = p = reader->js_buf + reader->js_used;
|
||||
while (*p != NUL && *p != ':' && *p > ' ')
|
||||
++p;
|
||||
cur_item->v_type = VAR_STRING;
|
||||
cur_item->vval.v_string = vim_strnsave(key, (int)(p - key));
|
||||
if (cur_item != NULL)
|
||||
{
|
||||
cur_item->v_type = VAR_STRING;
|
||||
cur_item->vval.v_string = vim_strnsave(key, (int)(p - key));
|
||||
top_item->jd_key = cur_item->vval.v_string;
|
||||
}
|
||||
reader->js_used += (int)(p - key);
|
||||
top_item->jd_key = cur_item->vval.v_string;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -936,7 +939,7 @@ item_end:
|
||||
&& dict_find(top_item->jd_tv.vval.v_dict,
|
||||
top_item->jd_key, -1) != NULL)
|
||||
{
|
||||
EMSG2(_("E937: Duplicate key in JSON: \"%s\""),
|
||||
EMSG2(_("E938: Duplicate key in JSON: \"%s\""),
|
||||
top_item->jd_key);
|
||||
clear_tv(&top_item->jd_key_tv);
|
||||
clear_tv(cur_item);
|
||||
@@ -1053,7 +1056,8 @@ json_decode(js_read_T *reader, typval_T *res, int options)
|
||||
|
||||
/*
|
||||
* Decode the JSON from "reader" to find the end of the message.
|
||||
* "options" can be JSON_JS or zero;
|
||||
* "options" can be JSON_JS or zero.
|
||||
* This is only used for testing.
|
||||
* Return FAIL if the message has a decoding error.
|
||||
* Return MAYBE if the message is truncated, need to read more.
|
||||
* This only works reliable if the message contains an object, array or
|
||||
|
||||
@@ -107,6 +107,12 @@ test_decode_find_end(void)
|
||||
reader.js_buf = (char_u *)" { ";
|
||||
assert(json_find_end(&reader, 0) == MAYBE);
|
||||
|
||||
/* JS object with white space */
|
||||
reader.js_buf = (char_u *)" { a : 123 } ";
|
||||
assert(json_find_end(&reader, JSON_JS) == OK);
|
||||
reader.js_buf = (char_u *)" { a : ";
|
||||
assert(json_find_end(&reader, JSON_JS) == MAYBE);
|
||||
|
||||
/* array without white space */
|
||||
reader.js_buf = (char_u *)"[\"a\",123]";
|
||||
assert(json_find_end(&reader, 0) == OK);
|
||||
|
||||
+5
-2
@@ -398,6 +398,8 @@ enum key_extra
|
||||
#define K_KMULTIPLY TERMCAP2KEY('K', '9') /* keypad * */
|
||||
#define K_KENTER TERMCAP2KEY('K', 'A') /* keypad Enter */
|
||||
#define K_KPOINT TERMCAP2KEY('K', 'B') /* keypad . or ,*/
|
||||
#define K_PS TERMCAP2KEY('P', 'S') /* paste start */
|
||||
#define K_PE TERMCAP2KEY('P', 'E') /* paste end */
|
||||
|
||||
#define K_K0 TERMCAP2KEY('K', 'C') /* keypad 0 */
|
||||
#define K_K1 TERMCAP2KEY('K', 'D') /* keypad 1 */
|
||||
@@ -494,9 +496,10 @@ enum key_extra
|
||||
|
||||
/*
|
||||
* The length of the longest special key name, including modifiers.
|
||||
* Current longest is <M-C-S-T-4-MiddleRelease> (length includes '<' and '>').
|
||||
* Current longest is <M-C-S-T-D-A-4-ScrollWheelRight> (length includes '<' and
|
||||
* '>').
|
||||
*/
|
||||
#define MAX_KEY_NAME_LEN 25
|
||||
#define MAX_KEY_NAME_LEN 32
|
||||
|
||||
/* Maximum length of a special key event as tokens. This includes modifiers.
|
||||
* The longest event is something like <M-C-S-T-4-LeftDrag> which would be the
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
+15
-9
@@ -57,6 +57,7 @@ setmark(int c)
|
||||
setmark_pos(int c, pos_T *pos, int fnum)
|
||||
{
|
||||
int i;
|
||||
buf_T *buf;
|
||||
|
||||
/* Check for a special key (may cause islower() to crash). */
|
||||
if (c < 0)
|
||||
@@ -75,9 +76,13 @@ setmark_pos(int c, pos_T *pos, int fnum)
|
||||
return OK;
|
||||
}
|
||||
|
||||
buf = buflist_findnr(fnum);
|
||||
if (buf == NULL)
|
||||
return FAIL;
|
||||
|
||||
if (c == '"')
|
||||
{
|
||||
curbuf->b_last_cursor = *pos;
|
||||
buf->b_last_cursor = *pos;
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -85,31 +90,31 @@ setmark_pos(int c, pos_T *pos, int fnum)
|
||||
* file. */
|
||||
if (c == '[')
|
||||
{
|
||||
curbuf->b_op_start = *pos;
|
||||
buf->b_op_start = *pos;
|
||||
return OK;
|
||||
}
|
||||
if (c == ']')
|
||||
{
|
||||
curbuf->b_op_end = *pos;
|
||||
buf->b_op_end = *pos;
|
||||
return OK;
|
||||
}
|
||||
|
||||
if (c == '<' || c == '>')
|
||||
{
|
||||
if (c == '<')
|
||||
curbuf->b_visual.vi_start = *pos;
|
||||
buf->b_visual.vi_start = *pos;
|
||||
else
|
||||
curbuf->b_visual.vi_end = *pos;
|
||||
if (curbuf->b_visual.vi_mode == NUL)
|
||||
buf->b_visual.vi_end = *pos;
|
||||
if (buf->b_visual.vi_mode == NUL)
|
||||
/* 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;
|
||||
}
|
||||
|
||||
if (ASCII_ISLOWER(c))
|
||||
{
|
||||
i = c - 'a';
|
||||
curbuf->b_namedm[i] = *pos;
|
||||
buf->b_namedm[i] = *pos;
|
||||
return OK;
|
||||
}
|
||||
if (ASCII_ISUPPER(c) || VIM_ISDIGIT(c))
|
||||
@@ -396,7 +401,8 @@ getmark_buf_fnum(
|
||||
{
|
||||
startp = &buf->b_visual.vi_start;
|
||||
endp = &buf->b_visual.vi_end;
|
||||
if ((c == '<') == lt(*startp, *endp))
|
||||
if (((c == '<') == lt(*startp, *endp) || endp->lnum == 0)
|
||||
&& startp->lnum != 0)
|
||||
posp = startp;
|
||||
else
|
||||
posp = endp;
|
||||
|
||||
+9
-44
@@ -895,7 +895,7 @@ mb_get_class_buf(char_u *p, buf_T *buf)
|
||||
if (enc_dbcs != 0 && p[0] != NUL && p[1] != NUL)
|
||||
return dbcs_class(p[0], p[1]);
|
||||
if (enc_utf8)
|
||||
return utf_class(utf_ptr2char(p));
|
||||
return utf_class_buf(utf_ptr2char(p), buf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2693,6 +2693,12 @@ static struct interval emoji_all[] =
|
||||
*/
|
||||
int
|
||||
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 */
|
||||
static struct clinterval
|
||||
@@ -2780,7 +2786,7 @@ utf_class(int c)
|
||||
{
|
||||
if (c == ' ' || c == '\t' || c == NUL || c == 0xa0)
|
||||
return 0; /* blank */
|
||||
if (vim_iswordc(c))
|
||||
if (vim_iswordc_buf(c, buf))
|
||||
return 2; /* word character */
|
||||
return 1; /* punctuation */
|
||||
}
|
||||
@@ -4583,47 +4589,6 @@ static HINSTANCE hMsvcrtDLL = 0;
|
||||
# define DYNAMIC_MSVCRT_DLL "msvcrt.dll"
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Get the address of 'funcname' which is imported by 'hInst' DLL.
|
||||
*/
|
||||
static void *
|
||||
get_iconv_import_func(HINSTANCE hInst, const char *funcname)
|
||||
{
|
||||
PBYTE pImage = (PBYTE)hInst;
|
||||
PIMAGE_DOS_HEADER pDOS = (PIMAGE_DOS_HEADER)hInst;
|
||||
PIMAGE_NT_HEADERS pPE;
|
||||
PIMAGE_IMPORT_DESCRIPTOR pImpDesc;
|
||||
PIMAGE_THUNK_DATA pIAT; /* Import Address Table */
|
||||
PIMAGE_THUNK_DATA pINT; /* Import Name Table */
|
||||
PIMAGE_IMPORT_BY_NAME pImpName;
|
||||
|
||||
if (pDOS->e_magic != IMAGE_DOS_SIGNATURE)
|
||||
return NULL;
|
||||
pPE = (PIMAGE_NT_HEADERS)(pImage + pDOS->e_lfanew);
|
||||
if (pPE->Signature != IMAGE_NT_SIGNATURE)
|
||||
return NULL;
|
||||
pImpDesc = (PIMAGE_IMPORT_DESCRIPTOR)(pImage
|
||||
+ pPE->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT]
|
||||
.VirtualAddress);
|
||||
for (; pImpDesc->FirstThunk; ++pImpDesc)
|
||||
{
|
||||
if (!pImpDesc->OriginalFirstThunk)
|
||||
continue;
|
||||
pIAT = (PIMAGE_THUNK_DATA)(pImage + pImpDesc->FirstThunk);
|
||||
pINT = (PIMAGE_THUNK_DATA)(pImage + pImpDesc->OriginalFirstThunk);
|
||||
for (; pIAT->u1.Function; ++pIAT, ++pINT)
|
||||
{
|
||||
if (IMAGE_SNAP_BY_ORDINAL(pINT->u1.Ordinal))
|
||||
continue;
|
||||
pImpName = (PIMAGE_IMPORT_BY_NAME)(pImage
|
||||
+ (UINT_PTR)(pINT->u1.AddressOfData));
|
||||
if (strcmp((char *)pImpName->Name, funcname) == 0)
|
||||
return (void *)pIAT->u1.Function;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try opening the iconv.dll and return TRUE if iconv() can be used.
|
||||
*/
|
||||
@@ -4671,7 +4636,7 @@ iconv_enabled(int verbose)
|
||||
iconv_open = (void *)GetProcAddress(hIconvDLL, "libiconv_open");
|
||||
iconv_close = (void *)GetProcAddress(hIconvDLL, "libiconv_close");
|
||||
iconvctl = (void *)GetProcAddress(hIconvDLL, "libiconvctl");
|
||||
iconv_errno = get_iconv_import_func(hIconvDLL, "_errno");
|
||||
iconv_errno = get_dll_import_func(hIconvDLL, "_errno");
|
||||
if (iconv_errno == NULL)
|
||||
iconv_errno = (void *)GetProcAddress(hMsvcrtDLL, "_errno");
|
||||
if (iconv == NULL || iconv_open == NULL || iconv_close == NULL
|
||||
|
||||
+1
-1
@@ -1519,7 +1519,7 @@ ml_recover(void)
|
||||
line_count = pp->pb_pointer[idx].pe_line_count;
|
||||
if (readfile(curbuf->b_ffname, NULL, lnum,
|
||||
pp->pb_pointer[idx].pe_old_lnum - 1,
|
||||
line_count, NULL, 0) == FAIL)
|
||||
line_count, NULL, 0) != OK)
|
||||
cannot_open = TRUE;
|
||||
else
|
||||
lnum += line_count;
|
||||
|
||||
+2
-2
@@ -578,8 +578,6 @@ emsg(char_u *s)
|
||||
return TRUE;
|
||||
|
||||
called_emsg = TRUE;
|
||||
if (emsg_silent == 0)
|
||||
ex_exitval = 1;
|
||||
|
||||
/*
|
||||
* If "emsg_severe" is TRUE: When an error exception is to be thrown,
|
||||
@@ -642,6 +640,8 @@ emsg(char_u *s)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
ex_exitval = 1;
|
||||
|
||||
/* Reset msg_silent, an error causes messages to be switched back on. */
|
||||
msg_silent = 0;
|
||||
cmd_silent = FALSE;
|
||||
|
||||
+10
-8
@@ -2177,16 +2177,19 @@ ins_bytes_len(char_u *p, int len)
|
||||
void
|
||||
ins_char(int c)
|
||||
{
|
||||
#if defined(FEAT_MBYTE) || defined(PROTO)
|
||||
char_u buf[MB_MAXBYTES + 1];
|
||||
int n;
|
||||
int n = 1;
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
n = (*mb_char2bytes)(c, buf);
|
||||
|
||||
/* When "c" is 0x100, 0x200, etc. we don't want to insert a NUL byte.
|
||||
* Happens for CTRL-Vu9900. */
|
||||
if (buf[0] == 0)
|
||||
buf[0] = '\n';
|
||||
#else
|
||||
buf[0] = c;
|
||||
#endif
|
||||
|
||||
ins_char_bytes(buf, n);
|
||||
}
|
||||
@@ -2195,7 +2198,6 @@ ins_char(int c)
|
||||
ins_char_bytes(char_u *buf, int charlen)
|
||||
{
|
||||
int c = buf[0];
|
||||
#endif
|
||||
int newlen; /* nr of bytes inserted */
|
||||
int oldlen; /* nr of bytes deleted (0 when not replacing) */
|
||||
char_u *p;
|
||||
@@ -2218,11 +2220,7 @@ ins_char_bytes(char_u *buf, int charlen)
|
||||
|
||||
/* The lengths default to the values for when not replacing. */
|
||||
oldlen = 0;
|
||||
#ifdef FEAT_MBYTE
|
||||
newlen = charlen;
|
||||
#else
|
||||
newlen = 1;
|
||||
#endif
|
||||
|
||||
if (State & REPLACE_FLAG)
|
||||
{
|
||||
@@ -3266,7 +3264,11 @@ change_warning(
|
||||
#endif
|
||||
msg_clr_eos();
|
||||
(void)msg_end();
|
||||
if (msg_silent == 0 && !silent_mode)
|
||||
if (msg_silent == 0 && !silent_mode
|
||||
#ifdef FEAT_EVAL
|
||||
&& time_for_testing != 1
|
||||
#endif
|
||||
)
|
||||
{
|
||||
out_flush();
|
||||
ui_delay(1000L, TRUE); /* give the user time to think about it */
|
||||
|
||||
+80
-33
@@ -1602,7 +1602,10 @@ strup_save(char_u *orig)
|
||||
{
|
||||
s = alloc((unsigned)STRLEN(res) + 1 + newl - l);
|
||||
if (s == NULL)
|
||||
break;
|
||||
{
|
||||
vim_free(res);
|
||||
return NULL;
|
||||
}
|
||||
mch_memmove(s, res, p - res);
|
||||
STRCPY(s + (p - res) + newl, p + l);
|
||||
p = s + (p - res);
|
||||
@@ -1625,6 +1628,69 @@ strup_save(char_u *orig)
|
||||
|
||||
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
|
||||
|
||||
/*
|
||||
@@ -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
|
||||
* always NUL terminated.
|
||||
* always NUL terminated. "from" and "to" may overlap.
|
||||
*/
|
||||
void
|
||||
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;
|
||||
}
|
||||
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
|
||||
|
||||
/* 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)
|
||||
/*
|
||||
* Compare two strings, ignoring case, using current locale.
|
||||
@@ -2162,6 +2200,7 @@ static struct modmasktable
|
||||
/* 'A' must be the last one */
|
||||
{MOD_MASK_ALT, MOD_MASK_ALT, (char_u)'A'},
|
||||
{0, 0, NUL}
|
||||
/* NOTE: when adding an entry, update MAX_KEY_NAME_LEN! */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -2294,6 +2333,8 @@ static struct key_name_entry
|
||||
{K_XDOWN, (char_u *)"xDown"},
|
||||
{K_XLEFT, (char_u *)"xLeft"},
|
||||
{K_XRIGHT, (char_u *)"xRight"},
|
||||
{K_PS, (char_u *)"PasteStart"},
|
||||
{K_PE, (char_u *)"PasteEnd"},
|
||||
|
||||
{K_F1, (char_u *)"F1"},
|
||||
{K_F2, (char_u *)"F2"},
|
||||
@@ -2435,6 +2476,7 @@ static struct key_name_entry
|
||||
{K_SWIPEDOWN, (char_u *)"SwipeDown"},
|
||||
#endif
|
||||
{0, NULL}
|
||||
/* NOTE: When adding a long name update MAX_KEY_NAME_LEN. */
|
||||
};
|
||||
|
||||
#define KEY_NAMES_TABLE_LEN (sizeof(key_names_table) / sizeof(struct key_name_entry))
|
||||
@@ -2663,8 +2705,13 @@ get_special_key_name(int c, int modifiers)
|
||||
}
|
||||
else /* use name of special key */
|
||||
{
|
||||
STRCPY(string + idx, key_names_table[table_idx].name);
|
||||
idx = (int)STRLEN(string);
|
||||
size_t len = STRLEN(key_names_table[table_idx].name);
|
||||
|
||||
if (len + idx + 2 <= MAX_KEY_NAME_LEN)
|
||||
{
|
||||
STRCPY(string + idx, key_names_table[table_idx].name);
|
||||
idx += (int)len;
|
||||
}
|
||||
}
|
||||
string[idx++] = '>';
|
||||
string[idx] = NUL;
|
||||
|
||||
@@ -2870,6 +2870,10 @@ do_check_cursorbind(void)
|
||||
restart_edit_save = restart_edit;
|
||||
restart_edit = TRUE;
|
||||
check_cursor();
|
||||
# ifdef FEAT_SYN_HL
|
||||
if (curwin->w_p_cul || curwin->w_p_cuc)
|
||||
validate_cursor();
|
||||
# endif
|
||||
restart_edit = restart_edit_save;
|
||||
# ifdef FEAT_MBYTE
|
||||
/* Correct cursor for multi-byte character. */
|
||||
|
||||
+9
-5
@@ -2332,7 +2332,8 @@ special_keys(char_u *args)
|
||||
char *save_str = nb_unquote(args, NULL);
|
||||
char *tok = strtok(save_str, " ");
|
||||
char *sep;
|
||||
char keybuf[64];
|
||||
#define KEYBUFLEN 64
|
||||
char keybuf[KEYBUFLEN];
|
||||
char cmdbuf[256];
|
||||
|
||||
while (tok != NULL)
|
||||
@@ -2359,10 +2360,13 @@ special_keys(char_u *args)
|
||||
tok++;
|
||||
}
|
||||
|
||||
strcpy(&keybuf[i], tok);
|
||||
vim_snprintf(cmdbuf, sizeof(cmdbuf),
|
||||
"<silent><%s> :nbkey %s<CR>", keybuf, keybuf);
|
||||
do_map(0, (char_u *)cmdbuf, NORMAL, FALSE);
|
||||
if (strlen(tok) + i < KEYBUFLEN)
|
||||
{
|
||||
strcpy(&keybuf[i], tok);
|
||||
vim_snprintf(cmdbuf, sizeof(cmdbuf),
|
||||
"<silent><%s> :nbkey %s<CR>", keybuf, keybuf);
|
||||
do_map(0, (char_u *)cmdbuf, NORMAL, FALSE);
|
||||
}
|
||||
tok = strtok(NULL, " ");
|
||||
}
|
||||
vim_free(save_str);
|
||||
|
||||
+25
-7
@@ -426,6 +426,7 @@ static const struct nv_cmd
|
||||
#ifdef FEAT_AUTOCMD
|
||||
{K_CURSORHOLD, nv_cursorhold, NV_KEEPREG, 0},
|
||||
#endif
|
||||
{K_PS, nv_edit, 0, 0},
|
||||
};
|
||||
|
||||
/* Number of commands in nv_cmds[]. */
|
||||
@@ -1984,7 +1985,7 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
|
||||
op_formatexpr(oap); /* use expression */
|
||||
else
|
||||
#endif
|
||||
if (*p_fp != NUL)
|
||||
if (*p_fp != NUL || *curbuf->b_p_fp != NUL)
|
||||
op_colon(oap); /* use external command */
|
||||
else
|
||||
op_format(oap, FALSE); /* use internal function */
|
||||
@@ -2040,6 +2041,8 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
|
||||
|
||||
if (restart_edit == 0)
|
||||
restart_edit = restart_edit_save;
|
||||
else
|
||||
cap->retval |= CA_COMMAND_BUSY;
|
||||
}
|
||||
#else
|
||||
vim_beep(BO_OPER);
|
||||
@@ -2197,10 +2200,12 @@ op_colon(oparg_T *oap)
|
||||
}
|
||||
else if (oap->op_type == OP_FORMAT)
|
||||
{
|
||||
if (*p_fp == NUL)
|
||||
stuffReadbuff((char_u *)"fmt");
|
||||
else
|
||||
if (*curbuf->b_p_fp != NUL)
|
||||
stuffReadbuff(curbuf->b_p_fp);
|
||||
else if (*p_fp != NUL)
|
||||
stuffReadbuff(p_fp);
|
||||
else
|
||||
stuffReadbuff((char_u *)"fmt");
|
||||
stuffReadbuff((char_u *)"\n']");
|
||||
}
|
||||
|
||||
@@ -2982,9 +2987,9 @@ do_mouse(
|
||||
if (State & INSERT)
|
||||
stuffcharReadbuff(Ctrl_O);
|
||||
if (curwin->w_llist_ref == NULL) /* quickfix window */
|
||||
stuffReadbuff((char_u *)":.cc\n");
|
||||
do_cmdline_cmd((char_u *)".cc");
|
||||
else /* location list window */
|
||||
stuffReadbuff((char_u *)":.ll\n");
|
||||
do_cmdline_cmd((char_u *)".ll");
|
||||
got_click = FALSE; /* ignore drag&release now */
|
||||
}
|
||||
#endif
|
||||
@@ -3858,7 +3863,7 @@ add_to_showcmd(int c)
|
||||
K_VER_SCROLLBAR, K_HOR_SCROLLBAR,
|
||||
K_LEFTMOUSE_NM, K_LEFTRELEASE_NM,
|
||||
# endif
|
||||
K_IGNORE,
|
||||
K_IGNORE, K_PS,
|
||||
K_LEFTMOUSE, K_LEFTDRAG, K_LEFTRELEASE,
|
||||
K_MIDDLEMOUSE, K_MIDDLEDRAG, K_MIDDLERELEASE,
|
||||
K_RIGHTMOUSE, K_RIGHTDRAG, K_RIGHTRELEASE,
|
||||
@@ -9047,6 +9052,7 @@ nv_esc(cmdarg_T *cap)
|
||||
|
||||
/*
|
||||
* Handle "A", "a", "I", "i" and <Insert> commands.
|
||||
* Also handle K_PS, start bracketed paste.
|
||||
*/
|
||||
static void
|
||||
nv_edit(cmdarg_T *cap)
|
||||
@@ -9074,6 +9080,9 @@ nv_edit(cmdarg_T *cap)
|
||||
/* Only give this error when 'insertmode' is off. */
|
||||
EMSG(_(e_modifiable));
|
||||
clearop(cap->oap);
|
||||
if (cap->cmdchar == K_PS)
|
||||
/* drop the pasted text */
|
||||
bracketed_paste(PASTE_INSERT, TRUE, NULL);
|
||||
}
|
||||
else if (!checkclearopq(cap->oap))
|
||||
{
|
||||
@@ -9104,6 +9113,12 @@ nv_edit(cmdarg_T *cap)
|
||||
beginline(BL_WHITE|BL_FIX);
|
||||
break;
|
||||
|
||||
case K_PS: /* Bracketed paste works like "a"ppend, unless the
|
||||
cursor is in the first column, then it inserts. */
|
||||
if (curwin->w_cursor.col == 0)
|
||||
break;
|
||||
/*FALLTHROUGH*/
|
||||
|
||||
case 'a': /* "a"ppend is like "i"nsert on the next character. */
|
||||
#ifdef FEAT_VIRTUALEDIT
|
||||
/* increment coladd when in virtual space, increment the
|
||||
@@ -9135,6 +9150,9 @@ nv_edit(cmdarg_T *cap)
|
||||
|
||||
invoke_edit(cap, FALSE, cap->cmdchar, FALSE);
|
||||
}
|
||||
else if (cap->cmdchar == K_PS)
|
||||
/* drop the pasted text */
|
||||
bracketed_paste(PASTE_INSERT, TRUE, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -2571,7 +2571,7 @@ op_insert(oparg_T *oap, long count1)
|
||||
}
|
||||
|
||||
t1 = oap->start;
|
||||
edit(NUL, FALSE, (linenr_T)count1);
|
||||
(void)edit(NUL, FALSE, (linenr_T)count1);
|
||||
|
||||
/* When a tab was inserted, and the characters in front of the tab
|
||||
* have been converted to a tab as well, the column of the cursor
|
||||
@@ -3550,7 +3550,7 @@ do_put(
|
||||
*/
|
||||
if (y_type == MBLOCK)
|
||||
{
|
||||
char c = gchar_cursor();
|
||||
int c = gchar_cursor();
|
||||
colnr_T endcol2 = 0;
|
||||
|
||||
if (dir == FORWARD && c != NUL)
|
||||
@@ -3774,11 +3774,25 @@ do_put(
|
||||
*/
|
||||
if (y_type == MCHAR && y_size == 1)
|
||||
{
|
||||
linenr_T end_lnum = 0; /* init for gcc */
|
||||
|
||||
if (VIsual_active)
|
||||
{
|
||||
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 {
|
||||
totlen = count * yanklen;
|
||||
if (totlen > 0)
|
||||
{
|
||||
oldp = ml_get(lnum);
|
||||
if (VIsual_active && col > (int)STRLEN(oldp))
|
||||
{
|
||||
lnum++;
|
||||
continue;
|
||||
}
|
||||
newp = alloc_check((unsigned)(STRLEN(oldp) + totlen + 1));
|
||||
if (newp == NULL)
|
||||
goto end; /* alloc() gave an error message */
|
||||
@@ -3801,7 +3815,7 @@ do_put(
|
||||
}
|
||||
if (VIsual_active)
|
||||
lnum++;
|
||||
} while (VIsual_active && lnum <= curbuf->b_visual.vi_end.lnum);
|
||||
} while (VIsual_active && lnum <= end_lnum);
|
||||
|
||||
if (VIsual_active) /* reset lnum to the last visual line */
|
||||
lnum--;
|
||||
|
||||
+49
-1
@@ -107,6 +107,7 @@
|
||||
#if defined(FEAT_BEVAL) && defined(FEAT_EVAL)
|
||||
# define PV_BEXPR OPT_BOTH(OPT_BUF(BV_BEXPR))
|
||||
#endif
|
||||
#define PV_FP OPT_BOTH(OPT_BUF(BV_FP))
|
||||
#ifdef FEAT_EVAL
|
||||
# define PV_FEX OPT_BUF(BV_FEX)
|
||||
#endif
|
||||
@@ -484,6 +485,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"
|
||||
#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.
|
||||
* The order of the options MUST be alphabetic for ":set all" and findoption().
|
||||
@@ -1270,7 +1282,7 @@ static struct vimoption options[] =
|
||||
{(char_u *)"^\\s*\\d\\+[\\]:.)}\\t ]\\s*",
|
||||
(char_u *)0L} SCRIPTID_INIT},
|
||||
{"formatprg", "fp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
|
||||
(char_u *)&p_fp, PV_NONE,
|
||||
(char_u *)&p_fp, PV_FP,
|
||||
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
|
||||
{"fsync", "fs", P_BOOL|P_SECURE|P_VI_DEF,
|
||||
#ifdef HAVE_FSYNC
|
||||
@@ -2203,6 +2215,14 @@ static struct vimoption options[] =
|
||||
{(char_u *)"", (char_u *)0L}
|
||||
SCRIPTID_INIT},
|
||||
#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,
|
||||
#ifdef FEAT_TEXTOBJ
|
||||
(char_u *)&p_qe, PV_QE,
|
||||
@@ -3107,6 +3127,8 @@ static struct vimoption options[] =
|
||||
p_term("t_ZR", T_CZR)
|
||||
p_term("t_8f", T_8F)
|
||||
p_term("t_8b", T_8B)
|
||||
p_term("t_BE", T_BE)
|
||||
p_term("t_BD", T_BD)
|
||||
|
||||
/* terminal key codes are not in here */
|
||||
|
||||
@@ -5574,6 +5596,7 @@ check_buf_options(buf_T *buf)
|
||||
#if defined(FEAT_CRYPT)
|
||||
check_string_option(&buf->b_p_cm);
|
||||
#endif
|
||||
check_string_option(&buf->b_p_fp);
|
||||
#if defined(FEAT_EVAL)
|
||||
check_string_option(&buf->b_p_fex);
|
||||
#endif
|
||||
@@ -6712,6 +6735,15 @@ did_set_string_option(
|
||||
mch_set_normal_colors();
|
||||
#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
|
||||
@@ -8969,6 +9001,15 @@ set_num_option(
|
||||
mzvim_reset_timer();
|
||||
#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 */
|
||||
else if (pp == &p_ul)
|
||||
{
|
||||
@@ -10358,6 +10399,9 @@ unset_global_local_option(char_u *name, void *from)
|
||||
clear_string_option(&buf->b_p_tsr);
|
||||
break;
|
||||
#endif
|
||||
case PV_FP:
|
||||
clear_string_option(&buf->b_p_fp);
|
||||
break;
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case PV_EFM:
|
||||
clear_string_option(&buf->b_p_efm);
|
||||
@@ -10411,6 +10455,7 @@ get_varp_scope(struct vimoption *p, int opt_flags)
|
||||
{
|
||||
switch ((int)p->indir)
|
||||
{
|
||||
case PV_FP: return (char_u *)&(curbuf->b_p_fp);
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case PV_EFM: return (char_u *)&(curbuf->b_p_efm);
|
||||
case PV_GP: return (char_u *)&(curbuf->b_p_gp);
|
||||
@@ -10491,6 +10536,8 @@ get_varp(struct vimoption *p)
|
||||
case PV_TSR: return *curbuf->b_p_tsr != NUL
|
||||
? (char_u *)&(curbuf->b_p_tsr) : p->var;
|
||||
#endif
|
||||
case PV_FP: return *curbuf->b_p_fp != NUL
|
||||
? (char_u *)&(curbuf->b_p_fp) : p->var;
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case PV_EFM: return *curbuf->b_p_efm != NUL
|
||||
? (char_u *)&(curbuf->b_p_efm) : p->var;
|
||||
@@ -11059,6 +11106,7 @@ buf_copy_options(buf_T *buf, int flags)
|
||||
buf->b_p_inde = vim_strsave(p_inde);
|
||||
buf->b_p_indk = vim_strsave(p_indk);
|
||||
#endif
|
||||
buf->b_p_fp = empty_option;
|
||||
#if defined(FEAT_EVAL)
|
||||
buf->b_p_fex = vim_strsave(p_fex);
|
||||
#endif
|
||||
|
||||
@@ -712,6 +712,9 @@ EXTERN char_u *p_py3home; /* 'pythonthreehome' */
|
||||
EXTERN char_u *p_pydll; /* 'pythondll' */
|
||||
EXTERN char_u *p_pyhome; /* 'pythonhome' */
|
||||
#endif
|
||||
#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
|
||||
EXTERN long p_pyx; /* 'pyxversion' */
|
||||
#endif
|
||||
#ifdef FEAT_RELTIME
|
||||
EXTERN long p_rdt; /* 'redrawtime' */
|
||||
#endif
|
||||
@@ -1051,6 +1054,7 @@ enum
|
||||
, BV_EP
|
||||
, BV_ET
|
||||
, BV_FENC
|
||||
, BV_FP
|
||||
#ifdef FEAT_EVAL
|
||||
, BV_BEXPR
|
||||
, BV_FEX
|
||||
|
||||
+14
-22
@@ -306,10 +306,8 @@ mch_settitle(
|
||||
* 2: Just restore icon (which we don't have)
|
||||
* 3: Restore title and icon (which we don't have)
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
mch_restore_title(
|
||||
int which)
|
||||
mch_restore_title(int which UNUSED)
|
||||
{
|
||||
#ifndef FEAT_GUI_MSWIN
|
||||
SetConsoleTitle(g_szOrigTitle);
|
||||
@@ -345,13 +343,12 @@ mch_can_restore_icon(void)
|
||||
* When 'shellslash' set do it the other way around.
|
||||
* Return OK or FAIL.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
mch_FullName(
|
||||
char_u *fname,
|
||||
char_u *buf,
|
||||
int len,
|
||||
int force)
|
||||
int force UNUSED)
|
||||
{
|
||||
int nResult = FAIL;
|
||||
|
||||
@@ -636,9 +633,8 @@ vim_stat(const char *name, stat_T *stp)
|
||||
}
|
||||
|
||||
#if defined(FEAT_GUI_MSWIN) || defined(PROTO)
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
mch_settmode(int tmode)
|
||||
mch_settmode(int tmode UNUSED)
|
||||
{
|
||||
/* nothing to do */
|
||||
}
|
||||
@@ -817,10 +813,8 @@ mch_char_avail(void)
|
||||
/*
|
||||
* set screen mode, always fails.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
mch_screenmode(
|
||||
char_u *arg)
|
||||
mch_screenmode(char_u *arg UNUSED)
|
||||
{
|
||||
EMSG(_(e_screenmode));
|
||||
return FAIL;
|
||||
@@ -996,10 +990,8 @@ mch_libcall(
|
||||
/*
|
||||
* Debugging helper: expose the MCH_WRITE_DUMP stuff to other modules
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
DumpPutS(
|
||||
const char *psz)
|
||||
DumpPutS(const char *psz UNUSED)
|
||||
{
|
||||
# ifdef MCH_WRITE_DUMP
|
||||
if (fdDump)
|
||||
@@ -1173,9 +1165,12 @@ swap_me(COLORREF colorref)
|
||||
# define PDP_RETVAL INT_PTR
|
||||
#endif
|
||||
|
||||
/*ARGSUSED*/
|
||||
static PDP_RETVAL CALLBACK
|
||||
PrintDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
PrintDlgProc(
|
||||
HWND hDlg,
|
||||
UINT message,
|
||||
WPARAM wParam UNUSED,
|
||||
LPARAM lParam UNUSED)
|
||||
{
|
||||
#ifdef FEAT_GETTEXT
|
||||
NONCLIENTMETRICS nm;
|
||||
@@ -1236,9 +1231,8 @@ PrintDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static BOOL CALLBACK
|
||||
AbortProc(HDC hdcPrn, int iCode)
|
||||
AbortProc(HDC hdcPrn UNUSED, int iCode UNUSED)
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
@@ -1683,9 +1677,8 @@ mch_print_begin(prt_settings_T *psettings)
|
||||
return (ret > 0);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
mch_print_end(prt_settings_T *psettings)
|
||||
mch_print_end(prt_settings_T *psettings UNUSED)
|
||||
{
|
||||
EndDoc(prt_dlg.hDC);
|
||||
if (!*bUserAbort)
|
||||
@@ -2764,12 +2757,11 @@ points_to_pixels(char_u *str, char_u **end, int vertical, long_i pprinter_dc)
|
||||
return pixels;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static int CALLBACK
|
||||
font_enumproc(
|
||||
ENUMLOGFONT *elf,
|
||||
NEWTEXTMETRIC *ntm,
|
||||
int type,
|
||||
NEWTEXTMETRIC *ntm UNUSED,
|
||||
int type UNUSED,
|
||||
LPARAM lparam)
|
||||
{
|
||||
/* Return value:
|
||||
|
||||
+2
-2
@@ -6940,7 +6940,7 @@ mch_libcall(
|
||||
if (argstring != NULL)
|
||||
{
|
||||
# if defined(USE_DLOPEN)
|
||||
ProcAdd = (STRPROCSTR)dlsym(hinstLib, (const char *)funcname);
|
||||
*(void **)(&ProcAdd) = dlsym(hinstLib, (const char *)funcname);
|
||||
dlerr = (char *)dlerror();
|
||||
# else
|
||||
if (shl_findsym(&hinstLib, (const char *)funcname,
|
||||
@@ -6962,7 +6962,7 @@ mch_libcall(
|
||||
else
|
||||
{
|
||||
# if defined(USE_DLOPEN)
|
||||
ProcAddI = (INTPROCSTR)dlsym(hinstLib, (const char *)funcname);
|
||||
*(void **)(&ProcAddI) = dlsym(hinstLib, (const char *)funcname);
|
||||
dlerr = (char *)dlerror();
|
||||
# else
|
||||
if (shl_findsym(&hinstLib, (const char *)funcname,
|
||||
|
||||
+4
-8
@@ -423,21 +423,17 @@ typedef struct dsc$descriptor DESC;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* memmove is not present on all systems, use memmove, bcopy, memcpy or our
|
||||
* own version */
|
||||
/* Some systems have (void *) arguments, some (char *). If we use (char *) it
|
||||
/* memmove() is not present on all systems, use memmove, bcopy or memcpy.
|
||||
* Some systems have (void *) arguments, some (char *). If we use (char *) it
|
||||
* works for all */
|
||||
#ifdef USEMEMMOVE
|
||||
#if defined(USEMEMMOVE) || (!defined(USEBCOPY) && !defined(USEMEMCPY))
|
||||
# define mch_memmove(to, from, len) memmove((char *)(to), (char *)(from), len)
|
||||
#else
|
||||
# ifdef USEBCOPY
|
||||
# define mch_memmove(to, from, len) bcopy((char *)(from), (char *)(to), len)
|
||||
# else
|
||||
# ifdef USEMEMCPY
|
||||
/* ifdef USEMEMCPY */
|
||||
# define mch_memmove(to, from, len) memcpy((char *)(to), (char *)(from), len)
|
||||
# else
|
||||
# define VIM_MEMMOVE /* found in misc2.c */
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@
|
||||
|
||||
/* shared library access */
|
||||
#if defined(HAVE_DLFCN_H) && defined(USE_DLOPEN)
|
||||
# ifdef __MVS__
|
||||
# if defined(__MVS__) && !defined (__SUSV3)
|
||||
/* needed to define RTLD_LAZY (Anthony Giorgio) */
|
||||
# define __SUSV3
|
||||
# endif
|
||||
|
||||
+3
-4
@@ -38,13 +38,12 @@ void _cdecl SaveInst(HINSTANCE hInst);
|
||||
static void (_cdecl *pSaveInst)(HINSTANCE);
|
||||
#endif
|
||||
|
||||
/*ARGSUSED*/
|
||||
int WINAPI
|
||||
WinMain(
|
||||
HINSTANCE hInstance,
|
||||
HINSTANCE hPrevInst,
|
||||
HINSTANCE hInstance UNUSED,
|
||||
HINSTANCE hPrevInst UNUSED,
|
||||
LPSTR lpszCmdLine,
|
||||
int nCmdShow)
|
||||
int nCmdShow UNUSED)
|
||||
{
|
||||
int argc = 0;
|
||||
char **argv;
|
||||
|
||||
+184
-43
@@ -425,6 +425,84 @@ vimLoadLib(char *name)
|
||||
return dll;
|
||||
}
|
||||
|
||||
#if defined(DYNAMIC_ICONV) || defined(DYNAMIC_GETTEXT) || defined(PROTO)
|
||||
/*
|
||||
* Get related information about 'funcname' which is imported by 'hInst'.
|
||||
* If 'info' is 0, return the function address.
|
||||
* If 'info' is 1, return the module name which the function is imported from.
|
||||
*/
|
||||
static void *
|
||||
get_imported_func_info(HINSTANCE hInst, const char *funcname, int info)
|
||||
{
|
||||
PBYTE pImage = (PBYTE)hInst;
|
||||
PIMAGE_DOS_HEADER pDOS = (PIMAGE_DOS_HEADER)hInst;
|
||||
PIMAGE_NT_HEADERS pPE;
|
||||
PIMAGE_IMPORT_DESCRIPTOR pImpDesc;
|
||||
PIMAGE_THUNK_DATA pIAT; /* Import Address Table */
|
||||
PIMAGE_THUNK_DATA pINT; /* Import Name Table */
|
||||
PIMAGE_IMPORT_BY_NAME pImpName;
|
||||
|
||||
if (pDOS->e_magic != IMAGE_DOS_SIGNATURE)
|
||||
return NULL;
|
||||
pPE = (PIMAGE_NT_HEADERS)(pImage + pDOS->e_lfanew);
|
||||
if (pPE->Signature != IMAGE_NT_SIGNATURE)
|
||||
return NULL;
|
||||
pImpDesc = (PIMAGE_IMPORT_DESCRIPTOR)(pImage
|
||||
+ pPE->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT]
|
||||
.VirtualAddress);
|
||||
for (; pImpDesc->FirstThunk; ++pImpDesc)
|
||||
{
|
||||
if (!pImpDesc->OriginalFirstThunk)
|
||||
continue;
|
||||
pIAT = (PIMAGE_THUNK_DATA)(pImage + pImpDesc->FirstThunk);
|
||||
pINT = (PIMAGE_THUNK_DATA)(pImage + pImpDesc->OriginalFirstThunk);
|
||||
for (; pIAT->u1.Function; ++pIAT, ++pINT)
|
||||
{
|
||||
if (IMAGE_SNAP_BY_ORDINAL(pINT->u1.Ordinal))
|
||||
continue;
|
||||
pImpName = (PIMAGE_IMPORT_BY_NAME)(pImage
|
||||
+ (UINT_PTR)(pINT->u1.AddressOfData));
|
||||
if (strcmp((char *)pImpName->Name, funcname) == 0)
|
||||
{
|
||||
switch (info)
|
||||
{
|
||||
case 0:
|
||||
return (void *)pIAT->u1.Function;
|
||||
case 1:
|
||||
return (void *)(pImage + pImpDesc->Name);
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the module handle which 'funcname' in 'hInst' is imported from.
|
||||
*/
|
||||
HINSTANCE
|
||||
find_imported_module_by_funcname(HINSTANCE hInst, const char *funcname)
|
||||
{
|
||||
char *modulename;
|
||||
|
||||
modulename = (char *)get_imported_func_info(hInst, funcname, 1);
|
||||
if (modulename != NULL)
|
||||
return GetModuleHandleA(modulename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the address of 'funcname' which is imported by 'hInst' DLL.
|
||||
*/
|
||||
void *
|
||||
get_dll_import_func(HINSTANCE hInst, const char *funcname)
|
||||
{
|
||||
return get_imported_func_info(hInst, funcname, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(DYNAMIC_GETTEXT) || defined(PROTO)
|
||||
# ifndef GETTEXT_DLL
|
||||
# define GETTEXT_DLL "libintl.dll"
|
||||
@@ -436,6 +514,8 @@ static char *null_libintl_ngettext(const char *, const char *, unsigned long n);
|
||||
static char *null_libintl_textdomain(const char *);
|
||||
static char *null_libintl_bindtextdomain(const char *, const char *);
|
||||
static char *null_libintl_bind_textdomain_codeset(const char *, const char *);
|
||||
static int null_libintl_putenv(const char *);
|
||||
static int null_libintl_wputenv(const wchar_t *);
|
||||
|
||||
static HINSTANCE hLibintlDLL = NULL;
|
||||
char *(*dyn_libintl_gettext)(const char *) = null_libintl_gettext;
|
||||
@@ -446,6 +526,8 @@ char *(*dyn_libintl_bindtextdomain)(const char *, const char *)
|
||||
= null_libintl_bindtextdomain;
|
||||
char *(*dyn_libintl_bind_textdomain_codeset)(const char *, const char *)
|
||||
= null_libintl_bind_textdomain_codeset;
|
||||
int (*dyn_libintl_putenv)(const char *) = null_libintl_putenv;
|
||||
int (*dyn_libintl_wputenv)(const wchar_t *) = null_libintl_wputenv;
|
||||
|
||||
int
|
||||
dyn_libintl_init(void)
|
||||
@@ -463,6 +545,7 @@ dyn_libintl_init(void)
|
||||
{"bindtextdomain", (FARPROC*)&dyn_libintl_bindtextdomain},
|
||||
{NULL, NULL}
|
||||
};
|
||||
HINSTANCE hmsvcrt;
|
||||
|
||||
/* No need to initialize twice. */
|
||||
if (hLibintlDLL)
|
||||
@@ -507,6 +590,18 @@ dyn_libintl_init(void)
|
||||
dyn_libintl_bind_textdomain_codeset =
|
||||
null_libintl_bind_textdomain_codeset;
|
||||
|
||||
/* _putenv() function for the libintl.dll is optional. */
|
||||
hmsvcrt = find_imported_module_by_funcname(hLibintlDLL, "getenv");
|
||||
if (hmsvcrt != NULL)
|
||||
{
|
||||
dyn_libintl_putenv = (void *)GetProcAddress(hmsvcrt, "_putenv");
|
||||
dyn_libintl_wputenv = (void *)GetProcAddress(hmsvcrt, "_wputenv");
|
||||
}
|
||||
if (dyn_libintl_putenv == NULL || dyn_libintl_putenv == _putenv)
|
||||
dyn_libintl_putenv = null_libintl_putenv;
|
||||
if (dyn_libintl_wputenv == NULL || dyn_libintl_wputenv == _wputenv)
|
||||
dyn_libintl_wputenv = null_libintl_wputenv;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -521,16 +616,16 @@ dyn_libintl_end(void)
|
||||
dyn_libintl_textdomain = null_libintl_textdomain;
|
||||
dyn_libintl_bindtextdomain = null_libintl_bindtextdomain;
|
||||
dyn_libintl_bind_textdomain_codeset = null_libintl_bind_textdomain_codeset;
|
||||
dyn_libintl_putenv = null_libintl_putenv;
|
||||
dyn_libintl_wputenv = null_libintl_wputenv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static char *
|
||||
null_libintl_gettext(const char *msgid)
|
||||
{
|
||||
return (char*)msgid;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static char *
|
||||
null_libintl_ngettext(
|
||||
const char *msgid,
|
||||
@@ -540,28 +635,40 @@ null_libintl_ngettext(
|
||||
return (char *)(n == 1 ? msgid : msgid_plural);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static char *
|
||||
null_libintl_bindtextdomain(const char *domainname, const char *dirname)
|
||||
null_libintl_bindtextdomain(
|
||||
const char *domainname UNUSED,
|
||||
const char *dirname UNUSED)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static char *
|
||||
null_libintl_bind_textdomain_codeset(const char *domainname,
|
||||
const char *codeset)
|
||||
null_libintl_bind_textdomain_codeset(
|
||||
const char *domainname UNUSED,
|
||||
const char *codeset UNUSED)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static char *
|
||||
null_libintl_textdomain(const char *domainname)
|
||||
null_libintl_textdomain(const char *domainname UNUSED)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
null_libintl_putenv(const char *envstring UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
null_libintl_wputenv(const wchar_t *envstring UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* DYNAMIC_GETTEXT */
|
||||
|
||||
/* This symbol is not defined in older versions of the SDK or Visual C++ */
|
||||
@@ -949,9 +1056,8 @@ decode_key_event(
|
||||
* For the GUI the mouse handling is in gui_w32.c.
|
||||
*/
|
||||
# ifdef FEAT_GUI_W32
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
mch_setmouse(int on)
|
||||
mch_setmouse(int on UNUSED)
|
||||
{
|
||||
}
|
||||
# else
|
||||
@@ -1547,13 +1653,12 @@ tgetch(int *pmodifiers, WCHAR *pch2)
|
||||
* If time == -1, wait forever for characters.
|
||||
* Returns the number of characters read into buf.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
mch_inchar(
|
||||
char_u *buf,
|
||||
int maxlen,
|
||||
long time,
|
||||
int tb_change_cnt)
|
||||
char_u *buf UNUSED,
|
||||
int maxlen UNUSED,
|
||||
long time UNUSED,
|
||||
int tb_change_cnt UNUSED)
|
||||
{
|
||||
#ifndef FEAT_GUI_W32 /* this isn't used for the GUI */
|
||||
|
||||
@@ -2481,11 +2586,10 @@ mch_exit(int r)
|
||||
/*
|
||||
* Do we have an interactive window?
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
mch_check_win(
|
||||
int argc,
|
||||
char **argv)
|
||||
int argc UNUSED,
|
||||
char **argv UNUSED)
|
||||
{
|
||||
get_exe_name();
|
||||
|
||||
@@ -4781,32 +4885,32 @@ mch_call_shell(
|
||||
#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
|
||||
static HANDLE
|
||||
job_io_file_open(
|
||||
char_u *fname,
|
||||
DWORD dwDesiredAccess,
|
||||
DWORD dwShareMode,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
|
||||
DWORD dwCreationDisposition,
|
||||
DWORD dwFlagsAndAttributes)
|
||||
char_u *fname,
|
||||
DWORD dwDesiredAccess,
|
||||
DWORD dwShareMode,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
|
||||
DWORD dwCreationDisposition,
|
||||
DWORD dwFlagsAndAttributes)
|
||||
{
|
||||
HANDLE h;
|
||||
# ifdef FEAT_MBYTE
|
||||
WCHAR *wn = NULL;
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
{
|
||||
wn = enc_to_utf16(fname, NULL);
|
||||
if (wn != NULL)
|
||||
{
|
||||
h = CreateFileW(wn, dwDesiredAccess, dwShareMode,
|
||||
lpSecurityAttributes, dwCreationDisposition,
|
||||
dwFlagsAndAttributes, NULL);
|
||||
vim_free(wn);
|
||||
}
|
||||
wn = enc_to_utf16(fname, NULL);
|
||||
if (wn != NULL)
|
||||
{
|
||||
h = CreateFileW(wn, dwDesiredAccess, dwShareMode,
|
||||
lpSecurityAttributes, dwCreationDisposition,
|
||||
dwFlagsAndAttributes, NULL);
|
||||
vim_free(wn);
|
||||
}
|
||||
}
|
||||
if (wn == NULL)
|
||||
# endif
|
||||
h = CreateFile((LPCSTR)fname, dwDesiredAccess, dwShareMode,
|
||||
lpSecurityAttributes, dwCreationDisposition,
|
||||
dwFlagsAndAttributes, NULL);
|
||||
h = CreateFile((LPCSTR)fname, dwDesiredAccess, dwShareMode,
|
||||
lpSecurityAttributes, dwCreationDisposition,
|
||||
dwFlagsAndAttributes, NULL);
|
||||
return h;
|
||||
}
|
||||
|
||||
@@ -5237,11 +5341,10 @@ termcap_mode_end(void)
|
||||
|
||||
|
||||
#ifdef FEAT_GUI_W32
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
mch_write(
|
||||
char_u *s,
|
||||
int len)
|
||||
char_u *s UNUSED,
|
||||
int len UNUSED)
|
||||
{
|
||||
/* never used */
|
||||
}
|
||||
@@ -5939,11 +6042,10 @@ mch_write(
|
||||
/*
|
||||
* Delay for "msec" milliseconds.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
mch_delay(
|
||||
long msec,
|
||||
int ignoreinput)
|
||||
int ignoreinput UNUSED)
|
||||
{
|
||||
#ifdef FEAT_GUI_W32
|
||||
Sleep((int)msec); /* never wait for input */
|
||||
@@ -6032,9 +6134,8 @@ mch_breakcheck(int force)
|
||||
/*
|
||||
* How much main memory in KiB that can be used by VIM.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
long_u
|
||||
mch_total_mem(int special)
|
||||
mch_total_mem(int special UNUSED)
|
||||
{
|
||||
MEMORYSTATUSEX ms;
|
||||
|
||||
@@ -6889,3 +6990,43 @@ fix_arg_enc(void)
|
||||
set_alist_count();
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
mch_setenv(char *var, char *value, int x)
|
||||
{
|
||||
char_u *envbuf;
|
||||
|
||||
envbuf = alloc((unsigned)(STRLEN(var) + STRLEN(value) + 2));
|
||||
if (envbuf == NULL)
|
||||
return -1;
|
||||
|
||||
sprintf((char *)envbuf, "%s=%s", var, value);
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
{
|
||||
WCHAR *p = enc_to_utf16(envbuf, NULL);
|
||||
|
||||
vim_free(envbuf);
|
||||
if (p == NULL)
|
||||
return -1;
|
||||
_wputenv(p);
|
||||
# ifdef libintl_wputenv
|
||||
libintl_wputenv(p);
|
||||
# endif
|
||||
/* Unlike Un*x systems, we can free the string for _wputenv(). */
|
||||
vim_free(p);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
_putenv((char *)envbuf);
|
||||
# ifdef libintl_putenv
|
||||
libintl_putenv((char *)envbuf);
|
||||
# endif
|
||||
/* Unlike Un*x systems, we can free the string for _putenv(). */
|
||||
vim_free(envbuf);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+3
-1
@@ -202,7 +202,9 @@ Trace(char *pszFormat, ...);
|
||||
#define ASSERT_NULL_OR_POINTER(p, type) \
|
||||
ASSERT(((p) == NULL) || IsValidAddress((p), sizeof(type), FALSE))
|
||||
|
||||
#define mch_setenv(name, val, x) setenv(name, val, x)
|
||||
#ifndef HAVE_SETENV
|
||||
# define HAVE_SETENV
|
||||
#endif
|
||||
#define mch_getenv(x) (char_u *)getenv((char *)(x))
|
||||
#ifdef __BORLANDC__
|
||||
# define vim_mkdir(x, y) mkdir(x)
|
||||
|
||||
+6
-5
@@ -232,12 +232,13 @@ sk.cp1250.po: 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
|
||||
|
||||
# Convert zh_CN.po to create zh_CN.cp936.po.
|
||||
# set 'charset' to gbk to avoid that msfmt generates a warning
|
||||
zh_CN.cp936.po: zh_CN.po
|
||||
# Convert zh_CN.UTF-8.po to create zh_CN.cp936.po.
|
||||
# Set 'charset' to gbk to avoid that msfmt generates a warning.
|
||||
# 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
|
||||
iconv -f gb2312 -t cp936 zh_CN.po | \
|
||||
sed -e 's/charset=gb2312/charset=gbk/' -e 's/# Original translations/# Generated from zh_CN.po, DO NOT EDIT/' > zh_CN.cp936.po
|
||||
iconv -f UTF-8 -t cp936 zh_CN.UTF-8.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.
|
||||
ko.po: ko.UTF-8.po
|
||||
|
||||
+25
-29
@@ -5,7 +5,7 @@
|
||||
#
|
||||
# UNUA TRADUKISTO Dominique PELLE <dominique.pelle ĉe gmail.com>
|
||||
# PROVLEGANTO(J) Felipe CASTRO <fefcas ĉe gmail.com>
|
||||
# Antono MECHELYNCK <antoine.mechelynck ĉe skynet.be>
|
||||
# Antono MECHELYNCK <antoine.mechelynck ĉe gmail.com>
|
||||
# Yves NEVELSTEEN
|
||||
#
|
||||
# Uzitaj vortaroj kaj fakvortaroj:
|
||||
@@ -23,8 +23,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Vim(Esperanto)\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-08-26 20:54+0200\n"
|
||||
"PO-Revision-Date: 2016-08-26 20:30+0200\n"
|
||||
"POT-Creation-Date: 2017-01-16 00:30+0100\n"
|
||||
"PO-Revision-Date: 2017-01-16 01:14+0100\n"
|
||||
"Last-Translator: Dominique PELLÉ <dominique.pelle@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: eo\n"
|
||||
@@ -66,6 +66,9 @@ msgstr "E83: Ne eblas disponigi bufron, nun uzas alian..."
|
||||
msgid "E931: Buffer cannot be registered"
|
||||
msgstr "E931: Bufro ne povas esti registrita"
|
||||
|
||||
msgid "E937: Attempt to delete a buffer that is in use"
|
||||
msgstr "E937: Provo de forviŝo de bufro, kiu estas uzanta"
|
||||
|
||||
msgid "E515: No buffers were unloaded"
|
||||
msgstr "E515: Neniu bufro estis malŝargita"
|
||||
|
||||
@@ -269,7 +272,7 @@ msgid "E918: buffer must be loaded: %s"
|
||||
msgstr "E918: bufro devas esti ŝargita: %s"
|
||||
|
||||
msgid "E821: File is encrypted with unknown method"
|
||||
msgstr "E821: Dosiero estas ĉifrata per nekonata metodo"
|
||||
msgstr "E821: Dosiero estas ĉifrita per nekonata metodo"
|
||||
|
||||
msgid "Warning: Using a weak encryption method; see :help 'cm'"
|
||||
msgstr "Averto: uzo de malfortika ĉifrada metodo; vidu :help 'cm'"
|
||||
@@ -1963,6 +1966,9 @@ msgstr "E462: Ne eblis prepari por reŝargi \"%s\""
|
||||
msgid "E321: Could not reload \"%s\""
|
||||
msgstr "E321: Ne eblis reŝargi \"%s\""
|
||||
|
||||
msgid "--Deleted--"
|
||||
msgstr "--Forviŝita--"
|
||||
|
||||
#, c-format
|
||||
msgid "auto-removing autocommand: %s <buffer=%d>"
|
||||
msgstr "aŭto-forviŝas aŭtokomandon: %s <bufro=%d>"
|
||||
@@ -1972,12 +1978,12 @@ msgstr "aŭto-forviŝas aŭtokomandon: %s <bufro=%d>"
|
||||
msgid "E367: No such group: \"%s\""
|
||||
msgstr "E367: Ne ekzistas tia grupo: \"%s\""
|
||||
|
||||
msgid "E936: Cannot delete the current group"
|
||||
msgstr "E936: Ne eblas forviŝi la aktualan grupon"
|
||||
|
||||
msgid "W19: Deleting augroup that is still in use"
|
||||
msgstr "W19: Forviŝo de augroup kiu estas ankoraŭ uzata"
|
||||
|
||||
msgid "--Deleted--"
|
||||
msgstr "--Forviŝita--"
|
||||
|
||||
#, c-format
|
||||
msgid "E215: Illegal character after *: %s"
|
||||
msgstr "E215: Nevalida signo post *: %s"
|
||||
@@ -2834,6 +2840,10 @@ msgid "E251: VIM instance registry property is badly formed. Deleted!"
|
||||
msgstr ""
|
||||
"E251: Ecoj de registro de apero de VIM estas nevalide formata. Forviŝita!"
|
||||
|
||||
#, c-format
|
||||
msgid "E938: Duplicate key in JSON: \"%s\""
|
||||
msgstr "E938: Ripetita ŝlosilo en JSON: \"%s\""
|
||||
|
||||
#, c-format
|
||||
msgid "E696: Missing comma in List: %s"
|
||||
msgstr "E696: Mankas komo en Listo: %s"
|
||||
@@ -3058,6 +3068,10 @@ msgid "--not-a-term\t\tSkip warning for input/output not being a terminal"
|
||||
msgstr ""
|
||||
"--not-a-term\t\tPreterpasi averton por enigo/eligo, kiu ne estas terminalo"
|
||||
|
||||
msgid "--ttyfail\t\tExit if input or output is not a terminal"
|
||||
msgstr ""
|
||||
"--ttyfail\t\tEliri se le eniro aŭ eliro ne estas terminalo"
|
||||
|
||||
msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
|
||||
msgstr "-u <vimrc>\t\tUzi <vimrc> anstataŭ iun ajn .vimrc"
|
||||
|
||||
@@ -4454,9 +4468,6 @@ msgstr "ERARO DE ENIGO/ELIGO"
|
||||
msgid "Message"
|
||||
msgstr "Mesaĝo"
|
||||
|
||||
msgid "'columns' is not 80, cannot execute external commands"
|
||||
msgstr "'columns' ne estas 80, ne eblas plenumi eksterajn komandojn"
|
||||
|
||||
msgid "E237: Printer selection failed"
|
||||
msgstr "E237: Elekto de presilo malsukcesis"
|
||||
|
||||
@@ -5998,14 +6009,6 @@ msgstr "E133: \":return\" ekster funkcio"
|
||||
msgid "E107: Missing parentheses: %s"
|
||||
msgstr "E107: Mankas krampoj: %s"
|
||||
|
||||
#. Only MS VC 4.1 and earlier can do Win32s
|
||||
msgid ""
|
||||
"\n"
|
||||
"MS-Windows 16/32-bit GUI version"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Grafika versio MS-Vindozo 16/32-bitoj"
|
||||
|
||||
msgid ""
|
||||
"\n"
|
||||
"MS-Windows 64-bit GUI version"
|
||||
@@ -6305,13 +6308,6 @@ msgstr "tajpu :help register<Enenklavo> por pliaj informoj "
|
||||
msgid "menu Help->Sponsor/Register for information "
|
||||
msgstr "menuo Helpo->Subteni/Registri por pliaj informoj "
|
||||
|
||||
msgid "WARNING: Windows 95/98/ME detected"
|
||||
msgstr "AVERTO: Trovis Vindozon 95/98/ME"
|
||||
|
||||
# DP: atentu al la spacetoj: ĉiuj ĉenoj devas havi la saman longon
|
||||
msgid "type :help windows95<Enter> for info on this"
|
||||
msgstr "tajpu :help windows95<Enenklavo> por pliaj informoj "
|
||||
|
||||
msgid "Already only one window"
|
||||
msgstr "Jam nur unu fenestro"
|
||||
|
||||
@@ -6465,6 +6461,10 @@ msgstr "E236: La tiparo \"%s\" ne estas egallarĝa"
|
||||
msgid "E473: Internal error"
|
||||
msgstr "E473: Interna eraro"
|
||||
|
||||
#, c-format
|
||||
msgid "E685: Internal error: %s"
|
||||
msgstr "E685: Interna eraro: %s"
|
||||
|
||||
msgid "Interrupted"
|
||||
msgstr "Interrompita"
|
||||
|
||||
@@ -6745,10 +6745,6 @@ msgstr "E463: Regiono estas gardita, ne eblas ŝanĝi"
|
||||
msgid "E744: NetBeans does not allow changes in read-only files"
|
||||
msgstr "E744: NetBeans ne permesas ŝanĝojn en nurlegeblaj dosieroj"
|
||||
|
||||
#, c-format
|
||||
msgid "E685: Internal error: %s"
|
||||
msgstr "E685: Interna eraro: %s"
|
||||
|
||||
msgid "E363: pattern uses more memory than 'maxmempattern'"
|
||||
msgstr "E363: ŝablono uzas pli da memoro ol 'maxmempattern'"
|
||||
|
||||
|
||||
+27
-30
@@ -6,7 +6,7 @@
|
||||
# FIRST AUTHOR DindinX <David.Odin@bigfoot.com> 2000.
|
||||
# SECOND AUTHOR Adrien Beau <version.francaise@free.fr> 2002, 2003.
|
||||
# THIRD AUTHOR David Blanchet <david.blanchet@free.fr> 2006, 2008.
|
||||
# FOURTH AUTHOR Dominique Pellé <dominique.pelle@gmail.com> 2008, 2016.
|
||||
# FOURTH AUTHOR Dominique Pellé <dominique.pelle@gmail.com> 2008, 2017.
|
||||
#
|
||||
# Latest translation available at:
|
||||
# http://dominique.pelle.free.fr/vim-fr.php
|
||||
@@ -15,8 +15,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Vim(Français)\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-08-26 20:54+0200\n"
|
||||
"PO-Revision-Date: 2016-08-26 20:34+0200\n"
|
||||
"POT-Creation-Date: 2017-01-16 00:30+0100\n"
|
||||
"PO-Revision-Date: 2017-01-16 00:51+0100\n"
|
||||
"Last-Translator: Dominique Pellé <dominique.pelle@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: fr\n"
|
||||
@@ -63,6 +63,9 @@ msgstr ""
|
||||
msgid "E931: Buffer cannot be registered"
|
||||
msgstr "E931: Le tampon ne peut pas être enregistré"
|
||||
|
||||
msgid "E937: Attempt to delete a buffer that is in use"
|
||||
msgstr "E937: Tentative de suppression d'un tampon en cours d'utilisation"
|
||||
|
||||
msgid "E515: No buffers were unloaded"
|
||||
msgstr "E515: Aucun tampon n'a été déchargé"
|
||||
|
||||
@@ -242,7 +245,7 @@ msgid "E898: socket() in channel_open()"
|
||||
msgstr "E898: socket() dans channel_open()"
|
||||
|
||||
msgid "E903: received command with non-string argument"
|
||||
msgstr "E903: commande reçue avec une argument qui n'est pas une chaîne"
|
||||
msgstr "E903: commande reçue avec un argument qui n'est pas une chaîne"
|
||||
|
||||
msgid "E904: last argument for expr/call must be a number"
|
||||
msgstr "E904: le dernier argument de expr/call doit être un nombre"
|
||||
@@ -2150,6 +2153,9 @@ msgstr "E462: Impossible de pr
|
||||
msgid "E321: Could not reload \"%s\""
|
||||
msgstr "E321: Impossible de recharger \"%s\""
|
||||
|
||||
msgid "--Deleted--"
|
||||
msgstr "--Effacé--"
|
||||
|
||||
#, c-format
|
||||
msgid "auto-removing autocommand: %s <buffer=%d>"
|
||||
msgstr "Autocommandes marquées pour auto-suppression : %s <tampon=%d>"
|
||||
@@ -2159,12 +2165,12 @@ msgstr "Autocommandes marqu
|
||||
msgid "E367: No such group: \"%s\""
|
||||
msgstr "E367: Aucun groupe \"%s\""
|
||||
|
||||
msgid "E936: Cannot delete the current group"
|
||||
msgstr "E936: Impossible de supprimer le groupe courant"
|
||||
|
||||
msgid "W19: Deleting augroup that is still in use"
|
||||
msgstr "W19: Effacement d'augroup toujours en usage"
|
||||
|
||||
msgid "--Deleted--"
|
||||
msgstr "--Effacé--"
|
||||
|
||||
#, c-format
|
||||
msgid "E215: Illegal character after *: %s"
|
||||
msgstr "E215: Caractère non valide après * : %s"
|
||||
@@ -2854,7 +2860,7 @@ msgid "invalid expression"
|
||||
msgstr "expression invalide"
|
||||
|
||||
msgid "expressions disabled at compile time"
|
||||
msgstr "expressions désactivée lors de la compilation"
|
||||
msgstr "expressions désactivées lors de la compilation"
|
||||
|
||||
msgid "hidden option"
|
||||
msgstr "option cachée"
|
||||
@@ -3041,6 +3047,10 @@ msgstr "E573: Id utilis
|
||||
msgid "E251: VIM instance registry property is badly formed. Deleted!"
|
||||
msgstr "E251: Entrée registre de l'instance de Vim mal formatée. Suppression !"
|
||||
|
||||
#, c-format
|
||||
msgid "E938: Duplicate key in JSON: \"%s\""
|
||||
msgstr "E938: Clé dupliquée dans le document JSON : \"%s\""
|
||||
|
||||
#, c-format
|
||||
msgid "E696: Missing comma in List: %s"
|
||||
msgstr "E696: Il manque une virgule dans la Liste %s"
|
||||
@@ -3269,6 +3279,10 @@ msgid "--not-a-term\t\tSkip warning for input/output not being a terminal"
|
||||
msgstr ""
|
||||
"--no-a-term\t\tAucun avertissement si l'entrée/sortie n'est pas un terminal"
|
||||
|
||||
msgid "--ttyfail\t\tExit if input or output is not a terminal"
|
||||
msgstr ""
|
||||
"--ttyfail\t\tQuitte si l'entrée ou la sortie ne sont pas un terminal"
|
||||
|
||||
msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
|
||||
msgstr "-u <vimrc>\tUtiliser <vimrc> au lieu du vimrc habituel"
|
||||
|
||||
@@ -4682,9 +4696,6 @@ msgstr "ERREUR d'E/S"
|
||||
msgid "Message"
|
||||
msgstr "Message"
|
||||
|
||||
msgid "'columns' is not 80, cannot execute external commands"
|
||||
msgstr "'columns' ne vaut pas 80, impossible d'exécuter des commandes externes"
|
||||
|
||||
msgid "E237: Printer selection failed"
|
||||
msgstr "E237: La sélection de l'imprimante a échoué"
|
||||
|
||||
@@ -5625,7 +5636,7 @@ msgstr ""
|
||||
#. This should have been checked when generating the .spl
|
||||
#. * file.
|
||||
msgid "E783: duplicate char in MAP entry"
|
||||
msgstr "E783: caractères dupliqué dans l'entrée MAP"
|
||||
msgstr "E783: caractère dupliqué dans l'entrée MAP"
|
||||
|
||||
msgid "No Syntax items defined for this buffer"
|
||||
msgstr "Aucun élément de syntaxe défini pour ce tampon"
|
||||
@@ -6264,14 +6275,6 @@ msgstr "E133: :return en dehors d'une fonction"
|
||||
msgid "E107: Missing parentheses: %s"
|
||||
msgstr "E107: Parenthèses manquantes : %s"
|
||||
|
||||
#. Only MS VC 4.1 and earlier can do Win32s
|
||||
msgid ""
|
||||
"\n"
|
||||
"MS-Windows 16/32-bit GUI version"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Version graphique MS-Windows 16/32 bits"
|
||||
|
||||
msgid ""
|
||||
"\n"
|
||||
"MS-Windows 64-bit GUI version"
|
||||
@@ -6561,12 +6564,6 @@ msgstr "tapez :help register<Entr
|
||||
msgid "menu Help->Sponsor/Register for information "
|
||||
msgstr "menu Aide->Sponsor/Enregistrement pour plus d'info"
|
||||
|
||||
msgid "WARNING: Windows 95/98/ME detected"
|
||||
msgstr "ALERTE: Windows 95/98/ME détecté"
|
||||
|
||||
msgid "type :help windows95<Enter> for info on this"
|
||||
msgstr "tapez :help windows95<Entrée> pour plus d'information"
|
||||
|
||||
msgid "Already only one window"
|
||||
msgstr "Il n'y a déjà plus qu'une fenêtre"
|
||||
|
||||
@@ -6727,6 +6724,10 @@ msgstr "E236: La police \"%s\" n'a pas une chasse (largeur) fixe"
|
||||
msgid "E473: Internal error"
|
||||
msgstr "E473: Erreur interne"
|
||||
|
||||
#, c-format
|
||||
msgid "E685: Internal error: %s"
|
||||
msgstr "E685: Erreur interne : %s"
|
||||
|
||||
msgid "Interrupted"
|
||||
msgstr "Interrompu"
|
||||
|
||||
@@ -7011,10 +7012,6 @@ msgid "E744: NetBeans does not allow changes in read-only files"
|
||||
msgstr ""
|
||||
"E744: NetBeans n'autorise pas la modification des fichiers en lecture seule"
|
||||
|
||||
#, c-format
|
||||
msgid "E685: Internal error: %s"
|
||||
msgstr "E685: Erreur interne : %s"
|
||||
|
||||
msgid "E363: pattern uses more memory than 'maxmempattern'"
|
||||
msgstr "E363: le motif utilise plus de mémoire que 'maxmempattern'"
|
||||
|
||||
|
||||
@@ -2894,7 +2894,8 @@ msgstr "-X\t\t\t不连接到 X Server"
|
||||
msgid "--remote <files>\tEdit <files> in a Vim server if possible"
|
||||
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> 同上,找不到服务器时不抱怨"
|
||||
|
||||
msgid ""
|
||||
|
||||
@@ -241,9 +241,8 @@ msgstr "
|
||||
msgid " Tag completion (^]^N^P)"
|
||||
msgstr " Tag 补全 (^]^N^P)"
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid " Path pattern completion (^N^P)"
|
||||
#~ msgstr " 路径模式补全 (^N^P)"
|
||||
msgid " Path pattern completion (^N^P)"
|
||||
msgstr " 头文件模式补全 (^N^P)"
|
||||
|
||||
msgid " Definition completion (^D^N^P)"
|
||||
msgstr " 定义补全 (^D^N^P)"
|
||||
@@ -2896,7 +2895,7 @@ msgid "--remote <files>\tEdit <files> in a Vim server if possible"
|
||||
msgstr "--remote <files>\t如有可能,在 Vim 服务器上编辑文件 <files>"
|
||||
|
||||
msgid "--remote-silent <files> Same, don't complain if there is no server"
|
||||
msgstr "--remote-silent <files> 同上,找不到服务器时槐г�"
|
||||
msgstr "--remote-silent <files> 同上,找不到服务器时不抱怨"
|
||||
|
||||
msgid ""
|
||||
"--remote-wait <files> As --remote but wait for files to have been edited"
|
||||
@@ -5284,7 +5283,7 @@ msgstr "Vim:
|
||||
|
||||
#. must display the prompt
|
||||
msgid "No undo possible; continue anyway"
|
||||
msgstr "无法撤销;请继续"
|
||||
msgstr "无法撤销;仍然继续"
|
||||
|
||||
msgid "Already at oldest change"
|
||||
msgstr "已位于最旧的改变"
|
||||
@@ -5601,13 +5600,13 @@ msgid "type :help cp-default<Enter> for info on this"
|
||||
msgstr "输入 :help cp-default<Enter> 查看相关说明 "
|
||||
|
||||
msgid "menu Help->Orphans for information "
|
||||
msgstr "菜单 Help->Orphans 查看说明 "
|
||||
msgstr "菜单 帮助->孤儿 查看说明 "
|
||||
|
||||
msgid "Running modeless, typed text is inserted"
|
||||
msgstr "无模式运行,输入文字即插入"
|
||||
|
||||
msgid "menu Edit->Global Settings->Toggle Insert Mode "
|
||||
msgstr "菜单 Edit->Global Settings->Toggle Insert Mode "
|
||||
msgstr "菜单 编辑->全局设定->开/关插入模式 "
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid " for two modes "
|
||||
|
||||
@@ -38,6 +38,7 @@ void fixthisline(int (*get_the_indent)(void));
|
||||
void fix_indent(void);
|
||||
int in_cinkeys(int keytyped, int when, int line_is_empty);
|
||||
int hkmap(int c);
|
||||
int bracketed_paste(paste_mode_T mode, int drop, garray_T *gap);
|
||||
void ins_scroll(void);
|
||||
void ins_horscroll(void);
|
||||
int ins_copychar(linenr_T lnum);
|
||||
|
||||
@@ -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_packadd(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);
|
||||
linenr_T *source_breakpoint(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_printable(int c);
|
||||
int utf_class(int c);
|
||||
int utf_class_buf(int c, buf_T *buf);
|
||||
int utf_ambiguous_width(int c);
|
||||
int utf_fold(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);
|
||||
void vim_strup(char_u *p);
|
||||
char_u *strup_save(char_u *orig);
|
||||
char_u *strlow_save(char_u *orig);
|
||||
void del_trailing_spaces(char_u *ptr);
|
||||
void vim_strncpy(char_u *to, char_u *from, size_t len);
|
||||
void vim_strcat(char_u *to, char_u *from, size_t tosize);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/* os_win32.c */
|
||||
HINSTANCE vimLoadLib(char *name);
|
||||
HINSTANCE find_imported_module_by_funcname(HINSTANCE hInst, const char *funcname);
|
||||
void *get_dll_import_func(HINSTANCE hInst, const char *funcname);
|
||||
int dyn_libintl_init(void);
|
||||
void dyn_libintl_end(void);
|
||||
void PlatformId(void);
|
||||
@@ -63,4 +65,5 @@ void free_cmd_argsW(void);
|
||||
void used_file_arg(char *name, int literal, int full_path, int diff_mode);
|
||||
void set_alist_count(void);
|
||||
void fix_arg_enc(void);
|
||||
int mch_setenv(char *var, char *value, int x);
|
||||
/* vim: set ft=c : */
|
||||
|
||||
+92
-97
@@ -777,101 +777,7 @@ update_screen(int type)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(FEAT_CONCEAL) || defined(PROTO)
|
||||
/*
|
||||
* Return TRUE if the cursor line in window "wp" may be concealed, according
|
||||
* to the 'concealcursor' option.
|
||||
*/
|
||||
int
|
||||
conceal_cursor_line(win_T *wp)
|
||||
{
|
||||
int c;
|
||||
|
||||
if (*wp->w_p_cocu == NUL)
|
||||
return FALSE;
|
||||
if (get_real_state() & VISUAL)
|
||||
c = 'v';
|
||||
else if (State & INSERT)
|
||||
c = 'i';
|
||||
else if (State & NORMAL)
|
||||
c = 'n';
|
||||
else if (State & CMDLINE)
|
||||
c = 'c';
|
||||
else
|
||||
return FALSE;
|
||||
return vim_strchr(wp->w_p_cocu, c) != NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if the cursor line needs to be redrawn because of 'concealcursor'.
|
||||
*/
|
||||
void
|
||||
conceal_check_cursur_line(void)
|
||||
{
|
||||
if (curwin->w_p_cole > 0 && conceal_cursor_line(curwin))
|
||||
{
|
||||
need_cursor_line_redraw = TRUE;
|
||||
/* Need to recompute cursor column, e.g., when starting Visual mode
|
||||
* without concealing. */
|
||||
curs_columns(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
update_single_line(win_T *wp, linenr_T lnum)
|
||||
{
|
||||
int row;
|
||||
int j;
|
||||
|
||||
/* Don't do anything if the screen structures are (not yet) valid. */
|
||||
if (!screen_valid(TRUE))
|
||||
return;
|
||||
|
||||
if (lnum >= wp->w_topline && lnum < wp->w_botline
|
||||
&& foldedCount(wp, lnum, &win_foldinfo) == 0)
|
||||
{
|
||||
# ifdef FEAT_GUI
|
||||
/* Remove the cursor before starting to do anything, because scrolling
|
||||
* may make it difficult to redraw the text under it. */
|
||||
if (gui.in_use)
|
||||
gui_undraw_cursor();
|
||||
# endif
|
||||
row = 0;
|
||||
for (j = 0; j < wp->w_lines_valid; ++j)
|
||||
{
|
||||
if (lnum == wp->w_lines[j].wl_lnum)
|
||||
{
|
||||
screen_start(); /* not sure of screen cursor */
|
||||
# ifdef FEAT_SEARCH_EXTRA
|
||||
init_search_hl(wp);
|
||||
start_search_hl();
|
||||
prepare_search_hl(wp, lnum);
|
||||
# endif
|
||||
win_line(wp, lnum, row, row + wp->w_lines[j].wl_size, FALSE);
|
||||
# if defined(FEAT_SEARCH_EXTRA)
|
||||
end_search_hl();
|
||||
# endif
|
||||
break;
|
||||
}
|
||||
row += wp->w_lines[j].wl_size;
|
||||
}
|
||||
# ifdef FEAT_GUI
|
||||
/* Redraw the cursor */
|
||||
if (gui.in_use)
|
||||
{
|
||||
out_flush(); /* required before updating the cursor */
|
||||
gui_update_cursor(FALSE, FALSE);
|
||||
}
|
||||
# endif
|
||||
}
|
||||
need_cursor_line_redraw = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_SIGNS) || defined(FEAT_GUI)
|
||||
static void update_prepare(void);
|
||||
static void update_finish(void);
|
||||
|
||||
#if defined(FEAT_SIGNS) || defined(FEAT_GUI) || defined(FEAT_CONCEAL)
|
||||
/*
|
||||
* Prepare for updating one or more windows.
|
||||
* Caller must check for "updating_screen" already set to avoid recursiveness.
|
||||
@@ -922,6 +828,87 @@ update_finish(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_CONCEAL) || defined(PROTO)
|
||||
/*
|
||||
* Return TRUE if the cursor line in window "wp" may be concealed, according
|
||||
* to the 'concealcursor' option.
|
||||
*/
|
||||
int
|
||||
conceal_cursor_line(win_T *wp)
|
||||
{
|
||||
int c;
|
||||
|
||||
if (*wp->w_p_cocu == NUL)
|
||||
return FALSE;
|
||||
if (get_real_state() & VISUAL)
|
||||
c = 'v';
|
||||
else if (State & INSERT)
|
||||
c = 'i';
|
||||
else if (State & NORMAL)
|
||||
c = 'n';
|
||||
else if (State & CMDLINE)
|
||||
c = 'c';
|
||||
else
|
||||
return FALSE;
|
||||
return vim_strchr(wp->w_p_cocu, c) != NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if the cursor line needs to be redrawn because of 'concealcursor'.
|
||||
*/
|
||||
void
|
||||
conceal_check_cursur_line(void)
|
||||
{
|
||||
if (curwin->w_p_cole > 0 && conceal_cursor_line(curwin))
|
||||
{
|
||||
need_cursor_line_redraw = TRUE;
|
||||
/* Need to recompute cursor column, e.g., when starting Visual mode
|
||||
* without concealing. */
|
||||
curs_columns(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
update_single_line(win_T *wp, linenr_T lnum)
|
||||
{
|
||||
int row;
|
||||
int j;
|
||||
|
||||
/* Don't do anything if the screen structures are (not yet) valid. */
|
||||
if (!screen_valid(TRUE) || updating_screen)
|
||||
return;
|
||||
|
||||
if (lnum >= wp->w_topline && lnum < wp->w_botline
|
||||
&& foldedCount(wp, lnum, &win_foldinfo) == 0)
|
||||
{
|
||||
update_prepare();
|
||||
|
||||
row = 0;
|
||||
for (j = 0; j < wp->w_lines_valid; ++j)
|
||||
{
|
||||
if (lnum == wp->w_lines[j].wl_lnum)
|
||||
{
|
||||
screen_start(); /* not sure of screen cursor */
|
||||
# ifdef FEAT_SEARCH_EXTRA
|
||||
init_search_hl(wp);
|
||||
start_search_hl();
|
||||
prepare_search_hl(wp, lnum);
|
||||
# endif
|
||||
win_line(wp, lnum, row, row + wp->w_lines[j].wl_size, FALSE);
|
||||
# if defined(FEAT_SEARCH_EXTRA)
|
||||
end_search_hl();
|
||||
# endif
|
||||
break;
|
||||
}
|
||||
row += wp->w_lines[j].wl_size;
|
||||
}
|
||||
|
||||
update_finish();
|
||||
}
|
||||
need_cursor_line_redraw = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_SIGNS) || defined(PROTO)
|
||||
void
|
||||
update_debug_sign(buf_T *buf, linenr_T lnum)
|
||||
@@ -2916,7 +2903,7 @@ win_line(
|
||||
int endrow,
|
||||
int nochange UNUSED) /* not updating for changed text */
|
||||
{
|
||||
int col; /* visual column on screen */
|
||||
int col = 0; /* visual column on screen */
|
||||
unsigned off; /* offset in ScreenLines/ScreenAttrs */
|
||||
int c = 0; /* init for GCC */
|
||||
long vcol = 0; /* virtual column (for tabs) */
|
||||
@@ -3442,7 +3429,11 @@ win_line(
|
||||
#else
|
||||
--ptr;
|
||||
#endif
|
||||
n_skip = v - vcol;
|
||||
#ifdef FEAT_MBYTE
|
||||
/* character fits on the screen, don't need to skip it */
|
||||
if ((*mb_ptr2cells)(ptr) >= c && col == 0)
|
||||
#endif
|
||||
n_skip = v - vcol;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3651,6 +3642,7 @@ win_line(
|
||||
{
|
||||
/* Draw the 'foldcolumn'. Allocate a buffer, "extra" may
|
||||
* already be in use. */
|
||||
vim_free(p_extra_free);
|
||||
p_extra_free = alloc(12 + 1);
|
||||
|
||||
if (p_extra_free != NULL)
|
||||
@@ -4695,6 +4687,7 @@ win_line(
|
||||
p = alloc((unsigned)(len + 1));
|
||||
vim_memset(p, ' ', len);
|
||||
p[len] = NUL;
|
||||
vim_free(p_extra_free);
|
||||
p_extra_free = p;
|
||||
for (i = 0; i < tab_len; i++)
|
||||
{
|
||||
@@ -4857,6 +4850,7 @@ win_line(
|
||||
vim_memset(p, ' ', n_extra);
|
||||
STRNCPY(p, p_extra + 1, STRLEN(p_extra) - 1);
|
||||
p[n_extra] = NUL;
|
||||
vim_free(p_extra_free);
|
||||
p_extra_free = p_extra = p;
|
||||
}
|
||||
else
|
||||
@@ -5789,6 +5783,7 @@ win_line(
|
||||
}
|
||||
#endif
|
||||
|
||||
vim_free(p_extra_free);
|
||||
return row;
|
||||
}
|
||||
|
||||
|
||||
@@ -1133,25 +1133,43 @@ typedef long_u hash_T; /* Type for hi_hash */
|
||||
# ifdef PROTO
|
||||
typedef long varnumber_T;
|
||||
typedef unsigned long uvarnumber_T;
|
||||
#define VARNUM_MIN LONG_MIN
|
||||
#define VARNUM_MAX LONG_MAX
|
||||
#define UVARNUM_MAX ULONG_MAX
|
||||
# else
|
||||
typedef __int64 varnumber_T;
|
||||
typedef unsigned __int64 uvarnumber_T;
|
||||
#define VARNUM_MIN _I64_MIN
|
||||
#define VARNUM_MAX _I64_MAX
|
||||
#define UVARNUM_MAX _UI64_MAX
|
||||
# endif
|
||||
# elif defined(HAVE_STDINT_H)
|
||||
typedef int64_t varnumber_T;
|
||||
typedef uint64_t uvarnumber_T;
|
||||
#define VARNUM_MIN INT64_MIN
|
||||
#define VARNUM_MAX INT64_MAX
|
||||
#define UVARNUM_MAX UINT64_MAX
|
||||
# else
|
||||
typedef long varnumber_T;
|
||||
typedef unsigned long uvarnumber_T;
|
||||
#define VARNUM_MIN LONG_MIN
|
||||
#define VARNUM_MAX LONG_MAX
|
||||
#define UVARNUM_MAX ULONG_MAX
|
||||
# endif
|
||||
#else
|
||||
/* Use 32-bit Number. */
|
||||
# if VIM_SIZEOF_INT <= 3 /* use long if int is smaller than 32 bits */
|
||||
typedef long varnumber_T;
|
||||
typedef unsigned long uvarnumber_T;
|
||||
#define VARNUM_MIN LONG_MIN
|
||||
#define VARNUM_MAX LONG_MAX
|
||||
#define UVARNUM_MAX ULONG_MAX
|
||||
# else
|
||||
typedef int varnumber_T;
|
||||
typedef unsigned int uvarnumber_T;
|
||||
#define VARNUM_MIN INT_MIN
|
||||
#define VARNUM_MAX INT_MAX
|
||||
#define UVARNUM_MAX UINT_MAX
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -1319,6 +1337,7 @@ typedef struct
|
||||
int uf_varargs; /* variable nr of arguments */
|
||||
int uf_flags;
|
||||
int uf_calls; /* nr of active calls */
|
||||
int uf_cleared; /* func_clear() was already called */
|
||||
garray_T uf_args; /* arguments */
|
||||
garray_T uf_lines; /* function lines */
|
||||
#ifdef FEAT_PROFILE
|
||||
@@ -2100,6 +2119,7 @@ struct file_buffer
|
||||
long_u b_p_inde_flags; /* flags for 'indentexpr' */
|
||||
char_u *b_p_indk; /* 'indentkeys' */
|
||||
#endif
|
||||
char_u *b_p_fp; /* 'formatprg' */
|
||||
#if defined(FEAT_EVAL)
|
||||
char_u *b_p_fex; /* 'formatexpr' */
|
||||
long_u b_p_fex_flags; /* flags for 'formatexpr' */
|
||||
|
||||
+71
-20
@@ -22,6 +22,7 @@ struct hl_group
|
||||
{
|
||||
char_u *sg_name; /* highlight group name */
|
||||
char_u *sg_name_u; /* uppercase of sg_name */
|
||||
int sg_cleared; /* "hi clear" was used */
|
||||
/* for normal terminals */
|
||||
int sg_term; /* "term=" highlighting attributes */
|
||||
char_u *sg_start; /* terminal string for start highl */
|
||||
@@ -462,7 +463,7 @@ static void syn_clear_keyword(int id, hashtab_T *ht);
|
||||
static void clear_keywtab(hashtab_T *ht);
|
||||
static void add_keyword(char_u *name, int id, int flags, short *cont_in_list, short *next_list, int conceal_char);
|
||||
static char_u *get_group_name(char_u *arg, char_u **name_end);
|
||||
static char_u *get_syn_options(char_u *arg, syn_opt_arg_T *opt, int *conceal_char);
|
||||
static char_u *get_syn_options(char_u *arg, syn_opt_arg_T *opt, int *conceal_char, int skip);
|
||||
static void syn_cmd_include(exarg_T *eap, int syncing);
|
||||
static void syn_cmd_iskeyword(exarg_T *eap, int syncing);
|
||||
static void syn_cmd_keyword(exarg_T *eap, int syncing);
|
||||
@@ -481,7 +482,7 @@ static int syn_add_cluster(char_u *name);
|
||||
static void init_syn_patterns(void);
|
||||
static char_u *get_syn_pattern(char_u *arg, synpat_T *ci);
|
||||
static void syn_cmd_sync(exarg_T *eap, int syncing);
|
||||
static int get_id_list(char_u **arg, int keylen, short **list);
|
||||
static int get_id_list(char_u **arg, int keylen, short **list, int skip);
|
||||
static void syn_combine_list(short **clstr1, short **clstr2, int list_op);
|
||||
static void syn_incl_toplevel(int id, int *flagsp);
|
||||
|
||||
@@ -3434,7 +3435,14 @@ syn_cmd_conceal(exarg_T *eap UNUSED, int syncing UNUSED)
|
||||
return;
|
||||
|
||||
next = skiptowhite(arg);
|
||||
if (STRNICMP(arg, "on", 2) == 0 && next - arg == 2)
|
||||
if (*arg == NUL)
|
||||
{
|
||||
if (curwin->w_s->b_syn_conceal)
|
||||
MSG(_("syn conceal on"));
|
||||
else
|
||||
MSG(_("syn conceal off"));
|
||||
}
|
||||
else if (STRNICMP(arg, "on", 2) == 0 && next - arg == 2)
|
||||
curwin->w_s->b_syn_conceal = TRUE;
|
||||
else if (STRNICMP(arg, "off", 3) == 0 && next - arg == 3)
|
||||
curwin->w_s->b_syn_conceal = FALSE;
|
||||
@@ -3457,7 +3465,14 @@ syn_cmd_case(exarg_T *eap, int syncing UNUSED)
|
||||
return;
|
||||
|
||||
next = skiptowhite(arg);
|
||||
if (STRNICMP(arg, "match", 5) == 0 && next - arg == 5)
|
||||
if (*arg == NUL)
|
||||
{
|
||||
if (curwin->w_s->b_syn_ic)
|
||||
MSG(_("syntax case ignore"));
|
||||
else
|
||||
MSG(_("syntax case match"));
|
||||
}
|
||||
else if (STRNICMP(arg, "match", 5) == 0 && next - arg == 5)
|
||||
curwin->w_s->b_syn_ic = FALSE;
|
||||
else if (STRNICMP(arg, "ignore", 6) == 0 && next - arg == 6)
|
||||
curwin->w_s->b_syn_ic = TRUE;
|
||||
@@ -3479,7 +3494,16 @@ syn_cmd_spell(exarg_T *eap, int syncing UNUSED)
|
||||
return;
|
||||
|
||||
next = skiptowhite(arg);
|
||||
if (STRNICMP(arg, "toplevel", 8) == 0 && next - arg == 8)
|
||||
if (*arg == NUL)
|
||||
{
|
||||
if (curwin->w_s->b_syn_spell == SYNSPL_TOP)
|
||||
MSG(_("syntax spell toplevel"));
|
||||
else if (curwin->w_s->b_syn_spell == SYNSPL_NOTOP)
|
||||
MSG(_("syntax spell notoplevel"));
|
||||
else
|
||||
MSG(_("syntax spell default"));
|
||||
}
|
||||
else if (STRNICMP(arg, "toplevel", 8) == 0 && next - arg == 8)
|
||||
curwin->w_s->b_syn_spell = SYNSPL_TOP;
|
||||
else if (STRNICMP(arg, "notoplevel", 10) == 0 && next - arg == 10)
|
||||
curwin->w_s->b_syn_spell = SYNSPL_NOTOP;
|
||||
@@ -3556,6 +3580,9 @@ syntax_clear(synblock_T *block)
|
||||
block->b_syn_ic = FALSE; /* Use case, by default */
|
||||
block->b_syn_spell = SYNSPL_DEFAULT; /* default spell checking */
|
||||
block->b_syn_containedin = FALSE;
|
||||
#ifdef FEAT_CONCEAL
|
||||
block->b_syn_conceal = FALSE;
|
||||
#endif
|
||||
|
||||
/* free the keywords */
|
||||
clear_keywtab(&block->b_keywtab);
|
||||
@@ -4543,7 +4570,8 @@ get_group_name(
|
||||
get_syn_options(
|
||||
char_u *arg, /* next argument to be checked */
|
||||
syn_opt_arg_T *opt, /* various things */
|
||||
int *conceal_char UNUSED)
|
||||
int *conceal_char UNUSED,
|
||||
int skip) /* TRUE if skipping over command */
|
||||
{
|
||||
char_u *gname_start, *gname;
|
||||
int syn_id;
|
||||
@@ -4626,17 +4654,17 @@ get_syn_options(
|
||||
EMSG(_("E395: contains argument not accepted here"));
|
||||
return NULL;
|
||||
}
|
||||
if (get_id_list(&arg, 8, &opt->cont_list) == FAIL)
|
||||
if (get_id_list(&arg, 8, &opt->cont_list, skip) == FAIL)
|
||||
return NULL;
|
||||
}
|
||||
else if (flagtab[fidx].argtype == 2)
|
||||
{
|
||||
if (get_id_list(&arg, 11, &opt->cont_in_list) == FAIL)
|
||||
if (get_id_list(&arg, 11, &opt->cont_in_list, skip) == FAIL)
|
||||
return NULL;
|
||||
}
|
||||
else if (flagtab[fidx].argtype == 3)
|
||||
{
|
||||
if (get_id_list(&arg, 9, &opt->next_list) == FAIL)
|
||||
if (get_id_list(&arg, 9, &opt->next_list, skip) == FAIL)
|
||||
return NULL;
|
||||
}
|
||||
else if (flagtab[fidx].argtype == 11 && arg[5] == '=')
|
||||
@@ -4846,7 +4874,10 @@ syn_cmd_keyword(exarg_T *eap, int syncing UNUSED)
|
||||
|
||||
if (rest != NULL)
|
||||
{
|
||||
syn_id = syn_check_group(arg, (int)(group_name_end - arg));
|
||||
if (eap->skip)
|
||||
syn_id = -1;
|
||||
else
|
||||
syn_id = syn_check_group(arg, (int)(group_name_end - arg));
|
||||
if (syn_id != 0)
|
||||
/* allocate a buffer, for removing backslashes in the keyword */
|
||||
keyword_copy = alloc((unsigned)STRLEN(rest) + 1);
|
||||
@@ -4868,7 +4899,8 @@ syn_cmd_keyword(exarg_T *eap, int syncing UNUSED)
|
||||
p = keyword_copy;
|
||||
for ( ; rest != NULL && !ends_excmd(*rest); rest = skipwhite(rest))
|
||||
{
|
||||
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char);
|
||||
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char,
|
||||
eap->skip);
|
||||
if (rest == NULL || ends_excmd(*rest))
|
||||
break;
|
||||
/* Copy the keyword, removing backslashes, and add a NUL. */
|
||||
@@ -4981,7 +5013,7 @@ syn_cmd_match(
|
||||
syn_opt_arg.cont_list = NULL;
|
||||
syn_opt_arg.cont_in_list = NULL;
|
||||
syn_opt_arg.next_list = NULL;
|
||||
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char);
|
||||
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, eap->skip);
|
||||
|
||||
/* get the pattern. */
|
||||
init_syn_patterns();
|
||||
@@ -4991,7 +5023,7 @@ syn_cmd_match(
|
||||
syn_opt_arg.flags |= HL_HAS_EOL;
|
||||
|
||||
/* Get options after the pattern */
|
||||
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char);
|
||||
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, eap->skip);
|
||||
|
||||
if (rest != NULL) /* all arguments are valid */
|
||||
{
|
||||
@@ -5117,7 +5149,7 @@ syn_cmd_region(
|
||||
while (rest != NULL && !ends_excmd(*rest))
|
||||
{
|
||||
/* Check for option arguments */
|
||||
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char);
|
||||
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, eap->skip);
|
||||
if (rest == NULL || ends_excmd(*rest))
|
||||
break;
|
||||
|
||||
@@ -5628,13 +5660,16 @@ syn_cmd_cluster(exarg_T *eap, int syncing UNUSED)
|
||||
break;
|
||||
|
||||
clstr_list = NULL;
|
||||
if (get_id_list(&rest, opt_len, &clstr_list) == FAIL)
|
||||
if (get_id_list(&rest, opt_len, &clstr_list, eap->skip) == FAIL)
|
||||
{
|
||||
EMSG2(_(e_invarg2), rest);
|
||||
break;
|
||||
}
|
||||
syn_combine_list(&SYN_CLSTR(curwin->w_s)[scl_id].scl_list,
|
||||
if (scl_id >= 0)
|
||||
syn_combine_list(&SYN_CLSTR(curwin->w_s)[scl_id].scl_list,
|
||||
&clstr_list, list_op);
|
||||
else
|
||||
vim_free(clstr_list);
|
||||
got_clstr = TRUE;
|
||||
}
|
||||
|
||||
@@ -5931,8 +5966,9 @@ syn_cmd_sync(exarg_T *eap, int syncing UNUSED)
|
||||
get_id_list(
|
||||
char_u **arg,
|
||||
int keylen, /* length of keyword */
|
||||
short **list) /* where to store the resulting list, if not
|
||||
short **list, /* where to store the resulting list, if not
|
||||
NULL, the list is silently skipped! */
|
||||
int skip)
|
||||
{
|
||||
char_u *p = NULL;
|
||||
char_u *end;
|
||||
@@ -6000,7 +6036,8 @@ get_id_list(
|
||||
}
|
||||
if (count != 0)
|
||||
{
|
||||
EMSG2(_("E408: %s must be first in contains list"), name + 1);
|
||||
EMSG2(_("E408: %s must be first in contains list"),
|
||||
name + 1);
|
||||
failed = TRUE;
|
||||
vim_free(name);
|
||||
break;
|
||||
@@ -6015,7 +6052,10 @@ get_id_list(
|
||||
}
|
||||
else if (name[1] == '@')
|
||||
{
|
||||
id = syn_check_cluster(name + 2, (int)(end - p - 1));
|
||||
if (skip)
|
||||
id = -1;
|
||||
else
|
||||
id = syn_check_cluster(name + 2, (int)(end - p - 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -7293,6 +7333,7 @@ do_highlight(
|
||||
#ifdef FEAT_EVAL
|
||||
HL_TABLE()[from_id - 1].sg_scriptID = current_SID;
|
||||
#endif
|
||||
HL_TABLE()[from_id - 1].sg_cleared = FALSE;
|
||||
redraw_all_later(SOME_VALID);
|
||||
}
|
||||
}
|
||||
@@ -8001,6 +8042,7 @@ do_highlight(
|
||||
error = TRUE;
|
||||
break;
|
||||
}
|
||||
HL_TABLE()[idx].sg_cleared = FALSE;
|
||||
|
||||
/*
|
||||
* When highlighting has been given for a group, don't link it.
|
||||
@@ -8138,6 +8180,8 @@ hl_has_settings(int idx, int check_link)
|
||||
static void
|
||||
highlight_clear(int idx)
|
||||
{
|
||||
HL_TABLE()[idx].sg_cleared = TRUE;
|
||||
|
||||
HL_TABLE()[idx].sg_term = 0;
|
||||
vim_free(HL_TABLE()[idx].sg_start);
|
||||
HL_TABLE()[idx].sg_start = NULL;
|
||||
@@ -9913,6 +9957,13 @@ highlight_list_two(int cnt, int attr)
|
||||
char_u *
|
||||
get_highlight_name(expand_T *xp UNUSED, int idx)
|
||||
{
|
||||
if (idx < 0)
|
||||
return NULL;
|
||||
/* Items are never removed from the table, skip the ones that were cleared.
|
||||
*/
|
||||
while (idx < highlight_ga.ga_len && HL_TABLE()[idx].sg_cleared)
|
||||
++idx;
|
||||
|
||||
#ifdef FEAT_CMDL_COMPL
|
||||
if (idx == highlight_ga.ga_len && include_none != 0)
|
||||
return (char_u *)"none";
|
||||
@@ -9925,7 +9976,7 @@ get_highlight_name(expand_T *xp UNUSED, int idx)
|
||||
&& include_link != 0)
|
||||
return (char_u *)"clear";
|
||||
#endif
|
||||
if (idx < 0 || idx >= highlight_ga.ga_len)
|
||||
if (idx >= highlight_ga.ga_len)
|
||||
return NULL;
|
||||
return HL_TABLE()[idx].sg_name;
|
||||
}
|
||||
|
||||
@@ -35,19 +35,15 @@ typedef struct tag_pointers
|
||||
} tagptrs_T;
|
||||
|
||||
/*
|
||||
* The matching tags are first stored in ga_match[]. In which one depends on
|
||||
* the priority of the match.
|
||||
* At the end, the matches from ga_match[] are concatenated, to make a list
|
||||
* The matching tags are first stored in one of the ht_match[] hash tables. In
|
||||
* which one depends on the priority of the match.
|
||||
* At the end, all the matches from ht_match[] are concatenated, to make a list
|
||||
* sorted on priority.
|
||||
*/
|
||||
#define MT_ST_CUR 0 /* static match in current file */
|
||||
#define MT_GL_CUR 1 /* global match in current file */
|
||||
#define MT_GL_OTH 2 /* global match in other file */
|
||||
#define MT_ST_OTH 3 /* static match in other file */
|
||||
#define MT_IC_ST_CUR 4 /* icase static match in current file */
|
||||
#define MT_IC_GL_CUR 5 /* icase global match in current file */
|
||||
#define MT_IC_GL_OTH 6 /* icase global match in other file */
|
||||
#define MT_IC_ST_OTH 7 /* icase static match in other file */
|
||||
#define MT_IC_OFF 4 /* add for icase match */
|
||||
#define MT_RE_OFF 8 /* add for regexp match */
|
||||
#define MT_MASK 7 /* mask for printing priority */
|
||||
@@ -1260,6 +1256,7 @@ prepare_pats(pat_T *pats, int has_re)
|
||||
* TAG_REGEXP use "pat" as a regexp
|
||||
* TAG_NOIC don't always ignore case
|
||||
* TAG_KEEP_LANG keep language
|
||||
* TAG_CSCOPE use cscope results for tags
|
||||
*/
|
||||
int
|
||||
find_tags(
|
||||
@@ -1341,12 +1338,9 @@ find_tags(
|
||||
int is_etag; /* current file is emaces style */
|
||||
#endif
|
||||
|
||||
struct match_found
|
||||
{
|
||||
int len; /* nr of chars of match[] to be compared */
|
||||
char_u match[1]; /* actually longer */
|
||||
} *mfp, *mfp2;
|
||||
garray_T ga_match[MT_COUNT];
|
||||
char_u *mfp;
|
||||
hashtab_T ht_match[MT_COUNT];
|
||||
hash_T hash = 0;
|
||||
int match_count = 0; /* number of matches found */
|
||||
char_u **matches;
|
||||
int mtt;
|
||||
@@ -1402,16 +1396,16 @@ find_tags(
|
||||
vimconv.vc_type = CONV_NONE;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Allocate memory for the buffers that are used
|
||||
*/
|
||||
/*
|
||||
* Allocate memory for the buffers that are used
|
||||
*/
|
||||
lbuf = alloc(lbuf_size);
|
||||
tag_fname = alloc(MAXPATHL + 1);
|
||||
#ifdef FEAT_EMACS_TAGS
|
||||
ebuf = alloc(LSIZE);
|
||||
#endif
|
||||
for (mtt = 0; mtt < MT_COUNT; ++mtt)
|
||||
ga_init2(&ga_match[mtt], (int)sizeof(struct match_found *), 100);
|
||||
hash_init(&ht_match[mtt]);
|
||||
|
||||
/* check for out of memory situation */
|
||||
if (lbuf == NULL || tag_fname == NULL
|
||||
@@ -1430,6 +1424,14 @@ find_tags(
|
||||
*/
|
||||
if (help_only) /* want tags from help file */
|
||||
curbuf->b_help = TRUE; /* will be restored later */
|
||||
#ifdef FEAT_CSCOPE
|
||||
else if (use_cscope)
|
||||
{
|
||||
/* Make sure we don't mix help and cscope, confuses Coverity. */
|
||||
help_only = FALSE;
|
||||
curbuf->b_help = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
orgpat.len = (int)STRLEN(pat);
|
||||
#ifdef FEAT_MULTI_LANG
|
||||
@@ -1759,8 +1761,13 @@ line_read_in:
|
||||
/*
|
||||
* Emacs tags line with CTRL-L: New file name on next line.
|
||||
* The file name is followed by a ','.
|
||||
* Remember etag file name in ebuf.
|
||||
*/
|
||||
if (*lbuf == Ctrl_L) /* remember etag file name in ebuf */
|
||||
if (*lbuf == Ctrl_L
|
||||
# ifdef FEAT_CSCOPE
|
||||
&& !use_cscope
|
||||
# endif
|
||||
)
|
||||
{
|
||||
is_etag = 1; /* in case at the start */
|
||||
state = TS_LINEAR;
|
||||
@@ -2206,10 +2213,12 @@ parse_line:
|
||||
}
|
||||
|
||||
/*
|
||||
* If a match is found, add it to ga_match[].
|
||||
* If a match is found, add it to ht_match[].
|
||||
*/
|
||||
if (match)
|
||||
{
|
||||
int len = 0;
|
||||
|
||||
#ifdef FEAT_CSCOPE
|
||||
if (use_cscope)
|
||||
{
|
||||
@@ -2262,179 +2271,171 @@ parse_line:
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the found match in ga_match[mtt], avoiding duplicates.
|
||||
* Add the found match in ht_match[mtt].
|
||||
* Store the info we need later, which depends on the kind of
|
||||
* tags we are dealing with.
|
||||
*/
|
||||
if (ga_grow(&ga_match[mtt], 1) == OK)
|
||||
if (help_only)
|
||||
{
|
||||
int len;
|
||||
int heuristic;
|
||||
|
||||
if (help_only)
|
||||
{
|
||||
#ifdef FEAT_MULTI_LANG
|
||||
# define ML_EXTRA 3
|
||||
#else
|
||||
# define ML_EXTRA 0
|
||||
#endif
|
||||
/*
|
||||
* Append the help-heuristic number after the
|
||||
* tagname, for sorting it later.
|
||||
*/
|
||||
*tagp.tagname_end = NUL;
|
||||
len = (int)(tagp.tagname_end - tagp.tagname);
|
||||
mfp = (struct match_found *)
|
||||
alloc((int)sizeof(struct match_found) + len
|
||||
+ 10 + ML_EXTRA);
|
||||
if (mfp != NULL)
|
||||
{
|
||||
/* "len" includes the language and the NUL, but
|
||||
* not the priority. */
|
||||
mfp->len = len + ML_EXTRA + 1;
|
||||
#define ML_HELP_LEN 6
|
||||
p = mfp->match;
|
||||
STRCPY(p, tagp.tagname);
|
||||
#ifdef FEAT_MULTI_LANG
|
||||
p[len] = '@';
|
||||
STRCPY(p + len + 1, help_lang);
|
||||
#endif
|
||||
|
||||
heuristic = help_heuristic(tagp.tagname,
|
||||
match_re ? matchoff : 0, !match_no_ic);
|
||||
#ifdef FEAT_MULTI_LANG
|
||||
heuristic += help_pri;
|
||||
#endif
|
||||
sprintf((char *)p + len + 1 + ML_EXTRA, "%06d",
|
||||
heuristic);
|
||||
}
|
||||
*tagp.tagname_end = TAB;
|
||||
}
|
||||
else if (name_only)
|
||||
/*
|
||||
* Append the help-heuristic number after the tagname, for
|
||||
* sorting it later. The heuristic is ignored for
|
||||
* detecting duplicates.
|
||||
* The format is {tagname}@{lang}NUL{heuristic}NUL
|
||||
*/
|
||||
*tagp.tagname_end = NUL;
|
||||
len = (int)(tagp.tagname_end - tagp.tagname);
|
||||
mfp = (char_u *)alloc((int)sizeof(char_u)
|
||||
+ len + 10 + ML_EXTRA + 1);
|
||||
if (mfp != NULL)
|
||||
{
|
||||
if (get_it_again)
|
||||
int heuristic;
|
||||
|
||||
p = mfp;
|
||||
STRCPY(p, tagp.tagname);
|
||||
#ifdef FEAT_MULTI_LANG
|
||||
p[len] = '@';
|
||||
STRCPY(p + len + 1, help_lang);
|
||||
#endif
|
||||
|
||||
heuristic = help_heuristic(tagp.tagname,
|
||||
match_re ? matchoff : 0, !match_no_ic);
|
||||
#ifdef FEAT_MULTI_LANG
|
||||
heuristic += help_pri;
|
||||
#endif
|
||||
sprintf((char *)p + len + 1 + ML_EXTRA, "%06d",
|
||||
heuristic);
|
||||
}
|
||||
*tagp.tagname_end = TAB;
|
||||
}
|
||||
else if (name_only)
|
||||
{
|
||||
if (get_it_again)
|
||||
{
|
||||
char_u *temp_end = tagp.command;
|
||||
|
||||
if (*temp_end == '/')
|
||||
while (*temp_end && *temp_end != '\r'
|
||||
&& *temp_end != '\n'
|
||||
&& *temp_end != '$')
|
||||
temp_end++;
|
||||
|
||||
if (tagp.command + 2 < temp_end)
|
||||
{
|
||||
char_u *temp_end = tagp.command;
|
||||
|
||||
if (*temp_end == '/')
|
||||
while (*temp_end && *temp_end != '\r'
|
||||
&& *temp_end != '\n'
|
||||
&& *temp_end != '$')
|
||||
temp_end++;
|
||||
|
||||
if (tagp.command + 2 < temp_end)
|
||||
{
|
||||
len = (int)(temp_end - tagp.command - 2);
|
||||
mfp = (struct match_found *)alloc(
|
||||
(int)sizeof(struct match_found) + len);
|
||||
if (mfp != NULL)
|
||||
{
|
||||
mfp->len = len + 1; /* include the NUL */
|
||||
p = mfp->match;
|
||||
vim_strncpy(p, tagp.command + 2, len);
|
||||
}
|
||||
}
|
||||
else
|
||||
mfp = NULL;
|
||||
get_it_again = FALSE;
|
||||
len = (int)(temp_end - tagp.command - 2);
|
||||
mfp = (char_u *)alloc(len + 2);
|
||||
if (mfp != NULL)
|
||||
vim_strncpy(mfp, tagp.command + 2, len);
|
||||
}
|
||||
else
|
||||
{
|
||||
len = (int)(tagp.tagname_end - tagp.tagname);
|
||||
mfp = (struct match_found *)alloc(
|
||||
(int)sizeof(struct match_found) + len);
|
||||
if (mfp != NULL)
|
||||
{
|
||||
mfp->len = len + 1; /* include the NUL */
|
||||
p = mfp->match;
|
||||
vim_strncpy(p, tagp.tagname, len);
|
||||
}
|
||||
|
||||
/* if wanted, re-read line to get long form too */
|
||||
if (State & INSERT)
|
||||
get_it_again = p_sft;
|
||||
}
|
||||
mfp = NULL;
|
||||
get_it_again = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Save the tag in a buffer.
|
||||
* Emacs tag: <mtt><tag_fname><NUL><ebuf><NUL><lbuf>
|
||||
* other tag: <mtt><tag_fname><NUL><NUL><lbuf>
|
||||
* without Emacs tags: <mtt><tag_fname><NUL><lbuf>
|
||||
*/
|
||||
len = (int)STRLEN(tag_fname)
|
||||
+ (int)STRLEN(lbuf) + 3;
|
||||
#ifdef FEAT_EMACS_TAGS
|
||||
if (is_etag)
|
||||
len += (int)STRLEN(ebuf) + 1;
|
||||
else
|
||||
++len;
|
||||
#endif
|
||||
mfp = (struct match_found *)alloc(
|
||||
(int)sizeof(struct match_found) + len);
|
||||
len = (int)(tagp.tagname_end - tagp.tagname);
|
||||
mfp = (char_u *)alloc((int)sizeof(char_u) + len + 1);
|
||||
if (mfp != NULL)
|
||||
{
|
||||
mfp->len = len;
|
||||
p = mfp->match;
|
||||
p[0] = mtt;
|
||||
STRCPY(p + 1, tag_fname);
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
/* Ignore differences in slashes, avoid adding
|
||||
* both path/file and path\file. */
|
||||
slash_adjust(p + 1);
|
||||
#endif
|
||||
s = p + 1 + STRLEN(tag_fname) + 1;
|
||||
#ifdef FEAT_EMACS_TAGS
|
||||
if (is_etag)
|
||||
{
|
||||
STRCPY(s, ebuf);
|
||||
s += STRLEN(ebuf) + 1;
|
||||
}
|
||||
else
|
||||
*s++ = NUL;
|
||||
#endif
|
||||
STRCPY(s, lbuf);
|
||||
}
|
||||
}
|
||||
vim_strncpy(mfp, tagp.tagname, len);
|
||||
|
||||
if (mfp != NULL)
|
||||
{
|
||||
/*
|
||||
* Don't add identical matches.
|
||||
* This can take a lot of time when finding many
|
||||
* matches, check for CTRL-C now and then.
|
||||
* Add all cscope tags, because they are all listed.
|
||||
*/
|
||||
#ifdef FEAT_CSCOPE
|
||||
if (use_cscope)
|
||||
i = -1;
|
||||
else
|
||||
#endif
|
||||
for (i = ga_match[mtt].ga_len; --i >= 0 && !got_int; )
|
||||
{
|
||||
mfp2 = ((struct match_found **)
|
||||
(ga_match[mtt].ga_data))[i];
|
||||
if (mfp2->len == mfp->len
|
||||
&& memcmp(mfp2->match, mfp->match,
|
||||
(size_t)mfp->len) == 0)
|
||||
break;
|
||||
fast_breakcheck();
|
||||
}
|
||||
if (i < 0)
|
||||
{
|
||||
((struct match_found **)(ga_match[mtt].ga_data))
|
||||
[ga_match[mtt].ga_len++] = mfp;
|
||||
++match_count;
|
||||
}
|
||||
else
|
||||
vim_free(mfp);
|
||||
/* if wanted, re-read line to get long form too */
|
||||
if (State & INSERT)
|
||||
get_it_again = p_sft;
|
||||
}
|
||||
}
|
||||
else /* Out of memory! Just forget about the rest. */
|
||||
else
|
||||
{
|
||||
retval = OK;
|
||||
stop_searching = TRUE;
|
||||
break;
|
||||
#define TAG_SEP 0x01
|
||||
size_t tag_fname_len = STRLEN(tag_fname);
|
||||
#ifdef FEAT_EMACS_TAGS
|
||||
size_t ebuf_len = 0;
|
||||
#endif
|
||||
|
||||
/* Save the tag in a buffer.
|
||||
* Use 0x01 to separate fields (Can't use NUL, because the
|
||||
* hash key is terminated by NUL).
|
||||
* Emacs tag: <mtt><tag_fname><0x01><ebuf><0x01><lbuf><NUL>
|
||||
* other tag: <mtt><tag_fname><0x01><0x01><lbuf><NUL>
|
||||
* without Emacs tags: <mtt><tag_fname><0x01><lbuf><NUL>
|
||||
* Here <mtt> is the "mtt" value plus 1 to avoid NUL.
|
||||
*/
|
||||
len = (int)tag_fname_len + (int)STRLEN(lbuf) + 3;
|
||||
#ifdef FEAT_EMACS_TAGS
|
||||
if (is_etag)
|
||||
{
|
||||
ebuf_len = STRLEN(ebuf);
|
||||
len += (int)ebuf_len + 1;
|
||||
}
|
||||
else
|
||||
++len;
|
||||
#endif
|
||||
mfp = (char_u *)alloc((int)sizeof(char_u) + len + 1);
|
||||
if (mfp != NULL)
|
||||
{
|
||||
p = mfp;
|
||||
p[0] = mtt + 1;
|
||||
STRCPY(p + 1, tag_fname);
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
/* Ignore differences in slashes, avoid adding
|
||||
* both path/file and path\file. */
|
||||
slash_adjust(p + 1);
|
||||
#endif
|
||||
p[tag_fname_len + 1] = TAG_SEP;
|
||||
s = p + 1 + tag_fname_len + 1;
|
||||
#ifdef FEAT_EMACS_TAGS
|
||||
if (is_etag)
|
||||
{
|
||||
STRCPY(s, ebuf);
|
||||
s[ebuf_len] = TAG_SEP;
|
||||
s += ebuf_len + 1;
|
||||
}
|
||||
else
|
||||
*s++ = TAG_SEP;
|
||||
#endif
|
||||
STRCPY(s, lbuf);
|
||||
}
|
||||
}
|
||||
|
||||
if (mfp != NULL)
|
||||
{
|
||||
hashitem_T *hi;
|
||||
|
||||
/*
|
||||
* Don't add identical matches.
|
||||
* Add all cscope tags, because they are all listed.
|
||||
* "mfp" is used as a hash key, there is a NUL byte to end
|
||||
* the part matters for comparing, more bytes may follow
|
||||
* after it. E.g. help tags store the priority after the
|
||||
* NUL.
|
||||
*/
|
||||
#ifdef FEAT_CSCOPE
|
||||
if (use_cscope)
|
||||
hash++;
|
||||
else
|
||||
#endif
|
||||
hash = hash_hash(mfp);
|
||||
hi = hash_lookup(&ht_match[mtt], mfp, hash);
|
||||
if (HASHITEM_EMPTY(hi))
|
||||
{
|
||||
if (hash_add_item(&ht_match[mtt], hi, mfp, hash)
|
||||
== FAIL)
|
||||
{
|
||||
/* Out of memory! Just forget about the rest. */
|
||||
retval = OK;
|
||||
stop_searching = TRUE;
|
||||
break;
|
||||
}
|
||||
else
|
||||
++match_count;
|
||||
}
|
||||
else
|
||||
/* duplicate tag, drop it */
|
||||
vim_free(mfp);
|
||||
}
|
||||
}
|
||||
#ifdef FEAT_CSCOPE
|
||||
@@ -2532,7 +2533,7 @@ findtag_end:
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Move the matches from the ga_match[] arrays into one list of
|
||||
* Move the matches from the ht_match[] arrays into one list of
|
||||
* matches. When retval == FAIL, free the matches.
|
||||
*/
|
||||
if (retval == FAIL)
|
||||
@@ -2546,22 +2547,35 @@ findtag_end:
|
||||
match_count = 0;
|
||||
for (mtt = 0; mtt < MT_COUNT; ++mtt)
|
||||
{
|
||||
for (i = 0; i < ga_match[mtt].ga_len; ++i)
|
||||
hashitem_T *hi;
|
||||
long_u todo;
|
||||
|
||||
todo = (long)ht_match[mtt].ht_used;
|
||||
for (hi = ht_match[mtt].ht_array; todo > 0; ++hi)
|
||||
{
|
||||
mfp = ((struct match_found **)(ga_match[mtt].ga_data))[i];
|
||||
if (matches == NULL)
|
||||
vim_free(mfp);
|
||||
else
|
||||
if (!HASHITEM_EMPTY(hi))
|
||||
{
|
||||
/* To avoid allocating memory again we turn the struct
|
||||
* match_found into a string. For help the priority was not
|
||||
* included in the length. */
|
||||
mch_memmove(mfp, mfp->match,
|
||||
(size_t)(mfp->len + (help_only ? ML_HELP_LEN : 0)));
|
||||
matches[match_count++] = (char_u *)mfp;
|
||||
mfp = hi->hi_key;
|
||||
if (matches == NULL)
|
||||
vim_free(mfp);
|
||||
else
|
||||
{
|
||||
if (!name_only)
|
||||
{
|
||||
/* Change mtt back to zero-based. */
|
||||
*mfp = *mfp - 1;
|
||||
|
||||
/* change the TAG_SEP back to NUL */
|
||||
for (p = mfp + 1; *p != NUL; ++p)
|
||||
if (*p == TAG_SEP)
|
||||
*p = NUL;
|
||||
}
|
||||
matches[match_count++] = (char_u *)mfp;
|
||||
}
|
||||
todo--;
|
||||
}
|
||||
}
|
||||
ga_clear(&ga_match[mtt]);
|
||||
hash_clear(&ht_match[mtt]);
|
||||
}
|
||||
|
||||
*matchesp = matches;
|
||||
|
||||
+17
-7
@@ -857,6 +857,8 @@ static struct builtin_term builtin_termcaps[] =
|
||||
{(int)KS_8F, IF_EB("\033[38;2;%lu;%lu;%lum", ESC_STR "[38;2;%lu;%lu;%lum")},
|
||||
{(int)KS_8B, IF_EB("\033[48;2;%lu;%lu;%lum", ESC_STR "[48;2;%lu;%lu;%lum")},
|
||||
# endif
|
||||
{(int)KS_CBE, IF_EB("\033[?2004h", ESC_STR "[?2004h")},
|
||||
{(int)KS_CBD, IF_EB("\033[?2004l", ESC_STR "[?2004l")},
|
||||
|
||||
{K_UP, IF_EB("\033O*A", ESC_STR "O*A")},
|
||||
{K_DOWN, IF_EB("\033O*B", ESC_STR "O*B")},
|
||||
@@ -902,13 +904,15 @@ static struct builtin_term builtin_termcaps[] =
|
||||
{K_ZEND, IF_EB("\033[8;*~", ESC_STR "[8;*~")},
|
||||
{K_PAGEUP, IF_EB("\033[5;*~", ESC_STR "[5;*~")},
|
||||
{K_PAGEDOWN, IF_EB("\033[6;*~", ESC_STR "[6;*~")},
|
||||
{K_KPLUS, IF_EB("\033O*k", ESC_STR "O*k")}, /* keypad plus */
|
||||
{K_KMINUS, IF_EB("\033O*m", ESC_STR "O*m")}, /* keypad minus */
|
||||
{K_KDIVIDE, IF_EB("\033O*o", ESC_STR "O*o")}, /* keypad / */
|
||||
{K_KMULTIPLY, IF_EB("\033O*j", ESC_STR "O*j")}, /* keypad * */
|
||||
{K_KENTER, IF_EB("\033O*M", ESC_STR "O*M")}, /* keypad Enter */
|
||||
{K_KPOINT, IF_EB("\033O*n", ESC_STR "O*n")}, /* keypad . */
|
||||
{K_KDEL, IF_EB("\033[3;*~", ESC_STR "[3;*~")}, /* keypad Del */
|
||||
{K_KPLUS, IF_EB("\033O*k", ESC_STR "O*k")}, /* keypad plus */
|
||||
{K_KMINUS, IF_EB("\033O*m", ESC_STR "O*m")}, /* keypad minus */
|
||||
{K_KDIVIDE, IF_EB("\033O*o", ESC_STR "O*o")}, /* keypad / */
|
||||
{K_KMULTIPLY, IF_EB("\033O*j", ESC_STR "O*j")}, /* keypad * */
|
||||
{K_KENTER, IF_EB("\033O*M", ESC_STR "O*M")}, /* keypad Enter */
|
||||
{K_KPOINT, IF_EB("\033O*n", ESC_STR "O*n")}, /* keypad . */
|
||||
{K_KDEL, IF_EB("\033[3;*~", ESC_STR "[3;*~")}, /* keypad Del */
|
||||
{K_PS, IF_EB("\033[200~", ESC_STR "[200~")}, /* paste start */
|
||||
{K_PE, IF_EB("\033[201~", ESC_STR "[201~")}, /* paste end */
|
||||
|
||||
{BT_EXTRA_KEYS, ""},
|
||||
{TERMCAP2KEY('k', '0'), IF_EB("\033[10;*~", ESC_STR "[10;*~")}, /* F0 */
|
||||
@@ -1224,6 +1228,8 @@ static struct builtin_term builtin_termcaps[] =
|
||||
{K_KMULTIPLY, "[KMULTIPLY]"},
|
||||
{K_KENTER, "[KENTER]"},
|
||||
{K_KPOINT, "[KPOINT]"},
|
||||
{K_PS, "[PASTE-START]"},
|
||||
{K_PE, "[PASTE-END]"},
|
||||
{K_K0, "[K0]"},
|
||||
{K_K1, "[K1]"},
|
||||
{K_K2, "[K2]"},
|
||||
@@ -1544,6 +1550,8 @@ set_termname(char_u *term)
|
||||
{KS_CSI, "SI"}, {KS_CEI, "EI"},
|
||||
{KS_U7, "u7"}, {KS_RBG, "RB"},
|
||||
{KS_8F, "8f"}, {KS_8B, "8b"},
|
||||
{KS_CBE, "BE"}, {KS_CBD, "BD"},
|
||||
{KS_CPS, "PS"}, {KS_CPE, "PE"},
|
||||
{(enum SpecialKey)0, NULL}
|
||||
};
|
||||
|
||||
@@ -3146,6 +3154,7 @@ starttermcap(void)
|
||||
{
|
||||
out_str(T_TI); /* start termcap mode */
|
||||
out_str(T_KS); /* start "keypad transmit" mode */
|
||||
out_str(T_BE); /* enable bracketed paste mode */
|
||||
out_flush();
|
||||
termcap_active = TRUE;
|
||||
screen_start(); /* don't know where cursor is now */
|
||||
@@ -3195,6 +3204,7 @@ stoptermcap(void)
|
||||
check_for_codes_from_term();
|
||||
}
|
||||
#endif
|
||||
out_str(T_BD); /* disable bracketed paste mode */
|
||||
out_str(T_KE); /* stop "keypad transmit" mode */
|
||||
out_flush();
|
||||
termcap_active = FALSE;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user