mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-02 11:19:22 +02:00
Compare commits
346 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b667ee0c63 | |||
| 1fcce8d536 | |||
| 1043467482 | |||
| 23a5558cfd | |||
| 75c19464ed | |||
| 9abccb9a5c | |||
| 24f8f543d4 | |||
| 913727e567 | |||
| 5f761f85d8 | |||
| f1f6f3f7df | |||
| 31eb139b88 | |||
| 399c297aa9 | |||
| 8cc2a9c062 | |||
| 4d8505155e | |||
| 190b04cdd9 | |||
| a9f8ffb634 | |||
| 43dded8c59 | |||
| dad7309dd2 | |||
| a76f59d817 | |||
| 9235d12894 | |||
| 65189a1294 | |||
| 6f785749db | |||
| 88989cc381 | |||
| 544d3bc9f0 | |||
| 78f80e21cb | |||
| 13c724fb3a | |||
| 059b7482a2 | |||
| 2f9e575583 | |||
| 955f198fc5 | |||
| e971df39a5 | |||
| aaaf57d8a9 | |||
| c11c152316 | |||
| 1fb0d49803 | |||
| a1891848d9 | |||
| e353c402e6 | |||
| 698f8b207b | |||
| 25ea054458 | |||
| 6b40f30329 | |||
| cbf20fbcd3 | |||
| 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 | |||
| 220f000f59 | |||
| 9c4147192a | |||
| 1d669c233c | |||
| ee142add22 | |||
| e32abbe42c | |||
| 8b2f19536f | |||
| 872004132f | |||
| 08243d26d2 | |||
| 03c60c1573 | |||
| f446b48ff0 | |||
| caa55b65c2 | |||
| 68563937f5 | |||
| 8be81c4e3b | |||
| 6abda995a5 | |||
| 009c7b2640 | |||
| 4d0504019c | |||
| acc11d1692 | |||
| de33011ec6 | |||
| c695cec469 | |||
| 6247361101 | |||
| 2d02839050 | |||
| 453b576ee5 | |||
| a216255a4f | |||
| 31f19ce0a0 | |||
| 9d9c356517 | |||
| 04e94c7881 | |||
| 12c4492dd3 | |||
| 386ade3ae2 | |||
| 7069bf18e1 | |||
| cbd4de44e8 | |||
| c6aa475a27 | |||
| 1b14651629 | |||
| 6e450a5754 | |||
| 287266527a | |||
| 29891c4ed4 | |||
| aaeabfbca5 | |||
| 14a612fa2e | |||
| 7034a83743 | |||
| a4ce25bd98 | |||
| 294740d2ac | |||
| 9269315f63 | |||
| f845b87f2b | |||
| 4374735576 | |||
| 1e3514c02e | |||
| 8133aa23f0 | |||
| 290ed88c0b | |||
| f9ed667087 | |||
| 263115a528 | |||
| 6127f5c9eb | |||
| 921d522f70 | |||
| a1a2788ffa | |||
| 0cdb72aa38 | |||
| bc2eada542 | |||
| c6e15ba8e7 | |||
| 269aec7e61 | |||
| f8eb9c51e5 | |||
| 5e1e6d265d | |||
| b094ff4b2b | |||
| 777b30f827 | |||
| 54b2bfa399 | |||
| ded2782783 | |||
| 4bf9153e6d | |||
| c4bfedabe0 | |||
| 7c0d06c170 | |||
| fe38b494ff | |||
| 4c8980b717 | |||
| 73b484c4da | |||
| f5464c4b19 | |||
| 63de19e805 | |||
| 0df3c7f2a0 | |||
| 7089237885 | |||
| 73fd498886 | |||
| 6270660611 | |||
| eaaa9bbda6 | |||
| e61a091ac1 | |||
| 7c7e807cb3 | |||
| 1d88ecc753 | |||
| 5ff38b0d07 | |||
| e3f9841f59 | |||
| 1de4548643 | |||
| fd114bd289 | |||
| b115d75a66 | |||
| 4f653a19c5 | |||
| 2fb08d3456 | |||
| 675446da32 | |||
| 3421566376 | |||
| 079c0c9d4a | |||
| a899e6ecc4 | |||
| 3fad98e8af | |||
| a2477fd349 | |||
| 5643db84c6 | |||
| 21efc3633e | |||
| d96d409df8 | |||
| 99c5eb4fd7 | |||
| 5162822914 | |||
| cf49790443 | |||
| 327054df45 | |||
| 6dbf66aa3e | |||
| e3af763d5e | |||
| b04a98f6c3 | |||
| 87f3d202a9 | |||
| eca626fcdb | |||
| eebd84eb94 | |||
| 5a030a540f | |||
| b129a447f3 | |||
| 65e08ee1d2 | |||
| 958dc6923d | |||
| 5cc2a2b8f8 | |||
| 34d4c9f566 | |||
| d05258ea2a | |||
| 0945eaface | |||
| 4b785f69c0 | |||
| 1b15a7159b | |||
| e3e3a15159 | |||
| 16974f80f9 | |||
| f9248a4311 | |||
| f422bcc7f9 | |||
| 8a8199e4a1 | |||
| 7554da4033 | |||
| 031cb743ae | |||
| 319afe3804 | |||
| 73095288da | |||
| 58c358753e | |||
| 833eb1d752 | |||
| 2cab0e1910 | |||
| f7c4ef23fa | |||
| 182707ac10 | |||
| c8b6fd59f0 | |||
| 235364e825 | |||
| 362a5c0b39 | |||
| ca82514bff | |||
| 414abe65f1 | |||
| 6cfc463126 | |||
| 031dd64ad7 | |||
| c85f864c35 | |||
| 75c997049e | |||
| 109b8c134c | |||
| 967b1a1814 | |||
| 7fe35f8735 | |||
| cab4040499 | |||
| 4dba9d1e2f | |||
| aedaad51cf | |||
| fbf66f9918 | |||
| 63e4344edc | |||
| dda39aeafc | |||
| 3129be9a78 | |||
| 7c8684761b | |||
| 32418b98a0 | |||
| abeb366f9f | |||
| 28f88ac8e7 | |||
| a6d11c71a0 | |||
| cf2ddc70a1 | |||
| 1ed1ccc2c3 | |||
| 4663f06f3e |
@@ -5,6 +5,7 @@ src/xxd/xxd
|
||||
src/auto/if_perl.c
|
||||
src/auto/gui_gtk_gresources.c
|
||||
src/auto/gui_gtk_gresources.h
|
||||
src/objects/.dirstamp
|
||||
src/tags
|
||||
|
||||
# We do need src/auto/configure.
|
||||
@@ -80,6 +81,7 @@ src/testdir/viminfo
|
||||
src/memfile_test
|
||||
src/json_test
|
||||
src/message_test
|
||||
src/kword_test
|
||||
|
||||
# From MacVim
|
||||
.*.swp
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ env:
|
||||
vi_cv_path_plain_lua=/usr/local/bin/lua
|
||||
vi_cv_dll_name_perl=/System/Library/Perl/5.16/darwin-thread-multi-2level/CORE/libperl.dylib
|
||||
vi_cv_dll_name_python=/System/Library/Frameworks/Python.framework/Versions/2.7/Python
|
||||
vi_cv_dll_name_python3=/usr/local/Frameworks/Python.framework/Versions/3.5/Python
|
||||
vi_cv_dll_name_python3=/usr/local/Frameworks/Python.framework/Versions/3.6/Python
|
||||
VIMCMD=src/MacVim/build/Release/MacVim.app/Contents/MacOS/Vim
|
||||
"CONFOPT='--with-features=huge --enable-multibyte --enable-netbeans --with-tlib=ncurses --enable-cscope --enable-perlinterp=dynamic --enable-pythoninterp=dynamic --enable-python3interp=dynamic --enable-rubyinterp=dynamic --enable-luainterp=dynamic --with-lua-prefix=/usr/local --enable-gui=macvim'"
|
||||
|
||||
|
||||
@@ -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,38 +1,13 @@
|
||||
README_mac.txt for version 8.0 of Vim: Vi IMproved.
|
||||
|
||||
This file explains the installation of MacVim.
|
||||
See "README.txt" for general information about Vim.
|
||||
See "src/MacVim/README" for an overview of the MacVim specific source code.
|
||||
|
||||
MacVim uses the usual configure/make steps to build the binary but instead of
|
||||
"make install" you just drag the app bundle into the directory you wish to
|
||||
install in (usually `/Applications').
|
||||
|
||||
|
||||
How to build and install
|
||||
How to install MacVim?
|
||||
========================
|
||||
|
||||
Run `./configure` in the `src/` directory with the flags you want (call
|
||||
`./configure --help` to see a list of flags) e.g.:
|
||||
Download MacVim.dmg from latest binary release page https://github.com/macvim-dev/macvim/releases/latest , open the dmg file, and copy MacVim.app to /Applications.
|
||||
|
||||
$ cd src
|
||||
$ ./configure --with-features=huge \
|
||||
--enable-rubyinterp \
|
||||
--enable-pythoninterp \
|
||||
--enable-perlinterp \
|
||||
--enable-cscope
|
||||
|
||||
Now build the project using `make`:
|
||||
Questions?
|
||||
========================
|
||||
|
||||
$ make
|
||||
Please take a look at the home page http://macvim-dev.github.io/macvim/
|
||||
|
||||
The resulting app bundle will reside under `MacVim/build/Release`. To try it
|
||||
out quickly, type:
|
||||
|
||||
$ open MacVim/build/Release/MacVim.app
|
||||
|
||||
To install MacVim, type
|
||||
|
||||
$ open MacVim/build/Release
|
||||
|
||||
and drag the MacVim icon into your `Applications` folder.
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
" Vim compiler file
|
||||
" Compiler: GHC Haskell Compiler
|
||||
" Maintainer: Daniel Campoverde <alx@sillybytes.net>
|
||||
" Latest Revision: 2016-11-29
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "ghc"
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
CompilerSet errorformat=
|
||||
\%-G%.%#:\ build,
|
||||
\%-G%.%#preprocessing\ library\ %.%#,
|
||||
\%-G[%.%#]%.%#,
|
||||
\%E%f:%l:%c:\ %m,
|
||||
\%-G--%.%#
|
||||
|
||||
if exists('g:compiler_ghc_ignore_unmatched_lines')
|
||||
CompilerSet errorformat+=%-G%.%#
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -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.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 8.0. Last change: 2016 Oct 02
|
||||
*change.txt* For Vim version 8.0. Last change: 2016 Nov 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -684,6 +684,7 @@ g& Synonym for `:%s//~/&` (repeat last substitute with
|
||||
*:s_flags*
|
||||
The flags that you can use for the substitute commands:
|
||||
|
||||
*:&&*
|
||||
[&] Must be the first one: Keep the flags from the previous substitute
|
||||
command. Examples: >
|
||||
:&&
|
||||
|
||||
+21
-7
@@ -1,4 +1,4 @@
|
||||
*channel.txt* For Vim version 8.0. Last change: 2016 Nov 07
|
||||
*channel.txt* For Vim version 8.0. Last change: 2016 Dec 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -155,7 +155,13 @@ Use |ch_status()| to see if the channel could be opened.
|
||||
func MyCloseHandler(channel)
|
||||
< Vim will invoke callbacks that handle data before invoking
|
||||
close_cb, thus when this function is called no more data will
|
||||
be received.
|
||||
be passed to the callbacks.
|
||||
*channel-drop*
|
||||
"drop" Specifies when to drop messages:
|
||||
"auto" When there is no callback to handle a message.
|
||||
The "close_cb" is also considered for this.
|
||||
"never" All messages will be kept.
|
||||
|
||||
*waittime*
|
||||
"waittime" The time to wait for the connection to be made in
|
||||
milliseconds. A negative number waits forever.
|
||||
@@ -418,7 +424,11 @@ This uses the channel timeout. To read without a timeout, just get any
|
||||
message that is available: >
|
||||
let output = ch_read(channel, {'timeout': 0})
|
||||
When no message was available then the result is v:none for a JSON or JS mode
|
||||
channels, an empty string for a RAW or NL channel.
|
||||
channels, an empty string for a RAW or NL channel. You can use |ch_canread()|
|
||||
to check if there is something to read.
|
||||
|
||||
Note that when there is no callback message are dropped. To avoid that add a
|
||||
close callback to the channel.
|
||||
|
||||
To read all output from a RAW channel that is available: >
|
||||
let output = ch_readraw(channel)
|
||||
@@ -534,7 +544,7 @@ You will want to do something more useful than "echomsg".
|
||||
|
||||
To start another process without creating a channel: >
|
||||
let job = job_start(command,
|
||||
\ {"in_io": "null", "out_io": "null", "err_io": "null"})
|
||||
\ {"in_io": "null", "out_io": "null", "err_io": "null"})
|
||||
|
||||
This starts {command} in the background, Vim does not wait for it to finish.
|
||||
|
||||
@@ -595,6 +605,10 @@ See |job_setoptions()| and |ch_setoptions()|.
|
||||
*job-close_cb*
|
||||
"close_cb": handler Callback for when the channel is closed. Same as
|
||||
"close_cb" on |ch_open()|, see |close_cb|.
|
||||
*job-drop*
|
||||
"drop" Specifies when to drop messages. Same as "drop" on
|
||||
|ch_open()|, see |channel-drop|. For "auto" the
|
||||
exit_cb is not considered.
|
||||
*job-exit_cb*
|
||||
"exit_cb": handler Callback for when the job ends. The arguments are the
|
||||
job and the exit status.
|
||||
@@ -629,7 +643,7 @@ See |job_setoptions()| and |ch_setoptions()|.
|
||||
"channel": {channel} Use an existing channel instead of creating a new one.
|
||||
The parts of the channel that get used for the new job
|
||||
will be disconnected from what they were used before.
|
||||
If the channel was still use by another job this may
|
||||
If the channel was still used by another job this may
|
||||
cause I/O errors.
|
||||
Existing callbacks and other settings remain.
|
||||
|
||||
@@ -647,7 +661,7 @@ See |job_setoptions()| and |ch_setoptions()|.
|
||||
"out_io": "null" disconnect stdout (goes to /dev/null)
|
||||
"out_io": "pipe" stdout is connected to the channel (default)
|
||||
"out_io": "file" stdout writes to a file
|
||||
"out_io": "buffer" stdout appends to a buffer (see below)
|
||||
"out_io": "buffer" stdout appends to a buffer (see below)
|
||||
"out_name": "/path/file" the name of the file or buffer to write to
|
||||
"out_buf": number the number of the buffer to write to
|
||||
"out_modifiable": 0 when writing to a buffer, 'modifiable' will be off
|
||||
@@ -660,7 +674,7 @@ See |job_setoptions()| and |ch_setoptions()|.
|
||||
"err_io": "null" disconnect stderr (goes to /dev/null)
|
||||
"err_io": "pipe" stderr is connected to the channel (default)
|
||||
"err_io": "file" stderr writes to a file
|
||||
"err_io": "buffer" stderr appends to a buffer (see below)
|
||||
"err_io": "buffer" stderr appends to a buffer (see below)
|
||||
"err_name": "/path/file" the name of the file or buffer to write to
|
||||
"err_buf": number the number of the buffer to write to
|
||||
"err_modifiable": 0 when writing to a buffer, 'modifiable' will be off
|
||||
|
||||
@@ -359,8 +359,11 @@ terminals)
|
||||
List entries 6 to 12 from the search history: >
|
||||
:history / 6,12
|
||||
<
|
||||
List the recent five entries from all histories: >
|
||||
:history all -5,
|
||||
List the penultimate entry from all histories: >
|
||||
:history all -2
|
||||
<
|
||||
List the most recent two entries from all histories: >
|
||||
:history all -2,
|
||||
|
||||
:keepp[atterns] {command} *:keepp* *:keeppatterns*
|
||||
Execute {command}, without adding anything to the search
|
||||
@@ -1057,10 +1060,10 @@ There are several ways to leave the command-line window:
|
||||
Insert and in Normal mode.
|
||||
CTRL-C Continue in Command-line mode. The command-line under the
|
||||
cursor is used as the command-line. Works both in Insert and
|
||||
in Normal mode. ":close" also works. There is no redraw,
|
||||
thus the window will remain visible.
|
||||
in Normal mode. There is no redraw, thus the window will
|
||||
remain visible.
|
||||
:quit Discard the command line and go back to Normal mode.
|
||||
":exit", ":xit" and CTRL-\ CTRL-N also work.
|
||||
":close", ":exit", ":xit" and CTRL-\ CTRL-N also work.
|
||||
:qall Quit Vim, unless there are changes in some buffer.
|
||||
:qall! Quit Vim, discarding changes to any buffer.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*develop.txt* For Vim version 8.0. Last change: 2016 Jan 31
|
||||
*develop.txt* For Vim version 8.0. Last change: 2017 Jan 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -177,7 +177,7 @@ The basic steps to make changes to the code:
|
||||
5. Make a patch with "git diff". You can also create a pull request on
|
||||
github, but it's the diff that matters.
|
||||
6. Make a note about what changed, preferably mentioning the problem and the
|
||||
solution. Send an email to the vim-dev maillist with an explanation and
|
||||
solution. Send an email to the |vim-dev| maillist with an explanation and
|
||||
include the diff. Or create a pull request on github.
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 8.0. Last change: 2016 Sep 27
|
||||
*editing.txt* For Vim version 8.0. Last change: 2016 Nov 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -977,12 +977,12 @@ WRITING WITH MULTIPLE BUFFERS *buffer-write*
|
||||
|
||||
*:wa* *:wall*
|
||||
:wa[ll] Write all changed buffers. Buffers without a file
|
||||
name or which are readonly are not written. {not in
|
||||
Vi}
|
||||
name cause an error message. Buffers which are
|
||||
readonly are not written. {not in Vi}
|
||||
|
||||
:wa[ll]! Write all changed buffers, even the ones that are
|
||||
readonly. Buffers without a file name are not
|
||||
written. {not in Vi}
|
||||
written and cause an error message. {not in Vi}
|
||||
|
||||
|
||||
Vim will warn you if you try to overwrite a file that has been changed
|
||||
|
||||
+76
-30
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.0. Last change: 2016 Nov 04
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -2009,6 +2009,7 @@ byteidxcomp({expr}, {nr}) Number byte index of {nr}'th char in {expr}
|
||||
call({func}, {arglist} [, {dict}])
|
||||
any call {func} with arguments {arglist}
|
||||
ceil({expr}) Float round {expr} up
|
||||
ch_canread({handle}) Number check if there is something to read
|
||||
ch_close({handle}) none close {handle}
|
||||
ch_close_in({handle}) none close in part of {handle}
|
||||
ch_evalexpr({handle}, {expr} [, {options}])
|
||||
@@ -2221,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
|
||||
@@ -2238,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}]])
|
||||
@@ -2980,16 +2982,28 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
|
||||
don't fit, a vertical layout is used anyway. For some systems
|
||||
the horizontal layout is always used.
|
||||
|
||||
ch_canread({handle}) *ch_canread()*
|
||||
Return non-zero when there is something to read from {handle}.
|
||||
{handle} can be a Channel or a Job that has a Channel.
|
||||
|
||||
This is useful to read from a channel at a convenient time,
|
||||
e.g. from a timer.
|
||||
|
||||
Note that messages are dropped when the channel does not have
|
||||
a callback. Add a close callback to avoid that.
|
||||
|
||||
{only available when compiled with the |+channel| feature}
|
||||
|
||||
ch_close({handle}) *ch_close()*
|
||||
Close {handle}. See |channel-close|.
|
||||
{handle} can be Channel or a Job that has a Channel.
|
||||
{handle} can be a Channel or a Job that has a Channel.
|
||||
A close callback is not invoked.
|
||||
|
||||
{only available when compiled with the |+channel| feature}
|
||||
|
||||
ch_close_in({handle}) *ch_close_in()*
|
||||
Close the "in" part of {handle}. See |channel-close-in|.
|
||||
{handle} can be Channel or a Job that has a Channel.
|
||||
{handle} can be a Channel or a Job that has a Channel.
|
||||
A close callback is not invoked.
|
||||
|
||||
{only available when compiled with the |+channel| feature}
|
||||
@@ -2998,7 +3012,7 @@ ch_evalexpr({handle}, {expr} [, {options}]) *ch_evalexpr()*
|
||||
Send {expr} over {handle}. The {expr} is encoded
|
||||
according to the type of channel. The function cannot be used
|
||||
with a raw channel. See |channel-use|.
|
||||
{handle} can be Channel or a Job that has a Channel.
|
||||
{handle} can be a Channel or a Job that has a Channel.
|
||||
*E917*
|
||||
{options} must be a Dictionary. It must not have a "callback"
|
||||
entry. It can have a "timeout" entry to specify the timeout
|
||||
@@ -3012,7 +3026,7 @@ ch_evalexpr({handle}, {expr} [, {options}]) *ch_evalexpr()*
|
||||
|
||||
ch_evalraw({handle}, {string} [, {options}]) *ch_evalraw()*
|
||||
Send {string} over {handle}.
|
||||
{handle} can be Channel or a Job that has a Channel.
|
||||
{handle} can be a Channel or a Job that has a Channel.
|
||||
|
||||
Works like |ch_evalexpr()|, but does not encode the request or
|
||||
decode the response. The caller is responsible for the
|
||||
@@ -3025,7 +3039,7 @@ ch_evalraw({handle}, {string} [, {options}]) *ch_evalraw()*
|
||||
|
||||
ch_getbufnr({handle}, {what}) *ch_getbufnr()*
|
||||
Get the buffer number that {handle} is using for {what}.
|
||||
{handle} can be Channel or a Job that has a Channel.
|
||||
{handle} can be a Channel or a Job that has a Channel.
|
||||
{what} can be "err" for stderr, "out" for stdout or empty for
|
||||
socket output.
|
||||
Returns -1 when there is no buffer.
|
||||
@@ -3071,7 +3085,7 @@ ch_log({msg} [, {handle}]) *ch_log()*
|
||||
|ch_logfile()|.
|
||||
When {handle} is passed the channel number is used for the
|
||||
message.
|
||||
{handle} can be Channel or a Job that has a Channel. The
|
||||
{handle} can be a Channel or a Job that has a Channel. The
|
||||
Channel must be open for the channel number to be used.
|
||||
|
||||
ch_logfile({fname} [, {mode}]) *ch_logfile()*
|
||||
@@ -3099,7 +3113,7 @@ ch_open({address} [, {options}]) *ch_open()*
|
||||
|
||||
ch_read({handle} [, {options}]) *ch_read()*
|
||||
Read from {handle} and return the received message.
|
||||
{handle} can be Channel or a Job that has a Channel.
|
||||
{handle} can be a Channel or a Job that has a Channel.
|
||||
See |channel-more|.
|
||||
{only available when compiled with the |+channel| feature}
|
||||
|
||||
@@ -3113,7 +3127,7 @@ ch_sendexpr({handle}, {expr} [, {options}]) *ch_sendexpr()*
|
||||
according to the type of channel. The function cannot be used
|
||||
with a raw channel.
|
||||
See |channel-use|. *E912*
|
||||
{handle} can be Channel or a Job that has a Channel.
|
||||
{handle} can be a Channel or a Job that has a Channel.
|
||||
|
||||
{only available when compiled with the |+channel| feature}
|
||||
|
||||
@@ -3134,7 +3148,7 @@ ch_setoptions({handle}, {options}) *ch_setoptions()*
|
||||
"timeout" default read timeout in msec
|
||||
"mode" mode for the whole channel
|
||||
See |ch_open()| for more explanation.
|
||||
{handle} can be Channel or a Job that has a Channel.
|
||||
{handle} can be a Channel or a Job that has a Channel.
|
||||
|
||||
Note that changing the mode may cause queued messages to be
|
||||
lost.
|
||||
@@ -3148,7 +3162,7 @@ ch_status({handle} [, {options}]) *ch_status()*
|
||||
"open" channel can be used
|
||||
"buffered" channel can be read, not written to
|
||||
"closed" channel can not be used
|
||||
{handle} can be Channel or a Job that has a Channel.
|
||||
{handle} can be a Channel or a Job that has a Channel.
|
||||
"buffered" is used when the channel was closed but there is
|
||||
still data that can be obtained with |ch_read()|.
|
||||
|
||||
@@ -4158,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.
|
||||
@@ -5216,6 +5234,7 @@ join({list} [, {sep}]) *join()*
|
||||
js_decode({string}) *js_decode()*
|
||||
This is similar to |json_decode()| with these differences:
|
||||
- Object key names do not have to be in quotes.
|
||||
- Strings can be in single quotes.
|
||||
- Empty items in an array (between two commas) are allowed and
|
||||
result in v:none items.
|
||||
|
||||
@@ -5242,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.
|
||||
@@ -5781,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}]])
|
||||
@@ -5824,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
|
||||
@@ -6148,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:
|
||||
@@ -6774,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
|
||||
@@ -7235,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'.
|
||||
|
||||
@@ -7548,7 +7586,11 @@ system({expr} [, {input}]) *system()* *E677*
|
||||
If {input} is given and is a |List| it is written to the file
|
||||
in a way |writefile()| does with {binary} set to "b" (i.e.
|
||||
with a newline between each list item with newlines inside
|
||||
list items converted to NULs).
|
||||
list items converted to NULs).
|
||||
When {input} is given and is a number that is a valid id for
|
||||
an existing buffer then the content of the buffer is written
|
||||
to the file line by line, each line terminated by a NL and
|
||||
NULs characters where the text has a NL.
|
||||
|
||||
Pipes are not used, the 'shelltemp' option is not used.
|
||||
|
||||
@@ -7598,7 +7640,8 @@ systemlist({expr} [, {input}]) *systemlist()*
|
||||
Same as |system()|, but returns a |List| with lines (parts of
|
||||
output separated by NL) with NULs transformed into NLs. Output
|
||||
is the same as |readfile()| will output with {binary} argument
|
||||
set to "b".
|
||||
set to "b". Note that on MS-Windows you may get trailing CR
|
||||
characters.
|
||||
|
||||
Returns an empty string on error.
|
||||
|
||||
@@ -8115,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
|
||||
@@ -8385,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.
|
||||
@@ -8420,6 +8464,8 @@ timers Compiled with |timer_start()| support.
|
||||
title Compiled with window title support |'title'|.
|
||||
toolbar Compiled with support for |gui-toolbar|.
|
||||
transparency Compiled with 'transparency' support.
|
||||
ttyin input is a terminal (tty)
|
||||
ttyout output is a terminal (tty)
|
||||
unix Unix version of Vim.
|
||||
user_commands User-defined commands.
|
||||
vertsplit Compiled with vertically split windows |:vsplit|.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*filetype.txt* For Vim version 8.0. Last change: 2016 Sep 09
|
||||
*filetype.txt* For Vim version 8.0. Last change: 2017 Jan 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -573,6 +573,8 @@ Man {number} {name}
|
||||
|
||||
Global mapping:
|
||||
<Leader>K Displays the manual page for the word under the cursor.
|
||||
<Plug>ManPreGetPage idem, allows for using a mapping: >
|
||||
nmap <F1> <Plug>ManPreGetPage<CR>
|
||||
|
||||
Local mappings:
|
||||
CTRL-] Jump to the manual page for the word under the cursor.
|
||||
|
||||
+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
|
||||
|
||||
@@ -96,21 +96,18 @@ mention that.
|
||||
|
||||
*mail-list* *maillist*
|
||||
There are several mailing lists for Vim:
|
||||
<vim@vim.org>
|
||||
<vim@vim.org> *vim-use* *vim_use*
|
||||
For discussions about using existing versions of Vim: Useful mappings,
|
||||
questions, answers, where to get a specific version, etc. There are
|
||||
quite a few people watching this list and answering questions, also
|
||||
for beginners. Don't hesitate to ask your question here.
|
||||
<vim-dev@vim.org> *vim-dev* *vimdev*
|
||||
<vim-dev@vim.org> *vim-dev* *vim_dev* *vimdev*
|
||||
For discussions about changing Vim: New features, porting, patches,
|
||||
beta-test versions, etc.
|
||||
<vim-announce@vim.org> *vim-announce*
|
||||
<vim-announce@vim.org> *vim-announce* *vim_announce*
|
||||
Announcements about new versions of Vim; also for beta-test versions
|
||||
and ports to different systems. This is a read-only list.
|
||||
<vim-multibyte@vim.org> *vim-multibyte*
|
||||
For discussions about using and improving the multi-byte aspects of
|
||||
Vim.
|
||||
<vim-mac@vim.org> *vim-mac*
|
||||
<vim-mac@vim.org> *vim-mac* *vim_mac*
|
||||
For discussions about using and improving the Macintosh version of
|
||||
Vim.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*message.txt* For Vim version 8.0. Last change: 2016 Sep 01
|
||||
*message.txt* For Vim version 8.0. Last change: 2017 Jan 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -129,8 +129,9 @@ closed properly. Mostly harmless.
|
||||
Command too recursive
|
||||
|
||||
This happens when an Ex command executes an Ex command that executes an Ex
|
||||
command, etc. This is only allowed 200 times. When it's more there probably
|
||||
is an endless loop. Probably a |:execute| or |:source| command is involved.
|
||||
command, etc. The limit is 200 or the value of 'maxfuncdepth', whatever is
|
||||
larger. When it's more there probably is an endless loop. Probably a
|
||||
|:execute| or |:source| command is involved.
|
||||
|
||||
*E254* >
|
||||
Cannot allocate color {name}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*motion.txt* For Vim version 8.0. Last change: 2016 Jul 12
|
||||
*motion.txt* For Vim version 8.0. Last change: 2016 Nov 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -915,6 +915,7 @@ was made yet in the current file.
|
||||
then the position can be near the end of what the
|
||||
command changed. For example when inserting a word,
|
||||
the position will be on the last character.
|
||||
To jump to older changes use |g;|.
|
||||
{not in Vi}
|
||||
|
||||
*'(* *`(*
|
||||
|
||||
+71
-5
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.0. Last change: 2016 Oct 12
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -242,7 +242,7 @@ opt+=val" the expansion is done before the adding or removing.
|
||||
Handling of local options *local-options*
|
||||
|
||||
Some of the options only apply to a window or buffer. Each window or buffer
|
||||
has its own copy of this option, thus can each have their own value. This
|
||||
has its own copy of this option, thus each can have its own value. This
|
||||
allows you to set 'list' in one window but not in another. And set
|
||||
'shiftwidth' to 3 in one buffer and 4 in another.
|
||||
|
||||
@@ -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
|
||||
@@ -3984,6 +3984,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
The format of this option is like that of 'statusline'.
|
||||
'guitabtooltip' is used for the tooltip, see below.
|
||||
The expression will be evaluated in the |sandbox| when set from a
|
||||
modeline, see |sandbox-option|.
|
||||
|
||||
Only used when the GUI tab pages line is displayed. 'e' must be
|
||||
present in 'guioptions'. For the non-GUI tab pages line 'tabline' is
|
||||
@@ -5171,6 +5173,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
catches endless recursion. When using a recursive function with
|
||||
more depth, set 'maxfuncdepth' to a bigger number. But this will use
|
||||
more memory, there is the danger of failing when memory is exhausted.
|
||||
Increasing this limit above 200 also changes the maximum for Ex
|
||||
command resursion, see |E169|.
|
||||
See also |:function|.
|
||||
|
||||
*'maxmapdepth'* *'mmd'* *E223*
|
||||
@@ -5292,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)
|
||||
@@ -5851,6 +5855,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
and |+postscript| features}
|
||||
Expression used to print the PostScript produced with |:hardcopy|.
|
||||
See |pexpr-option|.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'printfont'* *'pfn'*
|
||||
'printfont' 'pfn' string (default "courier")
|
||||
@@ -5921,6 +5927,21 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
DYNAMIC_PYTHON_DLL, which was specified at compile time.
|
||||
Environment variables are expanded |:set_env|.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'pythonhome'*
|
||||
'pythonhome' string (default "")
|
||||
global
|
||||
{not in Vi}
|
||||
{only available when compiled with the |+python/dyn|
|
||||
feature}
|
||||
Note: EXPERIMENTAL. It may be changed or removed in the future.
|
||||
Specifies the name of the Python 2.x home directory. When 'pythonhome'
|
||||
and the PYTHONHOME environment variable are not set, PYTHON_HOME,
|
||||
which was specified at compile time, will be used for the Python 2.x
|
||||
home directory.
|
||||
Environment variables are expanded |:set_env|.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'pythonthreedll'*
|
||||
@@ -5932,6 +5953,50 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Specifies the name of the Python 3 shared library. The default is
|
||||
DYNAMIC_PYTHON3_DLL, which was specified at compile time.
|
||||
Environment variables are expanded |:set_env|.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'pythonthreehome'*
|
||||
'pythonthreehome' string (default "")
|
||||
global
|
||||
{not in Vi}
|
||||
{only available when compiled with the |+python3/dyn|
|
||||
feature}
|
||||
Note: EXPERIMENTAL. It may be changed or removed in the future.
|
||||
Specifies the name of the Python 3 home directory. When
|
||||
'pythonthreehome' and the PYTHONHOME environment variable are not set,
|
||||
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.
|
||||
|
||||
@@ -5955,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)
|
||||
@@ -7973,7 +8039,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Amiga console, Win32 console, all GUI versions and terminals with a
|
||||
non-empty 't_ts' option).
|
||||
When Vim was compiled with HAVE_X11 defined, the original title will
|
||||
be restored if possible |X11|.
|
||||
be restored if possible, see |X11|.
|
||||
When this option contains printf-style '%' items, they will be
|
||||
expanded according to the rules used for 'statusline'.
|
||||
Example: >
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*logiPat.txt* Logical Patterns Jun 22, 2015
|
||||
*pi_logipat.txt* Logical Patterns Jun 22, 2015
|
||||
|
||||
Author: Charles E. Campbell <NdrOchip@ScampbellPfamily.AbizM>
|
||||
Copyright: (c) 2004-2015 by Charles E. Campbell *logiPat-copyright*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickref.txt* For Vim version 8.0. Last change: 2016 Aug 21
|
||||
*quickref.txt* For Vim version 8.0. Last change: 2016 Dec 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -840,7 +840,10 @@ Short explanation of each option: *option-list*
|
||||
'prompt' 'prompt' enable prompt in Ex mode
|
||||
'pumheight' 'ph' maximum height of the popup menu
|
||||
'pythondll' name of the Python 2 dynamic library
|
||||
'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
|
||||
@@ -1074,6 +1077,8 @@ Short explanation of each option: *option-list*
|
||||
|c_<Up>| <Up>/<Down> recall older/newer command-line that starts
|
||||
with current command
|
||||
|c_<S-Up>| <S-Up>/<S-Down> recall older/newer command-line from history
|
||||
|c_CTRL-G| CTRL-G next match when 'incsearch' is active
|
||||
|c_CTRL-T| CTRL-T previous match when 'incsearch' is active
|
||||
|:history| :his[tory] show older command-lines
|
||||
|
||||
Context-sensitive completion on the command-line:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*starting.txt* For Vim version 8.0. Last change: 2016 Sep 09
|
||||
*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
|
||||
@@ -421,6 +422,10 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
|
||||
not connected to a terminal. This will avoid the warning and
|
||||
the two second delay that would happen. {not in Vi}
|
||||
|
||||
*--ttyfail*
|
||||
--ttyfail When the stdin or stdout is not a terminal (tty) then exit
|
||||
right away.
|
||||
|
||||
*-d*
|
||||
-d Start in diff mode, like |vimdiff|.
|
||||
{not in Vi} {not available when compiled without the |+diff|
|
||||
@@ -1216,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*
|
||||
|
||||
|
||||
+32
-2
@@ -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'*
|
||||
@@ -1378,6 +1382,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
--servername remote.txt /*--servername*
|
||||
--socketid starting.txt /*--socketid*
|
||||
--startuptime starting.txt /*--startuptime*
|
||||
--ttyfail starting.txt /*--ttyfail*
|
||||
--version starting.txt /*--version*
|
||||
--windowid starting.txt /*--windowid*
|
||||
-A starting.txt /*-A*
|
||||
@@ -1865,6 +1870,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:$ cmdline.txt /*:$*
|
||||
:% cmdline.txt /*:%*
|
||||
:& change.txt /*:&*
|
||||
:&& change.txt /*:&&*
|
||||
:' cmdline.txt /*:'*
|
||||
:, cmdline.txt /*:,*
|
||||
:. cmdline.txt /*:.*
|
||||
@@ -2745,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*
|
||||
@@ -4537,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*
|
||||
@@ -4819,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*
|
||||
@@ -5302,6 +5316,7 @@ catch-text eval.txt /*catch-text*
|
||||
cc change.txt /*cc*
|
||||
ceil() eval.txt /*ceil()*
|
||||
ch.vim syntax.txt /*ch.vim*
|
||||
ch_canread() eval.txt /*ch_canread()*
|
||||
ch_close() eval.txt /*ch_close()*
|
||||
ch_close_in() eval.txt /*ch_close_in()*
|
||||
ch_evalexpr() eval.txt /*ch_evalexpr()*
|
||||
@@ -5349,6 +5364,7 @@ channel-close channel.txt /*channel-close*
|
||||
channel-close-in channel.txt /*channel-close-in*
|
||||
channel-commands channel.txt /*channel-commands*
|
||||
channel-demo channel.txt /*channel-demo*
|
||||
channel-drop channel.txt /*channel-drop*
|
||||
channel-functions usr_41.txt /*channel-functions*
|
||||
channel-mode channel.txt /*channel-mode*
|
||||
channel-more channel.txt /*channel-more*
|
||||
@@ -6658,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()*
|
||||
@@ -7021,6 +7038,7 @@ job-callback channel.txt /*job-callback*
|
||||
job-channel-overview channel.txt /*job-channel-overview*
|
||||
job-close_cb channel.txt /*job-close_cb*
|
||||
job-control channel.txt /*job-control*
|
||||
job-drop channel.txt /*job-drop*
|
||||
job-err_cb channel.txt /*job-err_cb*
|
||||
job-err_io channel.txt /*job-err_io*
|
||||
job-exit_cb channel.txt /*job-exit_cb*
|
||||
@@ -7156,7 +7174,6 @@ logiPat-man pi_logipat.txt /*logiPat-man*
|
||||
logiPat-manual pi_logipat.txt /*logiPat-manual*
|
||||
logiPat-operators pi_logipat.txt /*logiPat-operators*
|
||||
logiPat-pattern pi_logipat.txt /*logiPat-pattern*
|
||||
logiPat.txt pi_logipat.txt /*logiPat.txt*
|
||||
long-lines version5.txt /*long-lines*
|
||||
love intro.txt /*love*
|
||||
lowercase change.txt /*lowercase*
|
||||
@@ -7873,6 +7890,7 @@ php3.vim syntax.txt /*php3.vim*
|
||||
phtml.vim syntax.txt /*phtml.vim*
|
||||
pi_getscript.txt pi_getscript.txt /*pi_getscript.txt*
|
||||
pi_gzip.txt pi_gzip.txt /*pi_gzip.txt*
|
||||
pi_logipat.txt pi_logipat.txt /*pi_logipat.txt*
|
||||
pi_netrw.txt pi_netrw.txt /*pi_netrw.txt*
|
||||
pi_paren.txt pi_paren.txt /*pi_paren.txt*
|
||||
pi_spec.txt pi_spec.txt /*pi_spec.txt*
|
||||
@@ -7990,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:*
|
||||
@@ -8532,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*
|
||||
@@ -8570,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*
|
||||
@@ -9215,16 +9241,19 @@ vim-dev intro.txt /*vim-dev*
|
||||
vim-mac intro.txt /*vim-mac*
|
||||
vim-modes intro.txt /*vim-modes*
|
||||
vim-modes-intro intro.txt /*vim-modes-intro*
|
||||
vim-multibyte intro.txt /*vim-multibyte*
|
||||
vim-script-intro usr_41.txt /*vim-script-intro*
|
||||
vim-use intro.txt /*vim-use*
|
||||
vim-variable eval.txt /*vim-variable*
|
||||
vim.vim syntax.txt /*vim.vim*
|
||||
vim7 version7.txt /*vim7*
|
||||
vim8 version8.txt /*vim8*
|
||||
vim: options.txt /*vim:*
|
||||
vim_announce intro.txt /*vim_announce*
|
||||
vim_dev intro.txt /*vim_dev*
|
||||
vim_did_enter-variable eval.txt /*vim_did_enter-variable*
|
||||
vim_mac gui_mac.txt /*vim_mac*
|
||||
vim_starting eval.txt /*vim_starting*
|
||||
vim_use intro.txt /*vim_use*
|
||||
vimball pi_vimball.txt /*vimball*
|
||||
vimball-contents pi_vimball.txt /*vimball-contents*
|
||||
vimball-extract pi_vimball.txt /*vimball-extract*
|
||||
@@ -9418,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".
|
||||
|
||||
+119
-79
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.0. Last change: 2016 Nov 17
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -29,32 +29,21 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
|
||||
|
||||
Issues can also be entered online: https://github.com/vim/vim/issues
|
||||
Only use this for bug reports, not for questions! Those belong on the
|
||||
maillist. Updates will be forwarded to the vim_dev maillist. Issues entered
|
||||
there will not be repeated below, unless there is extra information.
|
||||
maillist. Updates will be forwarded to the |vim_dev| maillist. Issues
|
||||
entered there will not be repeated below, unless there is extra information.
|
||||
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Test_help_complete sometimes fails on MS-Windows:
|
||||
function RunTheTest[9]..Test_help_complete line 22: Expected ['h test-char@ab',
|
||||
'h test-char@en', 'h test-col@ab', 'h test-col@en'] but got ['h test-char@en', '
|
||||
h test-char@en\t', 'h test-col@ab', 'h test-col@en']
|
||||
Appears to be related to calling feedkeys() with exactly 8 characters.
|
||||
|
||||
Patch for GTK3: Kazunobu Kuriyama, 14 Nov.
|
||||
|
||||
Patch for fix breakindent bug (Christian, Nov 15)
|
||||
|
||||
+channel:
|
||||
- Skip checking if job ended if there aren't any. (ichizok, 2016 Nov 7, #1196)
|
||||
- problem with channel callback getting job, while the job was already
|
||||
deleted. #1242. Fix in #1245 (ichizok), but is that correct?
|
||||
Perhaps just replace job_still_alive() with job_still_useful()?
|
||||
That's not sufficient.
|
||||
- Try out background make plugin:
|
||||
https://github.com/AndrewVos/vim-make-background
|
||||
- Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026)
|
||||
- Add 'cwd' argument to start_job(): directory to change to in the child.
|
||||
check for valid directory before forking.
|
||||
Part of patch for environment, Yasuhiro Matsumoto, #1160
|
||||
- When out_cb executes :sleep, the close_cb may be invoked. (Daniel Hahler,
|
||||
2016 Dec 11, #1320)
|
||||
- Implement |job-term| ?
|
||||
- Channel test fails with Motif. Sometimes kills the X11 server.
|
||||
- When a message in the queue but there is no callback, drop it after a while?
|
||||
@@ -69,6 +58,7 @@ Patch for fix breakindent bug (Christian, Nov 15)
|
||||
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.
|
||||
@@ -85,8 +75,8 @@ Regexp problems:
|
||||
- Issue 164: freeze on regexp search.
|
||||
- Ignorecase not handled properly for multi-byte characters. (Axel Bender,
|
||||
2013 Dec 11)
|
||||
- Using \@> and \?. (Brett Stahlman, 2013 Dec 21) Remark from Marcin Szamotulski
|
||||
Remark from Brett 2014 Jan 6 and 7.
|
||||
- Using \@> and \?. (Brett Stahlman, 2013 Dec 21) Remark from Marcin
|
||||
Szamotulski; Remark from Brett 2014 Jan 6 and 7.
|
||||
- NFA regexp doesn't handle \%<v correctly. (Ingo Karkat, 2014 May 12)
|
||||
- Does not work with NFA regexp engine:
|
||||
\%u, \%x, \%o, \%d followed by a composing character
|
||||
@@ -115,59 +105,85 @@ Regexp problems:
|
||||
- Difference between two engines: ".*\zs\/\@>\/" on text "///"
|
||||
(Chris Paul, 2016 Nov 13) New engine not greedy enough?
|
||||
|
||||
Patch to support nested namespace syntax. (Pauli, 2016 Oct 30, #1214)
|
||||
'] mark invalid after undoing insert "hello".
|
||||
|
||||
Patch to fix popup menu positioning. (Hirohito Higashi, 2016 Nov 7, #1241)
|
||||
|
||||
Patch to make help tag jumps keep language. (Tatsuki, #1249)
|
||||
Test by Hirohito Higashi.
|
||||
|
||||
Make html indent file use javascript indent, now that it's not just cindent.
|
||||
#1220
|
||||
|
||||
Patch to use buffer id for system() and systemlist() (LemonBoy, 2016 Nov 7,
|
||||
#1240)
|
||||
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?
|
||||
|
||||
Bug: ":earlier 100d" doesn't work after using undo file.
|
||||
(Pavol Juhas, 2016 Nov 15, #1254)
|
||||
Fix by Christian, but lacks a test.
|
||||
|
||||
Bug: Json with same key should not give internal error. (Lcd, 2016 Oct 26)
|
||||
Make dict_add give a duplicate key error.
|
||||
|
||||
Should json_encode()/json_decode() restrict recursiveness?
|
||||
Or avoid recursiveness.
|
||||
|
||||
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)
|
||||
Multi-byte bug: dv} splits char. (Urtica Dioica, 2017 Jan 9)
|
||||
|
||||
Patch to deal with changed configure events in GTK 3. (Jan Alexander Steffens,
|
||||
2016 Oct 23 #1193)
|
||||
Remarks from nuko8, 2016 Nov 2.
|
||||
Patch: Make mode() return "ix" or "Rx" when in completion mode.
|
||||
(Yegappan Lakshmanan, 2017 Jan 19, #1397, update Jan 22)
|
||||
|
||||
With Visual selection of a multi-byte character the '] mark is on the last
|
||||
byte, should be first byte?
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
|
||||
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/5737#issuecomment-266055165
|
||||
|
||||
Patch for better explanation of 'compatible' side effects.
|
||||
https://github.com/vim/vim/pull/1161/files
|
||||
|
||||
Patch to add 'makeencoding', useful when the system encoding differs from
|
||||
Vim's 'encoding' setting. (Ken Takata, 2017 Jan 6)
|
||||
|
||||
Patch to adjust marks when adding a new line to the end of buffer in diff
|
||||
mode. (James McCoy, 2016 Dec 14, #1329)
|
||||
|
||||
Suggestion to improve pt-br spell checking. (Marcelo D Montu, 2016 Dec 15,
|
||||
#1330)
|
||||
|
||||
Error in test_startup_utf8 on Solaris. (Danek Duvall, 2016 Aug 17)
|
||||
|
||||
Rule to use "^" for statusline does not work if a space is defined with
|
||||
highlighting for both stl and stlnc. Patch by Ken Hamada (itchyny, 2016 Dec 11)
|
||||
|
||||
8 "stl" and "stlnc" in 'fillchars' don't work for multi-byte characters.
|
||||
Patch by Christian Wellenbrock, 2013 Jul 5.
|
||||
|
||||
Screen updated delayed when using CTRL-O u in Insert mode.
|
||||
(Barlik, #1191) Perhaps because status message?
|
||||
|
||||
Patch to add buffer name argument to taglist().
|
||||
Ordering of tags in result of taglist call. (Duncan McDougall, #1194)
|
||||
|
||||
Patch to fix that empty first tab is not in session.
|
||||
(Hirohito Higashi, 2016 Nov 25, #1282)
|
||||
|
||||
Patch for restoring wide characters in the console buffer.
|
||||
(Ken Takata, 2016 Jun 7)
|
||||
|
||||
Patch to fix escaping of job arguments. (Yasuhiro Matsumoto, 2016 Oct 5)
|
||||
Update Oct 14: https://gist.github.com/mattn/d47e7d3bfe5ade4be86062b565a4bfca
|
||||
|
||||
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
|
||||
@@ -175,18 +191,28 @@ 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.
|
||||
|
||||
Patch to make v:shell_error writable. (Christian Brabandt, 2016 Sep 27)
|
||||
Is there another solution?
|
||||
Useful to restore it. Is there another solution?
|
||||
|
||||
"ci[" does not look for next [ like ci" does look for next ".
|
||||
(J.F. 2017 Jan 7)
|
||||
|
||||
On MS-Windows with 'clipboard' set to "unnamed" this doesn't work to double
|
||||
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)
|
||||
|
||||
When adding an item to a new quickfix list make ":cnext" jump to that item.
|
||||
Make a difference being at the first item and not having used :cnext at all.
|
||||
(Afanasiy Fet, 2017 Jan 3)
|
||||
|
||||
Invalid behavior with NULL list. (Nikolai Pavlov, #768)
|
||||
E.g. deepcopy(test_null_list())
|
||||
|
||||
@@ -195,6 +221,16 @@ 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)
|
||||
|
||||
On Windows buffer completion sees backslash as escape char instead of path
|
||||
separator. (Toffanim, 2016 Nov 24, #1274)
|
||||
|
||||
min() and max() spawn lots of error messages if sorted list/dictionary
|
||||
contains invalid data (Nikolay Pavlov, 2016 Sep 4, #1039)
|
||||
|
||||
@@ -212,6 +248,9 @@ sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep
|
||||
|
||||
Patch to add "cmdline" completion to getcompletion(). (Shougo, Oct 1, #1140)
|
||||
|
||||
Feature request: Complete members of a dictionary. (Luc Hermitte, 2017 Jan 4,
|
||||
#1350)
|
||||
|
||||
Patch for systemlist(), add empty item. (thinca, Sep 30, #1135)
|
||||
Add an argument to choose binary or non-binary (like readfile()), when omitted
|
||||
use the current behavior.
|
||||
@@ -234,12 +273,10 @@ execute() cannot be used with command completeion. (Daniel Hahler, 2016 Oct 1,
|
||||
|
||||
cmap using execute() has side effects. (Killthemule, 2016 Aug 17, #983)
|
||||
|
||||
Patch to change order of compiler flags. (Yousong Zhou, 2016 Sep 19, #1100)
|
||||
|
||||
Patch to order results from taglist(). (Duncan McDougall, 2016 Oct 25)
|
||||
|
||||
Patch for :pyx, run python commands depending on the supported version.
|
||||
(Marc Weber, update from Ken Takata, 2016 Sep 19)
|
||||
patch for 'spellcamelcase' option: spellcheck each CamelCased word.
|
||||
(Ben Tucker, 2016 Dec 2)
|
||||
|
||||
When using ":diffput" through a mapping, undo in the target buffer isn't
|
||||
synced. (Ryan Carney, 2016 Sep 14)
|
||||
@@ -264,14 +301,30 @@ Jul 25, #948)
|
||||
Patch to fix wrong encoding of error message on Cygwin/MSYS terminal.
|
||||
(Ken Takata, 2016 Oct 4)
|
||||
|
||||
Patch to introduce 'cmdencoding'. (Ken Takata, Aug 18?)
|
||||
Better help Aug 19.
|
||||
Problem: applies to too many commands, such as :cbuffer.
|
||||
Updated patch with three options, 2016 Sep 8.
|
||||
Win32: When running ":make" and 'encoding' differs from the system locale,
|
||||
the output should be converted. Esp. when 'encoding' is "utf-8". (Yongwei
|
||||
Wu) Should we use 'termencoding' for this?
|
||||
|
||||
Patch to add 'systemencoding', convert between 'encoding' and this for file
|
||||
names, shell commands and the like. (Kikuchan, 2010 Oct 14)
|
||||
Assume the system converts between the actual encoding of the filesystem to
|
||||
the system encoding (usually utf-8).
|
||||
|
||||
'hlsearch' interferes with a Conceal match. (Rom Grk, 2016 Aug 9)
|
||||
|
||||
Patch to add context information to quickfix/location list. (Yegappan
|
||||
Lakshmanan, 2016 Aug 25)
|
||||
Lakshmanan, 2016 Aug 25, #1012)
|
||||
|
||||
MS-Windows: use WS_HIDE instead of SW_SHOWMINNOACTIVE in os_win32.c?
|
||||
Otherwise task flickers in taskbar.
|
||||
|
||||
Bogus characters inserted when triggering indent while changing test.
|
||||
(Vitor Antunes, 2016 Nov 22, #1269)
|
||||
|
||||
Should make ":@r" handle line continuation. (Cesar Romani, 2016 Jun 26)
|
||||
Also for ":@.".
|
||||
|
||||
@@ -280,6 +333,9 @@ Repeating 'opfunc' in a function only works once. (Tarmean, 2016 Jul 15, #925)
|
||||
Have a way to get the call stack, in a function and from an exception.
|
||||
#1125
|
||||
|
||||
Patch to add 'pythonhome' and 'pythonthreehome' options. (Kazuki Sakamoto,
|
||||
2016 Nov 21, #1266)
|
||||
|
||||
Second problem in #966: ins_compl_add_tv() uses get_dict_string() multiple
|
||||
times, overwrites the one buffer. (Nikolay Pavlov, 2016 Aug 5)
|
||||
|
||||
@@ -392,13 +448,8 @@ 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)
|
||||
|
||||
Patch to introduce 'cmdencoding'. (Ken Takata, Aug 18?)
|
||||
Better help Aug 19.
|
||||
Problem: applies to too many commands, such as :cbuffer.
|
||||
Updated patch with three options, 2016 Sep 8.
|
||||
Win32: When running ":make" and 'encoding' differs from the system locale,
|
||||
the output should be converted. Esp. when 'encoding' is "utf-8". (Yongwei
|
||||
Wu) Should we use 'termencoding' for this?
|
||||
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)
|
||||
@@ -413,6 +464,9 @@ Access to uninitialized memory in match_backref() regexp_nda.c:4882
|
||||
":cd C:\Windows\System32\drivers\etc*" does not work, even though the
|
||||
directory exists. (Sergio Gallelli, 2013 Dec 29)
|
||||
|
||||
In debug mode one can inspect variables, but not the function parameters
|
||||
(starting with a:). (Luc Hermitte, 2017 Jan 4, #1352)
|
||||
|
||||
7 Add a watchpoint in the debug mode: An expression that breaks execution
|
||||
when evaluating to non-zero. Add the "watchadd expr" command, stop when
|
||||
the value of the expression changes. ":watchdel" deletes an item,
|
||||
@@ -501,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?
|
||||
|
||||
@@ -894,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.
|
||||
|
||||
@@ -974,9 +1026,6 @@ Szamotulski, 2012 Nov 8)
|
||||
Session file creation: 'autochdir' causes trouble. Keep it off until after
|
||||
loading all files.
|
||||
|
||||
8 "stl" and "stlnc" in 'fillchars' don't work for multi-byte characters.
|
||||
Patch by Christian Wellenbrock, 2013 Jul 5.
|
||||
|
||||
MS-Windows resizing problems:
|
||||
- Windows window on screen positioning: Patch by Yukihiro Nakadaira, 2012 Jun
|
||||
20. Uses getWindowRect() instead of GetWindowPlacement()
|
||||
@@ -1001,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:
|
||||
@@ -1144,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
|
||||
@@ -1283,11 +1327,6 @@ Regexp engine performance:
|
||||
7.2.274. (Christian Brabandt, 2010 May 27) Generally, folding with
|
||||
'foldmethod' set to "syntax" is slow. Do profiling to find out why.
|
||||
|
||||
Patch to add 'systemencoding', convert between 'encoding' and this for file
|
||||
names, shell commands and the like. (Kikuchan, 2010 Oct 14)
|
||||
Assume the system converts between the actual encoding of the filesystem to
|
||||
the system encoding (usually utf-8).
|
||||
|
||||
Problem producing tags file when hebrew.frx is present. It has a BOM.
|
||||
Results in E670. (Tony Mechelynck, 2010 May 2)
|
||||
|
||||
@@ -1306,6 +1345,7 @@ With "tw=55 fo+=a" typing space before ) doesn't work well. (Scott Mcdermott,
|
||||
|
||||
Patch to add random number generator. (Hong Xu, 2010 Nov 8, update Nov 10)
|
||||
Alternative from Christian Brabandt. (2010 Sep 19)
|
||||
New one from Yasuhiro Matsumoto, #1277.
|
||||
|
||||
Messages in message.txt are highlighted as examples.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_22.txt* For Vim version 8.0. Last change: 2012 Nov 15
|
||||
*usr_22.txt* For Vim version 8.0. Last change: 2016 Dec 13
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -93,7 +93,7 @@ browser. This is what you get: >
|
||||
o................Browsing with a Horizontal Split...........|netrw-o|
|
||||
p................Use Preview Window.........................|netrw-p|
|
||||
P................Edit in Previous Window....................|netrw-p|
|
||||
q................Listing Bookmarks and History..............|netrw-q|
|
||||
q................Listing Bookmarks and History..............|netrw-qb|
|
||||
r................Reversing Sorting Order....................|netrw-r|
|
||||
< (etc)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 8.0. Last change: 2016 Sep 01
|
||||
*usr_41.txt* For Vim version 8.0. Last change: 2016 Nov 29
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -930,6 +930,7 @@ Testing: *test-functions*
|
||||
test_null_string() return a null String
|
||||
|
||||
Inter-process communication: *channel-functions*
|
||||
ch_canread() check if there is something to read
|
||||
ch_open() open a channel
|
||||
ch_close() close a channel
|
||||
ch_close_in() close the in part of a channel
|
||||
@@ -999,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 Nov 06
|
||||
*version8.txt* For Vim version 8.0. Last change: 2017 Jan 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -181,6 +181,12 @@ Insert mode commands: ~
|
||||
|i_CTRL-G_U| CTRL-G U don't break undo with next cursor movement
|
||||
|
||||
|
||||
Cmdline mode commands: ~
|
||||
|
||||
|/_CTRL-G| CTRL-G move to the next match in 'incsearch' mode
|
||||
|/_CTRL-T| CTRL-T move to the previous match in 'incsearch' mode
|
||||
|
||||
|
||||
Options: ~
|
||||
|
||||
'belloff' do not ring the bell for these reasons
|
||||
@@ -224,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: ~
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*windows.txt* For Vim version 8.0. Last change: 2016 Oct 21
|
||||
*windows.txt* For Vim version 8.0. Last change: 2016 Dec 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -696,6 +696,8 @@ can also get to them with the buffer list commands, like ":bnext".
|
||||
- If the file is not open in a window edit the file in the
|
||||
current window. If the current buffer can't be |abandon|ed,
|
||||
the window is split first.
|
||||
- Windows that are not in the argument list or are not full
|
||||
width will be closed if possible.
|
||||
The |argument-list| is set, like with the |:next| command.
|
||||
The purpose of this command is that it can be used from a
|
||||
program that wants Vim to edit another file, e.g., a debugger.
|
||||
|
||||
+13
-4
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2016 Oct 31
|
||||
" Last Change: 2017 Jan 06
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -309,7 +309,10 @@ au BufNewFile,BufRead *.bl setf blank
|
||||
au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
|
||||
|
||||
" Bazel (http://bazel.io)
|
||||
autocmd BufRead,BufNewFile *.bzl,BUILD,WORKSPACE setfiletype bzl
|
||||
autocmd BufRead,BufNewFile *.bzl,WORKSPACE setfiletype bzl
|
||||
if has("fname_case")
|
||||
autocmd BufRead,BufNewFile BUILD setfiletype bzl
|
||||
endif
|
||||
|
||||
" C or lpc
|
||||
au BufNewFile,BufRead *.c call s:FTlpc()
|
||||
@@ -673,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: 2016 Jun 20
|
||||
" Last Change: 2017 Jan 18
|
||||
|
||||
" To make the ":Man" command available before editing a manual page, source
|
||||
" this script from your startup vimrc file.
|
||||
@@ -47,6 +47,7 @@ endif
|
||||
if exists(":Man") != 2
|
||||
com -nargs=+ Man call s:GetPage(<f-args>)
|
||||
nmap <Leader>K :call <SID>PreGetPage(0)<CR>
|
||||
nmap <Plug>ManPreGetPage :call <SID>PreGetPage(0)<CR>
|
||||
endif
|
||||
|
||||
" Define functions only once.
|
||||
@@ -96,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
|
||||
@@ -175,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
|
||||
|
||||
+283
-113
@@ -2,7 +2,7 @@
|
||||
" Language: Javascript
|
||||
" Maintainer: Chris Paul ( https://github.com/bounceme )
|
||||
" URL: https://github.com/pangloss/vim-javascript
|
||||
" Last Change: August 25, 2016
|
||||
" Last Change: December 31, 2016
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
@@ -12,11 +12,10 @@ let b:did_indent = 1
|
||||
|
||||
" Now, set up our indentation expression and keys that trigger it.
|
||||
setlocal indentexpr=GetJavascriptIndent()
|
||||
setlocal nolisp noautoindent nosmartindent
|
||||
setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e
|
||||
setlocal cinoptions+=j1,J1
|
||||
setlocal autoindent nolisp nosmartindent
|
||||
setlocal indentkeys+=0],0)
|
||||
|
||||
let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys< cinoptions<'
|
||||
let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<'
|
||||
|
||||
" Only define the function once.
|
||||
if exists('*GetJavascriptIndent')
|
||||
@@ -37,158 +36,329 @@ else
|
||||
endfunction
|
||||
endif
|
||||
|
||||
let s:line_pre = '^\s*\%(\%(\%(\/\*.\{-}\)\=\*\+\/\s*\)\=\)\@>'
|
||||
let s:expr_case = s:line_pre . '\%(\%(case\>.\+\)\|default\)\s*:'
|
||||
" searchpair() wrapper
|
||||
if has('reltime')
|
||||
function s:GetPair(start,end,flags,skip,time,...)
|
||||
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 2000,0] + a:000),a:time)
|
||||
endfunction
|
||||
else
|
||||
function s:GetPair(start,end,flags,skip,...)
|
||||
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 1000,get(a:000,1)]))
|
||||
endfunction
|
||||
endif
|
||||
|
||||
" Regex of syntax group names that are or delimit string or are comments.
|
||||
let s:syng_strcom = '\%(s\%(tring\|pecial\)\|comment\|regex\|doc\|template\)'
|
||||
|
||||
" Regex of syntax group names that are strings or documentation.
|
||||
let s:syng_comment = '\%(comment\|doc\)'
|
||||
|
||||
let s:syng_strcom = 'string\|comment\|regex\|special\|doc\|template'
|
||||
let s:syng_str = 'string\|template'
|
||||
let s:syng_com = 'comment\|doc'
|
||||
" Expression used to check whether we should skip a match with searchpair().
|
||||
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),0),'name') =~? '".s:syng_strcom."'"
|
||||
|
||||
if has('reltime')
|
||||
function s:GetPair(start,end,flags,time)
|
||||
return searchpair(a:start,'',a:end,a:flags,s:skip_expr,max([prevnonblank(v:lnum) - 2000,0]),a:time)
|
||||
endfunction
|
||||
else
|
||||
function s:GetPair(start,end,flags,n)
|
||||
return searchpair(a:start,'',a:end,a:flags,0,max([prevnonblank(v:lnum) - 2000,0]))
|
||||
endfunction
|
||||
endif
|
||||
function s:skip_func()
|
||||
if !s:free || search('\m`\|\*\/','nW',s:looksyn)
|
||||
let s:free = !eval(s:skip_expr)
|
||||
let s:looksyn = s:free ? line('.') : s:looksyn
|
||||
return !s:free
|
||||
endif
|
||||
let s:looksyn = line('.')
|
||||
return (search('\m\/','nbW',s:looksyn) || search('\m[''"]\|\\$','nW',s:looksyn)) && eval(s:skip_expr)
|
||||
endfunction
|
||||
|
||||
let s:line_term = '\s*\%(\%(\/\%(\%(\*.\{-}\*\/\)\|\%(\*\+\)\)\)\s*\)\=$'
|
||||
function s:alternatePair(stop)
|
||||
let pos = getpos('.')[1:2]
|
||||
while search('\m[][(){}]','bW',a:stop)
|
||||
if !s:skip_func()
|
||||
let idx = stridx('])}',s:looking_at())
|
||||
if idx + 1
|
||||
if !s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,a:stop)
|
||||
break
|
||||
endif
|
||||
else
|
||||
return
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
call call('cursor',pos)
|
||||
endfunction
|
||||
|
||||
function s:save_pos(f,...)
|
||||
let l:pos = getpos('.')[1:2]
|
||||
let ret = call(a:f,a:000)
|
||||
call call('cursor',l:pos)
|
||||
return ret
|
||||
endfunction
|
||||
|
||||
function s:syn_at(l,c)
|
||||
return synIDattr(synID(a:l,a:c,0),'name')
|
||||
endfunction
|
||||
|
||||
function s:looking_at()
|
||||
return getline('.')[col('.')-1]
|
||||
endfunction
|
||||
|
||||
function s:token()
|
||||
return s:looking_at() =~ '\k' ? expand('<cword>') : s:looking_at()
|
||||
endfunction
|
||||
|
||||
function s:b_token()
|
||||
if s:looking_at() =~ '\k'
|
||||
call search('\m\<','cbW')
|
||||
endif
|
||||
return search('\m\S','bW')
|
||||
endfunction
|
||||
|
||||
function s:previous_token()
|
||||
let l:n = line('.')
|
||||
while s:b_token()
|
||||
if (s:looking_at() == '/' || line('.') != l:n && search('\m\/\/','nbW',
|
||||
\ line('.'))) && s:syn_at(line('.'),col('.')) =~? s:syng_com
|
||||
call search('\m\_[^/]\zs\/[/*]','bW')
|
||||
else
|
||||
return s:token()
|
||||
endif
|
||||
endwhile
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function s:others(p)
|
||||
return "((line2byte(line('.')) + col('.')) <= ".(line2byte(a:p[0]) + a:p[1]).") || ".s:skip_expr
|
||||
endfunction
|
||||
|
||||
function s:tern_skip(p)
|
||||
return s:GetPair('{','}','nbW',s:others(a:p),200,a:p[0]) > 0
|
||||
endfunction
|
||||
|
||||
function s:tern_col(p)
|
||||
return s:GetPair('?',':\@<!::\@!','nbW',s:others(a:p)
|
||||
\ .' || s:tern_skip('.string(a:p).')',200,a:p[0]) > 0
|
||||
endfunction
|
||||
|
||||
function s:label_col()
|
||||
let pos = getpos('.')[1:2]
|
||||
let [s:looksyn,s:free] = pos
|
||||
call s:alternatePair(0)
|
||||
if s:save_pos('s:IsBlock')
|
||||
let poss = getpos('.')[1:2]
|
||||
return call('cursor',pos) || !s:tern_col(poss)
|
||||
elseif s:looking_at() == ':'
|
||||
return !s:tern_col([0,0])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" configurable regexes that define continuation lines, not including (, {, or [.
|
||||
if !exists('g:javascript_opfirst')
|
||||
let g:javascript_opfirst = '\%([<>,:?^%|*&]\|\/[^/*]\|\([-.+]\)\1\@!\|=>\@!\|in\%(stanceof\)\=\>\)'
|
||||
endif
|
||||
if !exists('g:javascript_continuation')
|
||||
let g:javascript_continuation = '\%([<=,.?/*:^%|&]\|+\@<!+\|-\@<!-\|=\@<!>\|\<in\%(stanceof\)\=\)'
|
||||
endif
|
||||
let s:opfirst = '^' . get(g:,'javascript_opfirst',
|
||||
\ '\%([<>=,?^%|*/&]\|\([-.:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)')
|
||||
let s:continuation = get(g:,'javascript_continuation',
|
||||
\ '\%([<=,.~!?/*^%|&:]\|+\@<!+\|-\@<!-\|=\@<!>\|\<\%(typeof\|delete\|void\|in\|instanceof\)\)') . '$'
|
||||
|
||||
let g:javascript_opfirst = s:line_pre . g:javascript_opfirst
|
||||
let g:javascript_continuation .= s:line_term
|
||||
|
||||
function s:OneScope(lnum,text,add)
|
||||
return a:text =~# '\%(\<else\|\<do\|=>\)' . s:line_term ? 'no b' :
|
||||
\ ((a:add && a:text =~ s:line_pre . '$' && search('\%' . s:PrevCodeLine(a:lnum - 1) . 'l.)' . s:line_term)) ||
|
||||
\ cursor(a:lnum, match(a:text, ')' . s:line_term)) > -1) &&
|
||||
\ s:GetPair('(', ')', 'cbW', 100) > 0 && search('\C\l\+\_s*\%#','bW') &&
|
||||
\ (a:add || ((expand('<cword>') !=# 'while' || !s:GetPair('\C\<do\>', '\C\<while\>','nbW',100)) &&
|
||||
\ (expand('<cword>') !=# 'each' || search('\C\<for\_s\+\%#','nbW')))) ? expand('<cword>') : ''
|
||||
function s:continues(ln,con)
|
||||
return !cursor(a:ln, match(' '.a:con,s:continuation)) &&
|
||||
\ eval((['s:syn_at(line("."),col(".")) !~? "regex"'] +
|
||||
\ repeat(['s:previous_token() != "."'],5) + [1])[
|
||||
\ index(split('/ typeof in instanceof void delete'),s:token())])
|
||||
endfunction
|
||||
|
||||
" https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader
|
||||
function s:IsBlock()
|
||||
return getline(line('.'))[col('.')-1] == '{' && !search(
|
||||
\ '\C\%(\<return\s*\|\%([-=~!<*+,.?^%|&\[(]\|=\@<!>\|\*\@<!\/\|\<\%(var\|const\|let\|import\|export\%(\_s\+default\)\=\|yield\|delete\|void\|t\%(ypeof\|hrow\)\|new\|in\%(stanceof\)\=\)\)\_s*\)\%#','bnW') &&
|
||||
\ (!search(':\_s*\%#','bW') || (!s:GetPair('[({[]','[])}]','bW',200) || s:IsBlock()))
|
||||
" get the line of code stripped of comments and move cursor to the last
|
||||
" non-comment char.
|
||||
function s:Trim(ln)
|
||||
let pline = substitute(getline(a:ln),'\s*$','','')
|
||||
let l:max = max([match(pline,'.*[^/]\zs\/[/*]'),0])
|
||||
while l:max && s:syn_at(a:ln, strlen(pline)) =~? s:syng_com
|
||||
let pline = substitute(strpart(pline, 0, l:max),'\s*$','','')
|
||||
let l:max = max([match(pline,'.*[^/]\zs\/[/*]'),0])
|
||||
endwhile
|
||||
return cursor(a:ln,strlen(pline)) ? pline : pline
|
||||
endfunction
|
||||
|
||||
" Auxiliary Functions {{{2
|
||||
|
||||
" Find line above 'lnum' that isn't empty, in a comment, or in a string.
|
||||
" Find line above 'lnum' that isn't empty or in a comment
|
||||
function s:PrevCodeLine(lnum)
|
||||
let l:lnum = prevnonblank(a:lnum)
|
||||
while l:lnum
|
||||
if synIDattr(synID(l:lnum,matchend(getline(l:lnum), '^\s*[^''"]'),0),'name') !~? s:syng_strcom
|
||||
return l:lnum
|
||||
let l:n = prevnonblank(a:lnum)
|
||||
while l:n
|
||||
if getline(l:n) =~ '^\s*\/[/*]'
|
||||
if (stridx(getline(l:n),'`') > 0 || getline(l:n-1)[-1:] == '\') &&
|
||||
\ s:syn_at(l:n,1) =~? s:syng_str
|
||||
return l:n
|
||||
endif
|
||||
let l:n = prevnonblank(l:n-1)
|
||||
elseif s:syn_at(l:n,1) =~? s:syng_com
|
||||
let l:n = s:save_pos('eval',
|
||||
\ 'cursor('.l:n.',1) + search(''\m\/\*'',"bW")')
|
||||
else
|
||||
return l:n
|
||||
endif
|
||||
let l:lnum = prevnonblank(l:lnum - 1)
|
||||
endwhile
|
||||
endfunction
|
||||
|
||||
" Check if line 'lnum' has a balanced amount of parentheses.
|
||||
function s:Balanced(lnum)
|
||||
let [open_0,open_2,open_4] = [0,0,0]
|
||||
let l:open = 0
|
||||
let l:line = getline(a:lnum)
|
||||
let pos = match(l:line, '[][(){}]', 0)
|
||||
while pos != -1
|
||||
if synIDattr(synID(a:lnum,pos + 1,0),'name') !~? s:syng_strcom
|
||||
let idx = stridx('(){}[]', l:line[pos])
|
||||
if idx % 2 == 0
|
||||
let open_{idx} = open_{idx} + 1
|
||||
else
|
||||
let open_{idx - 1} = open_{idx - 1} - 1
|
||||
if s:syn_at(a:lnum,pos + 1) !~? s:syng_strcom
|
||||
let l:open += match(' ' . l:line[pos],'[[({]')
|
||||
if l:open < 0
|
||||
return
|
||||
endif
|
||||
endif
|
||||
let pos = match(l:line, '[][(){}]', pos + 1)
|
||||
endwhile
|
||||
return (!open_4 + !open_2 + !open_0) - 2
|
||||
return !l:open
|
||||
endfunction
|
||||
|
||||
function s:OneScope(lnum)
|
||||
let pline = s:Trim(a:lnum)
|
||||
let kw = 'else do'
|
||||
if pline[-1:] == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
|
||||
call s:previous_token()
|
||||
let kw = 'for if let while with'
|
||||
if index(split('await each'),s:token()) + 1
|
||||
call s:previous_token()
|
||||
let kw = 'for'
|
||||
endif
|
||||
endif
|
||||
return pline[-2:] == '=>' || index(split(kw),s:token()) + 1 &&
|
||||
\ s:save_pos('s:previous_token') != '.'
|
||||
endfunction
|
||||
|
||||
" returns braceless levels started by 'i' and above lines * &sw. 'num' is the
|
||||
" lineNr which encloses the entire context, 'cont' if whether line 'i' + 1 is
|
||||
" a continued expression, which could have started in a braceless context
|
||||
function s:iscontOne(i,num,cont)
|
||||
let [l:i, l:num, bL] = [a:i, a:num + !a:num, 0]
|
||||
let pind = a:num ? indent(l:num) + s:W : 0
|
||||
let ind = indent(l:i) + (a:cont ? 0 : s:W)
|
||||
while l:i >= l:num && (ind > pind || l:i == l:num)
|
||||
if indent(l:i) < ind && s:OneScope(l:i)
|
||||
let bL += s:W
|
||||
let l:i = line('.')
|
||||
elseif !a:cont || bL || ind < indent(a:i)
|
||||
break
|
||||
endif
|
||||
let ind = min([ind, indent(l:i)])
|
||||
let l:i = s:PrevCodeLine(l:i - 1)
|
||||
endwhile
|
||||
return bL
|
||||
endfunction
|
||||
|
||||
" https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader
|
||||
function s:IsBlock()
|
||||
if s:looking_at() == '{'
|
||||
let l:n = line('.')
|
||||
let char = s:previous_token()
|
||||
let syn = char =~ '[{>/]' ? s:syn_at(line('.'),col('.')-(char == '{')) : ''
|
||||
if syn =~? 'xml\|jsx'
|
||||
return char != '{'
|
||||
elseif char =~ '\k'
|
||||
return index(split('return const let import export yield default delete var await void typeof throw case new in instanceof')
|
||||
\ ,char) < (line('.') != l:n) || s:previous_token() == '.'
|
||||
elseif char == '>'
|
||||
return getline('.')[col('.')-2] == '=' || syn =~? '^jsflow'
|
||||
elseif char == ':'
|
||||
return getline('.')[col('.')-2] != ':' && s:label_col()
|
||||
endif
|
||||
return syn =~? 'regex' || char !~ '[-=~!<*+,/?^%|&([]'
|
||||
endif
|
||||
endfunction
|
||||
" }}}
|
||||
|
||||
function GetJavascriptIndent()
|
||||
if !exists('b:js_cache')
|
||||
let b:js_cache = [0,0,0]
|
||||
endif
|
||||
let b:js_cache = get(b:,'js_cache',[0,0,0])
|
||||
" Get the current line.
|
||||
let l:line = getline(v:lnum)
|
||||
let syns = synIDattr(synID(v:lnum, 1, 0), 'name')
|
||||
call cursor(v:lnum,1)
|
||||
let l:line = getline('.')
|
||||
let syns = s:syn_at(v:lnum, 1)
|
||||
|
||||
" start with strings,comments,etc.{{{2
|
||||
if (l:line !~ '^[''"`]' && syns =~? '\%(string\|template\)') ||
|
||||
\ (l:line !~ '^\s*[/*]' && syns =~? s:syng_comment)
|
||||
" start with strings,comments,etc.
|
||||
if syns =~? s:syng_com
|
||||
if l:line =~ '^\s*\*'
|
||||
return cindent(v:lnum)
|
||||
elseif l:line !~ '^\s*\/[/*]'
|
||||
return -1
|
||||
endif
|
||||
elseif syns =~? s:syng_str && l:line !~ '^[''"]'
|
||||
if b:js_cache[0] == v:lnum - 1 && s:Balanced(v:lnum-1)
|
||||
let b:js_cache[0] = v:lnum
|
||||
endif
|
||||
return -1
|
||||
endif
|
||||
if l:line !~ '^\%(\/\*\|\s*\/\/\)' && syns =~? s:syng_comment
|
||||
return cindent(v:lnum)
|
||||
endif
|
||||
let l:lnum = s:PrevCodeLine(v:lnum - 1)
|
||||
if l:lnum == 0
|
||||
return 0
|
||||
if !l:lnum
|
||||
return
|
||||
endif
|
||||
|
||||
if (l:line =~# s:expr_case)
|
||||
let cpo_switch = &cpo
|
||||
set cpo+=%
|
||||
let ind = cindent(v:lnum)
|
||||
let &cpo = cpo_switch
|
||||
return ind
|
||||
let l:line = substitute(l:line,'^\s*','','')
|
||||
if l:line[:1] == '/*'
|
||||
let l:line = substitute(l:line,'^\%(\/\*.\{-}\*\/\s*\)*','','')
|
||||
endif
|
||||
if l:line =~ '^\/[/*]'
|
||||
let l:line = ''
|
||||
endif
|
||||
"}}}
|
||||
|
||||
" the containing paren, bracket, curly. Memoize, last lineNr either has the
|
||||
" same scope or starts a new one, unless if it closed a scope.
|
||||
call cursor(v:lnum,1)
|
||||
if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum && b:js_cache[0] &&
|
||||
\ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum) > 0)
|
||||
let num = b:js_cache[1]
|
||||
elseif syns != '' && l:line[0] =~ '\s'
|
||||
let pattern = syns =~? 'block' ? ['{','}'] : syns =~? 'jsparen' ? ['(',')'] :
|
||||
\ syns =~? 'jsbracket'? ['\[','\]'] : ['[({[]','[])}]']
|
||||
let num = s:GetPair(pattern[0],pattern[1],'bW',2000)
|
||||
" the containing paren, bracket, or curly. Many hacks for performance
|
||||
let idx = strlen(l:line) ? stridx('])}',l:line[0]) : -1
|
||||
if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum &&
|
||||
\ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum))
|
||||
call call('cursor',b:js_cache[1:])
|
||||
else
|
||||
let num = s:GetPair('[({[]','[])}]','bW',2000)
|
||||
endif
|
||||
let b:js_cache = [v:lnum,num,line('.') == v:lnum ? b:js_cache[2] : col('.')]
|
||||
|
||||
if l:line =~ s:line_pre . '[])}]'
|
||||
return indent(num)
|
||||
let [s:looksyn, s:free, top] = [v:lnum - 1, 1, (!indent(l:lnum) &&
|
||||
\ s:syn_at(l:lnum,1) !~? s:syng_str) * l:lnum]
|
||||
if idx + 1
|
||||
call s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,top)
|
||||
elseif indent(v:lnum) && syns =~? 'block'
|
||||
call s:GetPair('{','}','bW','s:skip_func()',2000,top)
|
||||
else
|
||||
call s:alternatePair(top)
|
||||
endif
|
||||
endif
|
||||
|
||||
call cursor(b:js_cache[1],b:js_cache[2])
|
||||
|
||||
let swcase = getline(l:lnum) =~# s:expr_case
|
||||
let pline = swcase ? getline(l:lnum) : substitute(getline(l:lnum), '\%(:\@<!\/\/.*\)$', '','')
|
||||
let inb = num == 0 || num < l:lnum && ((l:line !~ s:line_pre . ',' && pline !~ ',' . s:line_term) || s:IsBlock())
|
||||
let switch_offset = num == 0 || s:OneScope(num, strpart(getline(num),0,b:js_cache[2] - 1),1) !=# 'switch' ? 0 :
|
||||
\ &cino !~ ':' || !has('float') ? s:sw() :
|
||||
\ float2nr(str2float(matchstr(&cino,'.*:\zs[-0-9.]*')) * (&cino =~# '.*:[^,]*s' ? s:sw() : 1))
|
||||
|
||||
" most significant, find the indent amount
|
||||
if inb && !swcase && ((l:line =~# g:javascript_opfirst || pline =~# g:javascript_continuation) ||
|
||||
\ num < l:lnum && s:OneScope(l:lnum,pline,0) =~# '\<\%(for\|each\|if\|let\|no\sb\|w\%(hile\|ith\)\)\>' &&
|
||||
\ l:line !~ s:line_pre . '{')
|
||||
return (num > 0 ? indent(num) : -s:sw()) + (s:sw() * 2) + switch_offset
|
||||
elseif num > 0
|
||||
return indent(num) + s:sw() + switch_offset
|
||||
if idx + 1 || l:line[:1] == '|}'
|
||||
if idx == 2 && search('\m\S','bW',line('.')) && s:looking_at() == ')'
|
||||
call s:GetPair('(',')','bW',s:skip_expr,200)
|
||||
endif
|
||||
return indent('.')
|
||||
endif
|
||||
|
||||
let b:js_cache = [v:lnum] + (line('.') == v:lnum ? [0,0] : getpos('.')[1:2])
|
||||
let num = b:js_cache[1]
|
||||
|
||||
let [s:W, isOp, bL, switch_offset] = [s:sw(),0,0,0]
|
||||
if !num || s:IsBlock()
|
||||
let pline = s:save_pos('s:Trim',l:lnum)
|
||||
if num && s:looking_at() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
|
||||
let num = line('.')
|
||||
if s:previous_token() ==# 'switch' && s:previous_token() != '.'
|
||||
if &cino !~ ':' || !has('float')
|
||||
let switch_offset = s:W
|
||||
else
|
||||
let cinc = matchlist(&cino,'.*:\(-\)\=\([0-9.]*\)\(s\)\=\C')
|
||||
let switch_offset = float2nr(str2float(cinc[1].(strlen(cinc[2]) ? cinc[2] : strlen(cinc[3])))
|
||||
\ * (strlen(cinc[3]) ? s:W : 1))
|
||||
endif
|
||||
if pline[-1:] != '.' && l:line =~# '^\%(default\|case\)\>'
|
||||
return indent(num) + switch_offset
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
if pline[-1:] !~ '[{;]'
|
||||
if pline =~# ':\@<!:$'
|
||||
call cursor(l:lnum,strlen(pline))
|
||||
let isOp = s:tern_col(b:js_cache[1:2])
|
||||
else
|
||||
let isOp = l:line =~# s:opfirst || s:continues(l:lnum,pline)
|
||||
endif
|
||||
let bL = s:iscontOne(l:lnum,num,isOp)
|
||||
let bL -= (bL && l:line[0] == '{') * s:W
|
||||
endif
|
||||
endif
|
||||
|
||||
" main return
|
||||
if isOp
|
||||
return (num ? indent(num) : -s:W) + (s:W * 2) + switch_offset + bL
|
||||
elseif num
|
||||
return indent(num) + s:W + switch_offset + bL
|
||||
endif
|
||||
return bL
|
||||
endfunction
|
||||
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
" Maintainer: Benjamin Linskey <vim@benlinskey.com>
|
||||
" Last Changed: 2016 July 20
|
||||
" Last Changed: 2016 December 5
|
||||
" URL: https://github.com/blinskey/vim-armenian-keymaps
|
||||
|
||||
let b:keymap_name = "hy"
|
||||
@@ -98,6 +98,8 @@ f ֆ
|
||||
7 .
|
||||
8 «
|
||||
9 »
|
||||
* (
|
||||
( )
|
||||
\\ '
|
||||
| ՞
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
" Maintainer: Benjamin Linskey <vim@benlinskey.com>
|
||||
" Last Changed: 2016 July 20
|
||||
" Last Changed: 2016 December 5
|
||||
" URL: https://github.com/blinskey/vim-armenian-keymaps
|
||||
|
||||
let b:keymap_name = "hy"
|
||||
@@ -98,6 +98,8 @@ f ֆ
|
||||
7 .
|
||||
8 «
|
||||
9 »
|
||||
* (
|
||||
( )
|
||||
\\ '
|
||||
| ՞
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
" Load the matchit package.
|
||||
" For those users who were loading the matchit plugin from here.
|
||||
packadd matchit
|
||||
if 1
|
||||
packadd matchit
|
||||
endif
|
||||
|
||||
@@ -80,6 +80,9 @@ if has("gui_macvim")
|
||||
an <silent> 9998.350 Window.Select\ Previous\ Tab :tabprevious<CR>
|
||||
an 9998.360 Window.-SEP2- <Nop>
|
||||
an <silent> 9998.370 Window.Bring\ All\ To\ Front <Nop>
|
||||
an <silent> 9998.380 Window.Stay\ in\ Front <Nop>
|
||||
an <silent> 9998.390 Window.Stay\ in\ Back <Nop>
|
||||
an <silent> 9998.400 Window.Stay\ Level\ Normal <Nop>
|
||||
endif
|
||||
|
||||
" Help menu
|
||||
@@ -1255,6 +1258,9 @@ if has("gui_macvim")
|
||||
macm Window.Select\ Next\ Tab key=<D-}>
|
||||
macm Window.Select\ Previous\ Tab key=<D-{>
|
||||
macm Window.Bring\ All\ To\ Front action=arrangeInFront:
|
||||
macm Window.Stay\ in\ Front action=stayInFront:
|
||||
macm Window.Stay\ in\ Back action=stayInBack:
|
||||
macm Window.Stay\ Level\ Normal action=stayLevelNormal:
|
||||
|
||||
macm Help.MacVim\ Help key=<D-?>
|
||||
macm Help.MacVim\ Website action=openWebsite:
|
||||
|
||||
+30
-14
@@ -1,7 +1,7 @@
|
||||
" Set options and add mapping such that Vim behaves a lot like MS-Windows
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last change: 2012 Jul 25
|
||||
" Last change: 2017 Feb 09
|
||||
|
||||
" bail out if this isn't wanted (mrsvim.vim uses this).
|
||||
if exists("g:skip_loading_mswin") && g:skip_loading_mswin
|
||||
@@ -23,20 +23,22 @@ set backspace=indent,eol,start whichwrap+=<,>,[,]
|
||||
" backspace in Visual mode deletes selection
|
||||
vnoremap <BS> d
|
||||
|
||||
" CTRL-X and SHIFT-Del are Cut
|
||||
vnoremap <C-X> "+x
|
||||
vnoremap <S-Del> "+x
|
||||
if has("clipboard")
|
||||
" CTRL-X and SHIFT-Del are Cut
|
||||
vnoremap <C-X> "+x
|
||||
vnoremap <S-Del> "+x
|
||||
|
||||
" CTRL-C and CTRL-Insert are Copy
|
||||
vnoremap <C-C> "+y
|
||||
vnoremap <C-Insert> "+y
|
||||
" CTRL-C and CTRL-Insert are Copy
|
||||
vnoremap <C-C> "+y
|
||||
vnoremap <C-Insert> "+y
|
||||
|
||||
" CTRL-V and SHIFT-Insert are Paste
|
||||
map <C-V> "+gP
|
||||
map <S-Insert> "+gP
|
||||
" CTRL-V and SHIFT-Insert are Paste
|
||||
map <C-V> "+gP
|
||||
map <S-Insert> "+gP
|
||||
|
||||
cmap <C-V> <C-R>+
|
||||
cmap <S-Insert> <C-R>+
|
||||
cmap <C-V> <C-R>+
|
||||
cmap <S-Insert> <C-R>+
|
||||
endif
|
||||
|
||||
" Pasting blockwise and linewise selections is not possible in Insert and
|
||||
" Visual mode without the +virtualedit feature. They are pasted as if they
|
||||
@@ -44,8 +46,10 @@ cmap <S-Insert> <C-R>+
|
||||
" Uses the paste.vim autoload script.
|
||||
" Use CTRL-G u to have CTRL-Z only undo the paste.
|
||||
|
||||
exe 'inoremap <script> <C-V> <C-G>u' . paste#paste_cmd['i']
|
||||
exe 'vnoremap <script> <C-V> ' . paste#paste_cmd['v']
|
||||
if 1
|
||||
exe 'inoremap <script> <C-V> <C-G>u' . paste#paste_cmd['i']
|
||||
exe 'vnoremap <script> <C-V> ' . paste#paste_cmd['v']
|
||||
endif
|
||||
|
||||
imap <S-Insert> <C-V>
|
||||
vmap <S-Insert> <C-V>
|
||||
@@ -99,6 +103,18 @@ inoremap <C-F4> <C-O><C-W>c
|
||||
cnoremap <C-F4> <C-C><C-W>c
|
||||
onoremap <C-F4> <C-C><C-W>c
|
||||
|
||||
if has("gui")
|
||||
" CTRL-F is the search dialog
|
||||
noremap <C-F> :promptfind<CR>
|
||||
inoremap <C-F> <C-\><C-O>:promptfind<CR>
|
||||
cnoremap <C-F> <C-\><C-C>:promptfind<CR>
|
||||
|
||||
" CTRL-H is the replace dialog
|
||||
noremap <C-H> :promptrepl<CR>
|
||||
inoremap <C-H> <C-\><C-O>:promptrepl<CR>
|
||||
cnoremap <C-H> <C-\><C-C>:promptrepl<CR>
|
||||
endif
|
||||
|
||||
" restore 'cpoptions'
|
||||
set cpo&
|
||||
if 1
|
||||
|
||||
+13
-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,14 +1341,26 @@ 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)
|
||||
endif
|
||||
if exists("&pythonhome")
|
||||
call append("$", "pythonhome\tname of the Python 2 home directory")
|
||||
call <SID>OptionG("pythonhome", &pythonhome)
|
||||
endif
|
||||
if exists("&pythonthreedll")
|
||||
call append("$", "pythonthreedll\tname of the Python 3 dynamic library")
|
||||
call <SID>OptionG("pythonthreedll", &pythonthreedll)
|
||||
endif
|
||||
if exists("&pythonthreehome")
|
||||
call append("$", "pythonthreehome\tname of the Python 3 home directory")
|
||||
call <SID>OptionG("pythonthreehome", &pythonthreehome)
|
||||
endif
|
||||
if exists("&rubydll")
|
||||
call append("$", "rubydll\tname of the Ruby dynamic library")
|
||||
call <SID>OptionG("rubydll", &rubydll)
|
||||
|
||||
+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")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2016 Nov 17
|
||||
" Last Change: 2016 Nov 18
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -363,23 +363,23 @@ syn match cPreConditMatch display "^\s*\zs\(%:\|#\)\s*\(else\|endif\)\>"
|
||||
if !exists("c_no_if0")
|
||||
syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip
|
||||
syn region cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold
|
||||
syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse
|
||||
syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse
|
||||
if !exists("c_no_if0_fold")
|
||||
syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold
|
||||
else
|
||||
syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
|
||||
endif
|
||||
syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit
|
||||
syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit
|
||||
syn region cCppInWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold
|
||||
syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit
|
||||
syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit
|
||||
if !exists("c_no_if0_fold")
|
||||
syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold
|
||||
syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold
|
||||
else
|
||||
syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2
|
||||
syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2
|
||||
endif
|
||||
syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
|
||||
syn region cCppOutSkip contained start="^\s*\zs\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip
|
||||
syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\zs\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\zs\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc
|
||||
syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
|
||||
syn region cCppOutSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip
|
||||
syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc
|
||||
endif
|
||||
syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
syn match cIncluded display contained "<[^>]*>"
|
||||
|
||||
@@ -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',
|
||||
|
||||
+27
-5
@@ -1,9 +1,10 @@
|
||||
" Vim syntax file
|
||||
" Language: HTML
|
||||
" Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
||||
" URL: http://www.fleiner.com/vim/syntax/html.vim
|
||||
" Last Change: 2015 Jan 07
|
||||
" included patch from David Felix
|
||||
" Language: HTML
|
||||
" 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 21
|
||||
" included patch from Jorge Maldonado Ventura
|
||||
|
||||
" Please check :help html.vim for some comments and a description of the options
|
||||
|
||||
@@ -53,6 +54,14 @@ syn keyword htmlTagName contained abbr acronym bdo button col label
|
||||
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 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
|
||||
|
||||
" legal arg names
|
||||
syn keyword htmlArg contained action
|
||||
syn keyword htmlArg contained align alink alt archive background bgcolor
|
||||
@@ -87,6 +96,19 @@ syn keyword htmlArg contained multiple nohref nowrap object profile readonly
|
||||
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 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
|
||||
|
||||
+20
-20
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: php PHP 3/4/5/7
|
||||
" Maintainer: Jason Woofenden <jason@jasonwoof.com>
|
||||
" Last Change: Jul 27, 2016
|
||||
" Last Change: Dec 11, 2016
|
||||
" URL: https://jasonwoof.com/gitweb/?p=vim-syntax.git;a=blob;f=php.vim;hb=HEAD
|
||||
" Former Maintainers: Peter Hodge <toomuchphp-vim@yahoo.com>
|
||||
" Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
|
||||
@@ -495,7 +495,7 @@ syntax keyword phpSpecialFunction containedin=ALLBUT,phpComment,phpStringDouble,
|
||||
" Highlighting for __autoload slightly different from line above
|
||||
syntax keyword phpSpecialFunction containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar
|
||||
\ __autoload
|
||||
highlight link phpSpecialFunction phpOperator
|
||||
hi def link phpSpecialFunction phpOperator
|
||||
|
||||
" Highlighting for PHP5's built-in classes
|
||||
" - built-in classes harvested from get_declared_classes() in 5.1.4
|
||||
@@ -518,14 +518,14 @@ syntax keyword phpClasses containedin=ALLBUT,phpComment,phpStringDouble,phpStrin
|
||||
\ DOMCharacterData DOMAttr DOMElement DOMText DOMComment DOMTypeinfo DOMUserDataHandler
|
||||
\ DOMLocator DOMConfiguration DOMCdataSection DOMDocumentType DOMNotation DOMEntity
|
||||
\ DOMEntityReference DOMProcessingInstruction DOMStringExtend DOMXPath
|
||||
highlight link phpClasses phpFunctions
|
||||
hi def link phpClasses phpFunctions
|
||||
|
||||
" Highlighting for PHP5's built-in interfaces
|
||||
" - built-in classes harvested from get_declared_interfaces() in 5.1.4
|
||||
syntax keyword phpInterfaces containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar
|
||||
\ Iterator IteratorAggregate RecursiveIterator OuterIterator SeekableIterator
|
||||
\ Traversable ArrayAccess Serializable Countable SplObserver SplSubject Reflector
|
||||
highlight link phpInterfaces phpConstant
|
||||
hi def link phpInterfaces phpConstant
|
||||
|
||||
" option defaults:
|
||||
if ! exists('php_special_functions')
|
||||
@@ -553,7 +553,7 @@ endif
|
||||
if php_alt_assignByReference
|
||||
" special highlighting for '=&' operator
|
||||
syntax match phpAssignByRef /=\s*&/ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle
|
||||
highlight link phpAssignByRef Type
|
||||
hi def link phpAssignByRef Type
|
||||
endif
|
||||
|
||||
if php_alt_comparisons
|
||||
@@ -565,7 +565,7 @@ if php_alt_comparisons
|
||||
syntax case ignore
|
||||
syntax keyword phpComparison instanceof contained containedin=phpRegion
|
||||
|
||||
hi link phpComparison Statement
|
||||
hi def link phpComparison Statement
|
||||
endif
|
||||
|
||||
" ================================================================
|
||||
@@ -645,21 +645,21 @@ hi def link phpTodo Todo
|
||||
hi def link phpDocTodo Todo
|
||||
hi def link phpMemberSelector Structure
|
||||
if exists("php_oldStyle")
|
||||
hi phpIntVar guifg=Red ctermfg=DarkRed
|
||||
hi phpEnvVar guifg=Red ctermfg=DarkRed
|
||||
hi phpOperator guifg=SeaGreen ctermfg=DarkGreen
|
||||
hi phpVarSelector guifg=SeaGreen ctermfg=DarkGreen
|
||||
hi phpRelation guifg=SeaGreen ctermfg=DarkGreen
|
||||
hi phpIdentifier guifg=DarkGray ctermfg=Brown
|
||||
hi phpIdentifierSimply guifg=DarkGray ctermfg=Brown
|
||||
hi def phpIntVar guifg=Red ctermfg=DarkRed
|
||||
hi def phpEnvVar guifg=Red ctermfg=DarkRed
|
||||
hi def phpOperator guifg=SeaGreen ctermfg=DarkGreen
|
||||
hi def phpVarSelector guifg=SeaGreen ctermfg=DarkGreen
|
||||
hi def phpRelation guifg=SeaGreen ctermfg=DarkGreen
|
||||
hi def phpIdentifier guifg=DarkGray ctermfg=Brown
|
||||
hi def phpIdentifierSimply guifg=DarkGray ctermfg=Brown
|
||||
else
|
||||
hi def link phpIntVar Identifier
|
||||
hi def link phpEnvVar Identifier
|
||||
hi def link phpOperator Operator
|
||||
hi def link phpVarSelector Operator
|
||||
hi def link phpRelation Operator
|
||||
hi def link phpIdentifier Identifier
|
||||
hi def link phpIdentifierSimply Identifier
|
||||
hi def link phpIntVar Identifier
|
||||
hi def link phpEnvVar Identifier
|
||||
hi def link phpOperator Operator
|
||||
hi def link phpVarSelector Operator
|
||||
hi def link phpRelation Operator
|
||||
hi def link phpIdentifier Identifier
|
||||
hi def link phpIdentifierSimply Identifier
|
||||
endif
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
" Contributor: Leonard Ehrenfried <leonard.ehrenfried@web.de>
|
||||
" Contributor: Karsten Hopp <karsten@redhat.com>
|
||||
" Contributor: Dean, Adam Kenneth <adam.ken.dean@hpe.com>
|
||||
" Last Change: 2016 Aug 11
|
||||
" SSH Version: 7.3p1
|
||||
" Last Change: 2016 Dec 28
|
||||
" SSH Version: 7.4p1
|
||||
"
|
||||
|
||||
" Setup
|
||||
@@ -181,6 +181,7 @@ syn keyword sshconfigKeyword IPQoS
|
||||
syn keyword sshconfigKeyword IdentitiesOnly
|
||||
syn keyword sshconfigKeyword IdentityFile
|
||||
syn keyword sshconfigKeyword IgnoreUnknown
|
||||
syn keyword sshconfigKeyword Include
|
||||
syn keyword sshconfigKeyword IPQoS
|
||||
syn keyword sshconfigKeyword KbdInteractiveAuthentication
|
||||
syn keyword sshconfigKeyword KbdInteractiveDevices
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
" Contributor: Leonard Ehrenfried <leonard.ehrenfried@web.de>
|
||||
" Contributor: Karsten Hopp <karsten@redhat.com>
|
||||
" Originally: 2009-07-09
|
||||
" Last Change: 2016 Mar 1
|
||||
" SSH Version: 7.2
|
||||
" Last Change: 2016 Dec 28
|
||||
" SSH Version: 7.4p1
|
||||
"
|
||||
|
||||
" Setup
|
||||
@@ -161,6 +161,7 @@ syn keyword sshdconfigKeyword Compression
|
||||
syn keyword sshdconfigKeyword DebianBanner
|
||||
syn keyword sshdconfigKeyword DenyGroups
|
||||
syn keyword sshdconfigKeyword DenyUsers
|
||||
syn keyword sshdconfigKeyword DisableForwarding
|
||||
syn keyword sshdconfigKeyword ForceCommand
|
||||
syn keyword sshdconfigKeyword GSSAPIAuthentication
|
||||
syn keyword sshdconfigKeyword GSSAPICleanupCredentials
|
||||
|
||||
+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
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -72,5 +72,11 @@
|
||||
<string></string>
|
||||
<key>zoomAll:</key>
|
||||
<string></string>
|
||||
<key>stayInFront:</key>
|
||||
<string></string>
|
||||
<key>stayInBack:</key>
|
||||
<string></string>
|
||||
<key>stayLevelNormal:</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -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>115</string>
|
||||
<string>127</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
|
||||
@@ -53,5 +53,8 @@
|
||||
- (IBAction)openWebsite:(id)sender;
|
||||
- (IBAction)showVimHelp:(id)sender;
|
||||
- (IBAction)zoomAll:(id)sender;
|
||||
- (IBAction)stayInFront:(id)sender;
|
||||
- (IBAction)stayInBack:(id)sender;
|
||||
- (IBAction)stayLevelNormal:(id)sender;
|
||||
|
||||
@end
|
||||
|
||||
@@ -233,6 +233,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
[NSNumber numberWithBool:NO], MMSuppressTerminationAlertKey,
|
||||
[NSNumber numberWithBool:YES], MMNativeFullScreenKey,
|
||||
[NSNumber numberWithDouble:0.25], MMFullScreenFadeTimeKey,
|
||||
[NSNumber numberWithBool:NO], MMUseCGLayerAlwaysKey,
|
||||
nil];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:dict];
|
||||
@@ -1195,6 +1196,27 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
[NSApp makeWindowsPerform:@selector(performZoom:) inOrder:YES];
|
||||
}
|
||||
|
||||
- (IBAction)stayInFront:(id)sender
|
||||
{
|
||||
ASLogDebug(@"Stay in Front");
|
||||
NSWindow *keyWindow = [NSApp keyWindow];
|
||||
[keyWindow setLevel:NSFloatingWindowLevel];
|
||||
}
|
||||
|
||||
- (IBAction)stayInBack:(id)sender
|
||||
{
|
||||
ASLogDebug(@"Stay in Back");
|
||||
NSWindow *keyWindow = [NSApp keyWindow];
|
||||
[keyWindow setLevel:kCGDesktopIconWindowLevel +1];
|
||||
}
|
||||
|
||||
- (IBAction)stayLevelNormal:(id)sender
|
||||
{
|
||||
ASLogDebug(@"Stay level normal");
|
||||
NSWindow *keyWindow = [NSApp keyWindow];
|
||||
[keyWindow setLevel:NSNormalWindowLevel];
|
||||
}
|
||||
|
||||
- (IBAction)coreTextButtonClicked:(id)sender
|
||||
{
|
||||
ASLogDebug(@"Toggle CoreText renderer");
|
||||
|
||||
+40
-1
@@ -198,6 +198,9 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
#ifdef FEAT_BEVAL
|
||||
- (void)bevalCallback:(id)sender;
|
||||
#endif
|
||||
#ifdef MESSAGE_QUEUE
|
||||
- (void)checkForProcessEvents:(NSTimer *)timer;
|
||||
#endif
|
||||
@end
|
||||
|
||||
|
||||
@@ -679,13 +682,26 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
|
||||
// Only start the run loop if the input queue is empty, otherwise process
|
||||
// the input first so that the input on queue isn't delayed.
|
||||
if ([inputQueue count]) {
|
||||
if ([inputQueue count] || input_available()) {
|
||||
inputReceived = YES;
|
||||
} else {
|
||||
// Wait for the specified amount of time, unless 'milliseconds' is
|
||||
// negative in which case we wait "forever" (1e6 seconds translates to
|
||||
// approximately 11 days).
|
||||
CFTimeInterval dt = (milliseconds >= 0 ? .001*milliseconds : 1e6);
|
||||
NSTimer *timer = nil;
|
||||
|
||||
// Set interval timer which checks for the events of job and channel
|
||||
// when there is any pending job or channel.
|
||||
if (dt > 0.1 && (has_any_channel() || has_pending_job())) {
|
||||
timer = [NSTimer scheduledTimerWithTimeInterval:0.1
|
||||
target:self
|
||||
selector:@selector(checkForProcessEvents:)
|
||||
userInfo:nil
|
||||
repeats:YES];
|
||||
[[NSRunLoop currentRunLoop] addTimer:timer
|
||||
forMode:NSDefaultRunLoopMode];
|
||||
}
|
||||
|
||||
while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, dt, true)
|
||||
== kCFRunLoopRunHandledSource) {
|
||||
@@ -695,6 +711,11 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
dt = 0.0;
|
||||
inputReceived = YES;
|
||||
}
|
||||
|
||||
if (input_available())
|
||||
inputReceived = YES;
|
||||
|
||||
[timer invalidate];
|
||||
}
|
||||
|
||||
// The above calls may have placed messages on the input queue so process
|
||||
@@ -3004,6 +3025,24 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MESSAGE_QUEUE
|
||||
- (void)checkForProcessEvents:(NSTimer *)timer
|
||||
{
|
||||
# ifdef FEAT_TIMERS
|
||||
did_add_timer = FALSE;
|
||||
# endif
|
||||
|
||||
parse_queued_messages();
|
||||
|
||||
if (input_available()
|
||||
# ifdef FEAT_TIMERS
|
||||
|| did_add_timer
|
||||
# endif
|
||||
)
|
||||
CFRunLoopStop(CFRunLoopGetCurrent());
|
||||
}
|
||||
#endif
|
||||
|
||||
@end // MMBackend (Private)
|
||||
|
||||
|
||||
|
||||
@@ -39,6 +39,11 @@
|
||||
CGPoint *positions;
|
||||
NSMutableArray *fontCache;
|
||||
|
||||
BOOL cgLayerEnabled;
|
||||
CGLayerRef cgLayer;
|
||||
CGContextRef cgLayerContext;
|
||||
NSLock *cgLayerLock;
|
||||
|
||||
// These are used in MMCoreTextView+ToolTip.m
|
||||
id trackingRectOwner_; // (not retained)
|
||||
void *trackingRectUserData_;
|
||||
@@ -85,6 +90,7 @@
|
||||
- (BOOL)convertPoint:(NSPoint)point toRow:(int *)row column:(int *)column;
|
||||
- (NSRect)rectForRow:(int)row column:(int)column numRows:(int)nr
|
||||
numColumns:(int)nc;
|
||||
- (void)setCGLayerEnabled:(BOOL)enabled;
|
||||
|
||||
//
|
||||
// NSTextView methods
|
||||
|
||||
+154
-25
@@ -132,6 +132,10 @@ defaultAdvanceForFont(NSFont *font)
|
||||
if (!(self = [super initWithFrame:frame]))
|
||||
return nil;
|
||||
|
||||
cgLayerEnabled = [[NSUserDefaults standardUserDefaults]
|
||||
boolForKey:MMUseCGLayerAlwaysKey];
|
||||
cgLayerLock = [NSLock new];
|
||||
|
||||
// NOTE! It does not matter which font is set here, Vim will set its
|
||||
// own font on startup anyway. Just set some bogus values.
|
||||
font = [[NSFont userFixedPitchFontOfSize:0] retain];
|
||||
@@ -586,25 +590,117 @@ defaultAdvanceForFont(NSFont *font)
|
||||
NSGraphicsContext *context = [NSGraphicsContext currentContext];
|
||||
[context setShouldAntialias:antialias];
|
||||
|
||||
id data;
|
||||
NSEnumerator *e = [drawData objectEnumerator];
|
||||
while ((data = [e nextObject]))
|
||||
[self batchDrawData:data];
|
||||
if (cgLayerEnabled && drawData.count == 0) {
|
||||
// during a live resize, we will have around a stale layer until the
|
||||
// refresh messages travel back from the vim process. We push the old
|
||||
// layer in at an offset to get rid of jitter due to lines changing
|
||||
// position.
|
||||
[cgLayerLock lock];
|
||||
CGLayerRef l = [self getCGLayer];
|
||||
CGSize cgLayerSize = CGLayerGetSize(l);
|
||||
CGSize frameSize = [self frame].size;
|
||||
NSRect drawRect = NSMakeRect(
|
||||
0,
|
||||
frameSize.height - cgLayerSize.height,
|
||||
cgLayerSize.width,
|
||||
cgLayerSize.height);
|
||||
|
||||
[drawData removeAllObjects];
|
||||
CGContextRef cgContext = [context graphicsPort];
|
||||
|
||||
const NSRect *rects;
|
||||
long count;
|
||||
[self getRectsBeingDrawn:&rects count:&count];
|
||||
|
||||
int i;
|
||||
for (i = 0; i < count; i++) {
|
||||
CGContextSaveGState(cgContext);
|
||||
CGContextClipToRect(cgContext, rects[i]);
|
||||
CGContextSetBlendMode(cgContext, kCGBlendModeCopy);
|
||||
CGContextDrawLayerInRect(cgContext, drawRect, l);
|
||||
CGContextRestoreGState(cgContext);
|
||||
}
|
||||
[cgLayerLock unlock];
|
||||
} else {
|
||||
id data;
|
||||
NSEnumerator *e = [drawData objectEnumerator];
|
||||
while ((data = [e nextObject]))
|
||||
[self batchDrawData:data];
|
||||
|
||||
[drawData removeAllObjects];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)performBatchDrawWithData:(NSData *)data
|
||||
{
|
||||
[drawData addObject:data];
|
||||
[self setNeedsDisplay:YES];
|
||||
if (cgLayerEnabled && drawData.count == 0 && [self getCGContext]) {
|
||||
[cgLayerLock lock];
|
||||
[self batchDrawData:data];
|
||||
[cgLayerLock unlock];
|
||||
} else {
|
||||
[drawData addObject:data];
|
||||
[self setNeedsDisplay:YES];
|
||||
|
||||
// NOTE: During resizing, Cocoa only sends draw messages before Vim's rows
|
||||
// and columns are changed (due to ipc delays). Force a redraw here.
|
||||
if ([self inLiveResize])
|
||||
[self display];
|
||||
// NOTE: During resizing, Cocoa only sends draw messages before Vim's rows
|
||||
// and columns are changed (due to ipc delays). Force a redraw here.
|
||||
if ([self inLiveResize])
|
||||
[self display];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setCGLayerEnabled:(BOOL)enabled
|
||||
{
|
||||
cgLayerEnabled = enabled;
|
||||
|
||||
if (!cgLayerEnabled)
|
||||
[self releaseCGLayer];
|
||||
}
|
||||
|
||||
- (void)releaseCGLayer
|
||||
{
|
||||
if (cgLayer) {
|
||||
CGLayerRelease(cgLayer);
|
||||
cgLayer = nil;
|
||||
cgLayerContext = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (CGLayerRef)getCGLayer
|
||||
{
|
||||
NSParameterAssert(cgLayerEnabled);
|
||||
if (!cgLayer && [self lockFocusIfCanDraw]) {
|
||||
NSGraphicsContext *context = [NSGraphicsContext currentContext];
|
||||
NSRect frame = [self frame];
|
||||
cgLayer = CGLayerCreateWithContext(
|
||||
[context graphicsPort], frame.size, NULL);
|
||||
[self unlockFocus];
|
||||
}
|
||||
return cgLayer;
|
||||
}
|
||||
|
||||
- (CGContextRef)getCGContext
|
||||
{
|
||||
if (cgLayerEnabled) {
|
||||
if (!cgLayerContext)
|
||||
cgLayerContext = CGLayerGetContext([self getCGLayer]);
|
||||
return cgLayerContext;
|
||||
} else {
|
||||
return [[NSGraphicsContext currentContext] graphicsPort];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setNeedsDisplayCGLayerInRect:(CGRect)rect
|
||||
{
|
||||
if (cgLayerEnabled)
|
||||
[self setNeedsDisplayInRect:rect];
|
||||
}
|
||||
|
||||
- (void)setNeedsDisplayCGLayer:(BOOL)flag
|
||||
{
|
||||
if (cgLayerEnabled)
|
||||
[self setNeedsDisplay:flag];
|
||||
}
|
||||
|
||||
|
||||
- (NSSize)constrainRows:(int *)rows columns:(int *)cols toSize:(NSSize)size
|
||||
{
|
||||
// TODO:
|
||||
@@ -852,7 +948,7 @@ defaultAdvanceForFont(NSFont *font)
|
||||
const void *end = bytes + [data length];
|
||||
|
||||
#if MM_DEBUG_DRAWING
|
||||
ASLogNotice(@"====> BEGIN %s", _cmd);
|
||||
ASLogNotice(@"====> BEGIN");
|
||||
#endif
|
||||
// TODO: Sanity check input
|
||||
|
||||
@@ -908,10 +1004,19 @@ defaultAdvanceForFont(NSFont *font)
|
||||
column:col
|
||||
numRows:height
|
||||
numColumns:width];
|
||||
[signImg drawInRect:r
|
||||
fromRect:NSZeroRect
|
||||
operation:NSCompositingOperationSourceOver
|
||||
fraction:1.0];
|
||||
if (cgLayerEnabled) {
|
||||
CGContextRef context = [self getCGContext];
|
||||
CGImageRef cgImage = [signImg CGImageForProposedRect:&r
|
||||
context:nil
|
||||
hints:nil];
|
||||
CGContextDrawImage(context, r, cgImage);
|
||||
} else {
|
||||
[signImg drawInRect:r
|
||||
fromRect:NSZeroRect
|
||||
operation:NSCompositingOperationSourceOver
|
||||
fraction:1.0];
|
||||
}
|
||||
[self setNeedsDisplayCGLayerInRect:r];
|
||||
} else if (DrawStringDrawType == type) {
|
||||
int bg = *((int*)bytes); bytes += sizeof(int);
|
||||
int fg = *((int*)bytes); bytes += sizeof(int);
|
||||
@@ -1013,11 +1118,11 @@ defaultAdvanceForFont(NSFont *font)
|
||||
}
|
||||
|
||||
#if MM_DEBUG_DRAWING
|
||||
ASLogNotice(@"<==== END %s", _cmd);
|
||||
ASLogNotice(@"<==== END");
|
||||
#endif
|
||||
}
|
||||
|
||||
static CTFontRef
|
||||
static CTFontRef
|
||||
lookupFont(NSMutableArray *fontCache, const unichar *chars, UniCharCount count,
|
||||
CTFontRef currFontRef)
|
||||
{
|
||||
@@ -1294,7 +1399,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
|
||||
withFlags:(int)flags foregroundColor:(int)fg
|
||||
backgroundColor:(int)bg specialColor:(int)sp
|
||||
{
|
||||
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
|
||||
CGContextRef context = [self getCGContext];
|
||||
NSRect frame = [self bounds];
|
||||
float x = col*cellSize.width + insetSize.width;
|
||||
float y = frame.size.height - insetSize.height - (1+row)*cellSize.height;
|
||||
@@ -1408,12 +1513,30 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
|
||||
if (thinStrokes)
|
||||
CGContextSetFontSmoothingStyle(context, originalFontSmoothingStyle);
|
||||
CGContextRestoreGState(context);
|
||||
|
||||
[self setNeedsDisplayCGLayerInRect:clipRect];
|
||||
}
|
||||
|
||||
- (void)scrollRect:(NSRect)rect lineCount:(int)count
|
||||
{
|
||||
NSSize delta={0, -count * cellSize.height};
|
||||
[self scrollRect:rect by:delta];
|
||||
if (cgLayerEnabled) {
|
||||
CGContextRef context = [self getCGContext];
|
||||
int yOffset = count * cellSize.height;
|
||||
NSRect clipRect = rect;
|
||||
clipRect.origin.y -= yOffset;
|
||||
|
||||
// draw self on top of self, offset so as to "scroll" lines vertically
|
||||
CGContextSaveGState(context);
|
||||
CGContextClipToRect(context, clipRect);
|
||||
CGContextSetBlendMode(context, kCGBlendModeCopy);
|
||||
CGContextDrawLayerAtPoint(
|
||||
context, CGPointMake(0, -yOffset), [self getCGLayer]);
|
||||
CGContextRestoreGState(context);
|
||||
[self setNeedsDisplayCGLayerInRect:clipRect];
|
||||
} else {
|
||||
NSSize delta={0, -count * cellSize.height};
|
||||
[self scrollRect:rect by:delta];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)deleteLinesFromRow:(int)row lineCount:(int)count
|
||||
@@ -1455,7 +1578,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
|
||||
- (void)clearBlockFromRow:(int)row1 column:(int)col1 toRow:(int)row2
|
||||
column:(int)col2 color:(int)color
|
||||
{
|
||||
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
|
||||
CGContextRef context = [self getCGContext];
|
||||
NSRect rect = [self rectFromRow:row1 column:col1 toRow:row2 column:col2];
|
||||
|
||||
CGContextSetRGBFillColor(context, RED(color), GREEN(color), BLUE(color),
|
||||
@@ -1464,11 +1587,13 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
|
||||
CGContextSetBlendMode(context, kCGBlendModeCopy);
|
||||
CGContextFillRect(context, *(CGRect*)&rect);
|
||||
CGContextSetBlendMode(context, kCGBlendModeNormal);
|
||||
[self setNeedsDisplayCGLayerInRect:rect];
|
||||
}
|
||||
|
||||
- (void)clearAll
|
||||
{
|
||||
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
|
||||
[self releaseCGLayer];
|
||||
CGContextRef context = [self getCGContext];
|
||||
NSRect rect = [self bounds];
|
||||
float r = [defaultBackgroundColor redComponent];
|
||||
float g = [defaultBackgroundColor greenComponent];
|
||||
@@ -1479,12 +1604,14 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
|
||||
CGContextSetRGBFillColor(context, r, g, b, a);
|
||||
CGContextFillRect(context, *(CGRect*)&rect);
|
||||
CGContextSetBlendMode(context, kCGBlendModeNormal);
|
||||
|
||||
[self setNeedsDisplayCGLayer:YES];
|
||||
}
|
||||
|
||||
- (void)drawInsertionPointAtRow:(int)row column:(int)col shape:(int)shape
|
||||
fraction:(int)percent color:(int)color
|
||||
{
|
||||
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
|
||||
CGContextRef context = [self getCGContext];
|
||||
NSRect rect = [self rectForRow:row column:col numRows:1 numColumns:1];
|
||||
|
||||
CGContextSaveGState(context);
|
||||
@@ -1526,6 +1653,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
|
||||
CGContextFillRect(context, *(CGRect*)&rect);
|
||||
}
|
||||
|
||||
[self setNeedsDisplayCGLayerInRect:rect];
|
||||
CGContextRestoreGState(context);
|
||||
}
|
||||
|
||||
@@ -1533,7 +1661,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
|
||||
numColumns:(int)ncols
|
||||
{
|
||||
// TODO: THIS CODE HAS NOT BEEN TESTED!
|
||||
CGContextRef cgctx = [[NSGraphicsContext currentContext] graphicsPort];
|
||||
CGContextRef cgctx = [self getCGContext];
|
||||
CGContextSaveGState(cgctx);
|
||||
CGContextSetBlendMode(cgctx, kCGBlendModeDifference);
|
||||
CGContextSetRGBFillColor(cgctx, 1.0, 1.0, 1.0, 1.0);
|
||||
@@ -1542,6 +1670,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
|
||||
numColumns:ncols];
|
||||
CGContextFillRect(cgctx, *(CGRect*)&rect);
|
||||
|
||||
[self setNeedsDisplayCGLayerInRect:rect];
|
||||
CGContextRestoreGState(cgctx);
|
||||
}
|
||||
|
||||
|
||||
@@ -172,6 +172,8 @@ enum {
|
||||
oldPosition = [view frame].origin;
|
||||
|
||||
[view removeFromSuperviewWithoutNeedingDisplay];
|
||||
if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_12)
|
||||
[[view textView] setCGLayerEnabled:YES];
|
||||
[[self contentView] addSubview:view];
|
||||
[self setInitialFirstResponder:[view textView]];
|
||||
|
||||
@@ -284,6 +286,9 @@ enum {
|
||||
[view setFrameOrigin:oldPosition];
|
||||
[self close];
|
||||
|
||||
if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_12)
|
||||
[[view textView] setCGLayerEnabled:NO];
|
||||
|
||||
// Set the text view to initial first responder, otherwise the 'plus'
|
||||
// button on the tabline steals the first responder status.
|
||||
[target setInitialFirstResponder:[view textView]];
|
||||
|
||||
@@ -72,4 +72,5 @@
|
||||
// NOT IMPLEMENTED (only in Core Text renderer)
|
||||
- (void)deleteSign:(NSString *)signName;
|
||||
- (void)setToolTipAtMousePoint:(NSString *)string;
|
||||
- (void)setCGLayerEnabled:(BOOL)enabled;
|
||||
@end
|
||||
|
||||
@@ -517,6 +517,11 @@
|
||||
// ONLY in Core Text!
|
||||
}
|
||||
|
||||
- (void)setCGLayerEnabled:(BOOL)enabled
|
||||
{
|
||||
// ONLY in Core Text!
|
||||
}
|
||||
|
||||
- (BOOL)isOpaque
|
||||
{
|
||||
return NO;
|
||||
|
||||
@@ -52,6 +52,7 @@ extern NSString *MMSuppressTerminationAlertKey;
|
||||
extern NSString *MMNativeFullScreenKey;
|
||||
extern NSString *MMUseMouseTimeKey;
|
||||
extern NSString *MMFullScreenFadeTimeKey;
|
||||
extern NSString *MMUseCGLayerAlwaysKey;
|
||||
|
||||
|
||||
// Enum for MMUntitledWindowKey
|
||||
|
||||
@@ -48,6 +48,7 @@ NSString *MMSuppressTerminationAlertKey = @"MMSuppressTerminationAlert";
|
||||
NSString *MMNativeFullScreenKey = @"MMNativeFullScreen";
|
||||
NSString *MMUseMouseTimeKey = @"MMUseMouseTime";
|
||||
NSString *MMFullScreenFadeTimeKey = @"MMFullScreenFadeTime";
|
||||
NSString *MMUseCGLayerAlwaysKey = @"MMUseCGLayerAlways";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,3 +13,25 @@ set backspace+=indent,eol,start
|
||||
" the entire MacVim menu is set up in a nib file which currently only is
|
||||
" translated to English).
|
||||
set langmenu=none
|
||||
|
||||
" Python2
|
||||
" MacVim uses Homebrew python2 if installed, otherwise configured one
|
||||
if exists("&pythondll") && exists("&pythonhome")
|
||||
if filereadable("/usr/local/Frameworks/Python.framework/Versions/2.7/Python")
|
||||
" Homebrew python 2.7
|
||||
set pythondll=/usr/local/Frameworks/Python.framework/Versions/2.7/Python
|
||||
set pythonhome=/usr/local/Frameworks/Python.framework/Versions/2.7
|
||||
endif
|
||||
endif
|
||||
|
||||
" Python3
|
||||
" MacVim uses Homebrew python3 if installed, next try to use python.org binary
|
||||
if exists("&pythonthreedll") && exists("&pythonthreehome") &&
|
||||
\ !filereadable(&pythonthreedll)
|
||||
if filereadable("/Library/Frameworks/Python.framework/Versions/3.5/Python")
|
||||
" https://www.python.org/downloads/mac-osx/
|
||||
set pythonthreedll=/Library/Frameworks/Python.framework/Versions/3.5/Python
|
||||
set pythonthreehome=/Library/Frameworks/Python.framework/Versions/3.5
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -81,6 +81,13 @@ ifndef STATIC_STDCPLUS
|
||||
STATIC_STDCPLUS=no
|
||||
endif
|
||||
|
||||
|
||||
# Link against the shared version of libwinpthread by default. Set
|
||||
# STATIC_WINPTHREAD to "yes" to link against static version instead.
|
||||
ifndef STATIC_WINPTHREAD
|
||||
STATIC_WINPTHREAD=$(STATIC_STDCPLUS)
|
||||
endif
|
||||
|
||||
# If the user doesn't want gettext, undefine it.
|
||||
ifeq (no, $(GETTEXT))
|
||||
GETTEXT=
|
||||
@@ -817,6 +824,10 @@ LIB += -lstdc++
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq (yes, $(STATIC_WINPTHREAD))
|
||||
LIB += -Wl,-Bstatic -lwinpthread -Wl,-Bdynamic
|
||||
endif
|
||||
|
||||
all: $(TARGET) vimrun.exe xxd/xxd.exe install.exe uninstal.exe GvimExt/gvimext.dll
|
||||
|
||||
vimrun.exe: vimrun.c
|
||||
|
||||
+14
-4
@@ -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
|
||||
@@ -297,6 +299,9 @@ CPU = ix86
|
||||
# Flag to turn on Win64 compatibility warnings for VC7.x and VC8.
|
||||
WP64CHECK = /Wp64
|
||||
|
||||
# Use multiprocess build
|
||||
USE_MP = yes
|
||||
|
||||
#>>>>> path of the compiler and linker; name of include and lib directories
|
||||
# PATH = c:\msvc20\bin;$(PATH)
|
||||
# INCLUDE = c:\msvc20\include
|
||||
@@ -473,6 +478,14 @@ NODEFAULTLIB =
|
||||
NODEFAULTLIB = /nodefaultlib
|
||||
!endif
|
||||
|
||||
# Use multiprocess build on MSVC 10
|
||||
!if "$(USE_MP)"=="yes"
|
||||
!if $(MSVC_MAJOR) >= 10
|
||||
CFLAGS = $(CFLAGS) /MP
|
||||
!endif
|
||||
!endif
|
||||
|
||||
|
||||
!ifdef NODEBUG
|
||||
VIM = vim
|
||||
!if "$(OPTIMIZE)" == "SPACE"
|
||||
@@ -1112,9 +1125,6 @@ clean:
|
||||
cd GvimExt
|
||||
$(MAKE) /NOLOGO -f Makefile clean
|
||||
cd ..
|
||||
cd GvimExt
|
||||
$(MAKE) /NOLOGO -f Makefile clean
|
||||
cd ..
|
||||
- if exist testdir\*.out del testdir\*.out
|
||||
|
||||
test:
|
||||
|
||||
+103
-27
@@ -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 \
|
||||
@@ -1695,27 +1696,55 @@ OBJ_COMMON = \
|
||||
$(WSDEBUG_OBJ)
|
||||
|
||||
# The files included by tests are not in OBJ_COMMON.
|
||||
OBJ = $(OBJ_COMMON) \
|
||||
OBJ_MAIN = \
|
||||
objects/charset.o \
|
||||
objects/json.o \
|
||||
objects/main.o \
|
||||
objects/memfile.o \
|
||||
objects/message.o
|
||||
|
||||
JSON_TEST_OBJ = $(OBJ_COMMON) \
|
||||
OBJ = $(OBJ_COMMON) $(OBJ_MAIN)
|
||||
|
||||
OBJ_JSON_TEST = \
|
||||
objects/charset.o \
|
||||
objects/memfile.o \
|
||||
objects/message.o \
|
||||
objects/json_test.o
|
||||
|
||||
MEMFILE_TEST_OBJ = $(OBJ_COMMON) \
|
||||
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
|
||||
|
||||
MESSAGE_TEST_OBJ = $(OBJ_COMMON) \
|
||||
MEMFILE_TEST_OBJ = $(OBJ_COMMON) $(OBJ_MEMFILE_TEST)
|
||||
|
||||
OBJ_MESSAGE_TEST = \
|
||||
objects/charset.o \
|
||||
objects/json.o \
|
||||
objects/memfile.o \
|
||||
objects/message_test.o
|
||||
|
||||
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)
|
||||
|
||||
|
||||
PRO_AUTO = \
|
||||
arabic.pro \
|
||||
blowfish.pro \
|
||||
@@ -1879,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.
|
||||
@@ -2036,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;
|
||||
|
||||
@@ -2055,10 +2089,7 @@ test1 \
|
||||
test_getcwd \
|
||||
test_insertcount \
|
||||
test_listchars \
|
||||
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 \
|
||||
@@ -2069,7 +2100,7 @@ test1 \
|
||||
test60 test64 test65 test66 test67 test68 test69 \
|
||||
test70 test72 test73 test74 test75 test77 test78 test79 \
|
||||
test80 test82 test83 test84 test85 test86 test87 test88 test89 \
|
||||
test90 test91 test92 test93 test94 test95 test97 test98 test99 \
|
||||
test90 test91 test94 test95 test97 test98 test99 \
|
||||
test100 test101 test103 test104 test107 test108:
|
||||
cd testdir; rm -f $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
|
||||
|
||||
@@ -2093,6 +2124,8 @@ test_arglist \
|
||||
test_delete \
|
||||
test_diffmode \
|
||||
test_digraph \
|
||||
test_functions \
|
||||
test_display \
|
||||
test_ex_undo \
|
||||
test_execute_func \
|
||||
test_expand \
|
||||
@@ -2105,10 +2138,13 @@ test_arglist \
|
||||
test_fileformat \
|
||||
test_filter_cmd \
|
||||
test_filter_map \
|
||||
test_float_func \
|
||||
test_fnameescape \
|
||||
test_fnamemodify \
|
||||
test_glob2regpat \
|
||||
test_fold \
|
||||
test_ga \
|
||||
test_gf \
|
||||
test_glob2regpat \
|
||||
test_gn \
|
||||
test_goto \
|
||||
test_gui \
|
||||
@@ -2127,6 +2163,9 @@ test_arglist \
|
||||
test_langmap \
|
||||
test_largefile \
|
||||
test_lispwords \
|
||||
test_listlbr \
|
||||
test_listlbr_utf8 \
|
||||
test_lua \
|
||||
test_man \
|
||||
test_mapping \
|
||||
test_marks \
|
||||
@@ -2135,26 +2174,36 @@ test_arglist \
|
||||
test_matchadd_conceal_utf8 \
|
||||
test_menu \
|
||||
test_messages \
|
||||
test_mksession \
|
||||
test_mksession_utf8 \
|
||||
test_nested_function \
|
||||
test_netbeans \
|
||||
test_normal \
|
||||
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 \
|
||||
@@ -2162,16 +2211,19 @@ test_arglist \
|
||||
test_substitute \
|
||||
test_syn_attr \
|
||||
test_syntax \
|
||||
test_system \
|
||||
test_tabline \
|
||||
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 \
|
||||
@@ -2209,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) \
|
||||
@@ -2743,6 +2802,7 @@ shadow: runtime pixmaps
|
||||
../../testdir/*.vim \
|
||||
../../testdir/*.py \
|
||||
../../testdir/python* \
|
||||
../../testdir/pyxfile \
|
||||
../../testdir/sautest \
|
||||
../../testdir/samples \
|
||||
../../testdir/test83-tags? \
|
||||
@@ -2868,8 +2928,16 @@ auto/gui_gtk_gresources.h: gui_gtk_res.xml $(GUI_GTK_RES_INPUTS)
|
||||
# commands understand putting object files in another directory, it must be
|
||||
# specified for each file separately.
|
||||
|
||||
objects:
|
||||
mkdir objects
|
||||
objects: objects/.dirstamp
|
||||
|
||||
objects/.dirstamp:
|
||||
mkdir -p objects
|
||||
touch objects/.dirstamp
|
||||
|
||||
# All object files depend on the objects directory, so that parallel make
|
||||
# works. Can't depend on the directory itself, its timestamp changes all the
|
||||
# time.
|
||||
$(ALL_OBJ): objects/.dirstamp
|
||||
|
||||
objects/MMBackend.o: MacVim/MMBackend.m
|
||||
$(CCC) -fobjc-exceptions -o $@ MacVim/MMBackend.m
|
||||
@@ -2968,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
|
||||
@@ -3004,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
|
||||
@@ -3013,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
|
||||
@@ -3044,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
|
||||
|
||||
@@ -3090,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
|
||||
@@ -3616,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
+15
-4
@@ -7233,6 +7233,12 @@ $as_echo "$rubyhdrdir" >&6; }
|
||||
rubyarchdir=`$vi_cv_path_ruby -r rbconfig -e "print ($ruby_rbconfig::CONFIG.has_key? 'rubyarchhdrdir') ? $ruby_rbconfig::CONFIG['rubyarchhdrdir'] : '$rubyhdrdir/'+$ruby_rbconfig::CONFIG['arch']"`
|
||||
if test -d "$rubyarchdir"; then
|
||||
RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyarchdir"
|
||||
else
|
||||
dnl rbconfig says darwin15 but 10.12 SDK has darwin16
|
||||
rubyarchdir=${rubyarchdir/darwin15/darwin16}
|
||||
if test -d "$rubyarchdir"; then
|
||||
RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyarchdir"
|
||||
fi
|
||||
fi
|
||||
rubyversion=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['ruby_version'].gsub(/\./, '')[0,2]"`
|
||||
if test "X$rubyversion" = "X"; then
|
||||
@@ -7251,7 +7257,7 @@ $as_echo "$rubyhdrdir" >&6; }
|
||||
RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
|
||||
elif test -d "/System/Library/Frameworks/Ruby.framework"; then
|
||||
RUBY_LIBS="-framework Ruby"
|
||||
RUBY_CFLAGS="-DRUBY_VERSION=$rubyversion"
|
||||
RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion"
|
||||
librubyarg=
|
||||
fi
|
||||
|
||||
@@ -7502,7 +7508,7 @@ $as_echo_n "checking whether compiling with process communication is possible...
|
||||
/* Check bitfields */
|
||||
struct nbbuf {
|
||||
unsigned int initDone:1;
|
||||
ushort signmaplen;
|
||||
unsigned short signmaplen;
|
||||
};
|
||||
|
||||
int
|
||||
@@ -12118,8 +12124,8 @@ if test "x$vim_cv_getcwd_broken" = "xyes" ; then
|
||||
|
||||
fi
|
||||
|
||||
for ac_func in bcmp fchdir fchown fsync getcwd getpseudotty \
|
||||
getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
|
||||
for ac_func in fchdir fchown fsync getcwd getpseudotty \
|
||||
getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat \
|
||||
memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
|
||||
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
|
||||
sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \
|
||||
@@ -14186,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
|
||||
|
||||
|
||||
+11
-7
@@ -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
|
||||
@@ -4868,8 +4872,8 @@ do_arg_all(
|
||||
wpnext = wp->w_next;
|
||||
buf = wp->w_buffer;
|
||||
if (buf->b_ffname == NULL
|
||||
|| (!keep_tabs && buf->b_nwindows > 1)
|
||||
|| wp->w_width != Columns)
|
||||
|| (!keep_tabs && (buf->b_nwindows > 1
|
||||
|| wp->w_width != Columns)))
|
||||
i = opened_len;
|
||||
else
|
||||
{
|
||||
|
||||
+187
-39
@@ -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
|
||||
@@ -1216,6 +1223,7 @@ channel_set_options(channel_T *channel, jobopt_T *opt)
|
||||
if (opt->jo_set & JO_CLOSE_CALLBACK)
|
||||
set_callback(&channel->ch_close_cb, &channel->ch_close_partial,
|
||||
opt->jo_close_cb, opt->jo_close_partial);
|
||||
channel->ch_drop_never = opt->jo_drop_never;
|
||||
|
||||
if ((opt->jo_set & JO_OUT_IO) && opt->jo_io[PART_OUT] == JIO_BUFFER)
|
||||
{
|
||||
@@ -1587,7 +1595,7 @@ invoke_callback(channel_T *channel, char_u *callback, partial_T *partial,
|
||||
int dummy;
|
||||
|
||||
if (safe_to_invoke_callback == 0)
|
||||
EMSG("INTERNAL: Invoking callback when it is not safe");
|
||||
IEMSG("INTERNAL: Invoking callback when it is not safe");
|
||||
|
||||
argv[0].v_type = VAR_CHANNEL;
|
||||
argv[0].vval.v_channel = channel;
|
||||
@@ -1853,39 +1861,42 @@ channel_save(channel_T *channel, ch_part_T part, char_u *buf, int len,
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to fill the buffer of "reader".
|
||||
* Returns FALSE when nothing was added.
|
||||
*/
|
||||
static int
|
||||
channel_fill(js_read_T *reader)
|
||||
{
|
||||
channel_T *channel = (channel_T *)reader->js_cookie;
|
||||
ch_part_T part = reader->js_cookie_arg;
|
||||
char_u *next = channel_get(channel, part);
|
||||
int unused;
|
||||
int len;
|
||||
int keeplen;
|
||||
int addlen;
|
||||
char_u *p;
|
||||
|
||||
if (next == NULL)
|
||||
return FALSE;
|
||||
|
||||
unused = reader->js_end - reader->js_buf - reader->js_used;
|
||||
if (unused > 0)
|
||||
keeplen = reader->js_end - reader->js_buf;
|
||||
if (keeplen > 0)
|
||||
{
|
||||
/* Prepend unused text. */
|
||||
len = (int)STRLEN(next);
|
||||
p = alloc(unused + len + 1);
|
||||
addlen = (int)STRLEN(next);
|
||||
p = alloc(keeplen + addlen + 1);
|
||||
if (p == NULL)
|
||||
{
|
||||
vim_free(next);
|
||||
return FALSE;
|
||||
}
|
||||
mch_memmove(p, reader->js_buf + reader->js_used, unused);
|
||||
mch_memmove(p + unused, next, len + 1);
|
||||
mch_memmove(p, reader->js_buf, keeplen);
|
||||
mch_memmove(p + keeplen, next, addlen + 1);
|
||||
vim_free(next);
|
||||
next = p;
|
||||
}
|
||||
|
||||
vim_free(reader->js_buf);
|
||||
reader->js_buf = next;
|
||||
reader->js_used = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1916,9 +1927,12 @@ channel_parse_json(channel_T *channel, ch_part_T part)
|
||||
|
||||
/* When a message is incomplete we wait for a short while for more to
|
||||
* arrive. After the delay drop the input, otherwise a truncated string
|
||||
* or list will make us hang. */
|
||||
* or list will make us hang.
|
||||
* Do not generate error messages, they will be written in a channel log. */
|
||||
++emsg_silent;
|
||||
status = json_decode(&reader, &listtv,
|
||||
chanpart->ch_mode == MODE_JS ? JSON_JS : 0);
|
||||
--emsg_silent;
|
||||
if (status == OK)
|
||||
{
|
||||
/* Only accept the response when it is a list with at least two
|
||||
@@ -1939,6 +1953,7 @@ channel_parse_json(channel_T *channel, ch_part_T part)
|
||||
clear_tv(&listtv);
|
||||
else
|
||||
{
|
||||
item->jq_no_callback = FALSE;
|
||||
item->jq_value = alloc_tv();
|
||||
if (item->jq_value == NULL)
|
||||
{
|
||||
@@ -1961,16 +1976,20 @@ channel_parse_json(channel_T *channel, ch_part_T part)
|
||||
}
|
||||
|
||||
if (status == OK)
|
||||
chanpart->ch_waiting = FALSE;
|
||||
chanpart->ch_wait_len = 0;
|
||||
else if (status == MAYBE)
|
||||
{
|
||||
if (!chanpart->ch_waiting)
|
||||
size_t buflen = STRLEN(reader.js_buf);
|
||||
|
||||
if (chanpart->ch_wait_len < buflen)
|
||||
{
|
||||
/* First time encountering incomplete message, set a deadline of
|
||||
* 100 msec. */
|
||||
ch_log(channel, "Incomplete message - wait for more");
|
||||
/* First time encountering incomplete message or after receiving
|
||||
* more (but still incomplete): set a deadline of 100 msec. */
|
||||
ch_logn(channel,
|
||||
"Incomplete message (%d bytes) - wait 100 msec for more",
|
||||
buflen);
|
||||
reader.js_used = 0;
|
||||
chanpart->ch_waiting = TRUE;
|
||||
chanpart->ch_wait_len = buflen;
|
||||
#ifdef WIN32
|
||||
chanpart->ch_deadline = GetTickCount() + 100L;
|
||||
#else
|
||||
@@ -2001,7 +2020,8 @@ channel_parse_json(channel_T *channel, ch_part_T part)
|
||||
if (timeout)
|
||||
{
|
||||
status = FAIL;
|
||||
chanpart->ch_waiting = FALSE;
|
||||
chanpart->ch_wait_len = 0;
|
||||
ch_log(channel, "timed out");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2015,7 +2035,7 @@ channel_parse_json(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
ch_error(channel, "Decoding failed - discarding input");
|
||||
ret = FALSE;
|
||||
chanpart->ch_waiting = FALSE;
|
||||
chanpart->ch_wait_len = 0;
|
||||
}
|
||||
else if (reader.js_buf[reader.js_used] != NUL)
|
||||
{
|
||||
@@ -2071,11 +2091,17 @@ remove_json_node(jsonq_T *head, jsonq_T *node)
|
||||
* When "id" is positive it must match the first number in the list.
|
||||
* When "id" is zero or negative jut get the first message. But not the one
|
||||
* with id ch_block_id.
|
||||
* When "without_callback" is TRUE also get messages that were pushed back.
|
||||
* Return OK when found and return the value in "rettv".
|
||||
* Return FAIL otherwise.
|
||||
*/
|
||||
static int
|
||||
channel_get_json(channel_T *channel, ch_part_T part, int id, typval_T **rettv)
|
||||
channel_get_json(
|
||||
channel_T *channel,
|
||||
ch_part_T part,
|
||||
int id,
|
||||
int without_callback,
|
||||
typval_T **rettv)
|
||||
{
|
||||
jsonq_T *head = &channel->ch_part[part].ch_json_head;
|
||||
jsonq_T *item = head->jq_next;
|
||||
@@ -2085,10 +2111,11 @@ channel_get_json(channel_T *channel, ch_part_T part, int id, typval_T **rettv)
|
||||
list_T *l = item->jq_value->vval.v_list;
|
||||
typval_T *tv = &l->lv_first->li_tv;
|
||||
|
||||
if ((id > 0 && tv->v_type == VAR_NUMBER && tv->vval.v_number == id)
|
||||
if ((without_callback || !item->jq_no_callback)
|
||||
&& ((id > 0 && tv->v_type == VAR_NUMBER && tv->vval.v_number == id)
|
||||
|| (id <= 0 && (tv->v_type != VAR_NUMBER
|
||||
|| tv->vval.v_number == 0
|
||||
|| tv->vval.v_number != channel->ch_part[part].ch_block_id)))
|
||||
|| tv->vval.v_number != channel->ch_part[part].ch_block_id))))
|
||||
{
|
||||
*rettv = item->jq_value;
|
||||
if (tv->v_type == VAR_NUMBER)
|
||||
@@ -2101,6 +2128,65 @@ channel_get_json(channel_T *channel, ch_part_T part, int id, typval_T **rettv)
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Put back "rettv" into the JSON queue, there was no callback for it.
|
||||
* Takes over the values in "rettv".
|
||||
*/
|
||||
static void
|
||||
channel_push_json(channel_T *channel, ch_part_T part, typval_T *rettv)
|
||||
{
|
||||
jsonq_T *head = &channel->ch_part[part].ch_json_head;
|
||||
jsonq_T *item = head->jq_next;
|
||||
jsonq_T *newitem;
|
||||
|
||||
if (head->jq_prev != NULL && head->jq_prev->jq_no_callback)
|
||||
/* last item was pushed back, append to the end */
|
||||
item = NULL;
|
||||
else while (item != NULL && item->jq_no_callback)
|
||||
/* append after the last item that was pushed back */
|
||||
item = item->jq_next;
|
||||
|
||||
newitem = (jsonq_T *)alloc((unsigned)sizeof(jsonq_T));
|
||||
if (newitem == NULL)
|
||||
clear_tv(rettv);
|
||||
else
|
||||
{
|
||||
newitem->jq_value = alloc_tv();
|
||||
if (newitem->jq_value == NULL)
|
||||
{
|
||||
vim_free(newitem);
|
||||
clear_tv(rettv);
|
||||
}
|
||||
else
|
||||
{
|
||||
newitem->jq_no_callback = FALSE;
|
||||
*newitem->jq_value = *rettv;
|
||||
if (item == NULL)
|
||||
{
|
||||
/* append to the end */
|
||||
newitem->jq_prev = head->jq_prev;
|
||||
head->jq_prev = newitem;
|
||||
newitem->jq_next = NULL;
|
||||
if (newitem->jq_prev == NULL)
|
||||
head->jq_next = newitem;
|
||||
else
|
||||
newitem->jq_prev->jq_next = newitem;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* append after "item" */
|
||||
newitem->jq_prev = item;
|
||||
newitem->jq_next = item->jq_next;
|
||||
item->jq_next = newitem;
|
||||
if (newitem->jq_next == NULL)
|
||||
head->jq_prev = newitem;
|
||||
else
|
||||
newitem->jq_next->jq_prev = newitem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define CH_JSON_MAX_ARGS 4
|
||||
|
||||
/*
|
||||
@@ -2431,11 +2517,11 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
|
||||
int argc = 0;
|
||||
|
||||
/* Get any json message in the queue. */
|
||||
if (channel_get_json(channel, part, -1, &listtv) == FAIL)
|
||||
if (channel_get_json(channel, part, -1, FALSE, &listtv) == FAIL)
|
||||
{
|
||||
/* Parse readahead, return when there is still no message. */
|
||||
channel_parse_json(channel, part);
|
||||
if (channel_get_json(channel, part, -1, &listtv) == FAIL)
|
||||
if (channel_get_json(channel, part, -1, FALSE, &listtv) == FAIL)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -2475,7 +2561,7 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
/* If there is a close callback it may use ch_read() to get the
|
||||
* messages. */
|
||||
if (channel->ch_close_cb == NULL)
|
||||
if (channel->ch_close_cb == NULL && !channel->ch_drop_never)
|
||||
drop_messages(channel, part);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2552,7 +2638,7 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
int done = FALSE;
|
||||
|
||||
/* invoke the one-time callback with the matching nr */
|
||||
/* JSON or JS mode: invoke the one-time callback with the matching nr */
|
||||
for (cbitem = cbhead->cq_next; cbitem != NULL; cbitem = cbitem->cq_next)
|
||||
if (cbitem->cq_seq_nr == seq_nr)
|
||||
{
|
||||
@@ -2561,7 +2647,17 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
|
||||
break;
|
||||
}
|
||||
if (!done)
|
||||
ch_logn(channel, "Dropping message %d without callback", seq_nr);
|
||||
{
|
||||
if (channel->ch_drop_never)
|
||||
{
|
||||
/* message must be read with ch_read() */
|
||||
channel_push_json(channel, part, listtv);
|
||||
listtv = NULL;
|
||||
}
|
||||
else
|
||||
ch_logn(channel, "Dropping message %d without callback",
|
||||
seq_nr);
|
||||
}
|
||||
}
|
||||
else if (callback != NULL || buffer != NULL)
|
||||
{
|
||||
@@ -2588,7 +2684,7 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
|
||||
}
|
||||
}
|
||||
else
|
||||
ch_log(channel, "Dropping message");
|
||||
ch_logn(channel, "Dropping message %d", seq_nr);
|
||||
|
||||
if (listtv != NULL)
|
||||
free_tv(listtv);
|
||||
@@ -2624,7 +2720,7 @@ channel_is_open(channel_T *channel)
|
||||
/*
|
||||
* Return TRUE if "channel" has JSON or other typeahead.
|
||||
*/
|
||||
static int
|
||||
int
|
||||
channel_has_readahead(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
ch_mode_T ch_mode = channel->ch_part[part].ch_mode;
|
||||
@@ -2813,9 +2909,10 @@ channel_close(channel_T *channel, int invoke_close_cb)
|
||||
redraw_after_callback();
|
||||
}
|
||||
|
||||
/* any remaining messages are useless now */
|
||||
for (part = PART_SOCK; part < PART_IN; ++part)
|
||||
drop_messages(channel, part);
|
||||
if (!channel->ch_drop_never)
|
||||
/* any remaining messages are useless now */
|
||||
for (part = PART_SOCK; part < PART_IN; ++part)
|
||||
drop_messages(channel, part);
|
||||
}
|
||||
|
||||
channel->ch_nb_close_cb = NULL;
|
||||
@@ -3112,9 +3209,9 @@ ch_close_part_on_error(
|
||||
channel_close_now(channel_T *channel)
|
||||
{
|
||||
ch_log(channel, "Closing channel because all readable fds are closed");
|
||||
channel_close(channel, TRUE);
|
||||
if (channel->ch_nb_close_cb != NULL)
|
||||
(*channel->ch_nb_close_cb)();
|
||||
channel_close(channel, TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3268,7 +3365,7 @@ channel_read_block(channel_T *channel, ch_part_T part, int timeout)
|
||||
* When "id" is -1 accept any message;
|
||||
* Blocks until the message is received or the timeout is reached.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
channel_read_json_block(
|
||||
channel_T *channel,
|
||||
ch_part_T part,
|
||||
@@ -3289,7 +3386,7 @@ channel_read_json_block(
|
||||
more = channel_parse_json(channel, part);
|
||||
|
||||
/* search for message "id" */
|
||||
if (channel_get_json(channel, part, id, rettv) == OK)
|
||||
if (channel_get_json(channel, part, id, TRUE, rettv) == OK)
|
||||
{
|
||||
chanpart->ch_block_id = 0;
|
||||
return OK;
|
||||
@@ -3305,7 +3402,7 @@ channel_read_json_block(
|
||||
/* Wait for up to the timeout. If there was an incomplete message
|
||||
* use the deadline for that. */
|
||||
timeout = timeout_arg;
|
||||
if (chanpart->ch_waiting)
|
||||
if (chanpart->ch_wait_len > 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
timeout = chanpart->ch_deadline - GetTickCount() + 1;
|
||||
@@ -3325,7 +3422,7 @@ channel_read_json_block(
|
||||
{
|
||||
/* Something went wrong, channel_parse_json() didn't
|
||||
* discard message. Cancel waiting. */
|
||||
chanpart->ch_waiting = FALSE;
|
||||
chanpart->ch_wait_len = 0;
|
||||
timeout = timeout_arg;
|
||||
}
|
||||
else if (timeout > timeout_arg)
|
||||
@@ -3840,6 +3937,11 @@ channel_parse_messages(void)
|
||||
int ret = FALSE;
|
||||
int r;
|
||||
ch_part_T part = PART_SOCK;
|
||||
#ifdef ELAPSED_FUNC
|
||||
ELAPSED_TYPE start_tv;
|
||||
|
||||
ELAPSED_INIT(start_tv);
|
||||
#endif
|
||||
|
||||
++safe_to_invoke_callback;
|
||||
|
||||
@@ -3884,7 +3986,14 @@ channel_parse_messages(void)
|
||||
r = may_invoke_callback(channel, part);
|
||||
if (r == OK)
|
||||
ret = TRUE;
|
||||
if (channel_unref(channel) || r == OK)
|
||||
if (channel_unref(channel) || (r == OK
|
||||
#ifdef ELAPSED_FUNC
|
||||
/* Limit the time we loop here to 100 msec, otherwise
|
||||
* Vim becomes unresponsive when the callback takes
|
||||
* more than a bit of time. */
|
||||
&& ELAPSED_FUNC(start_tv) < 100L
|
||||
#endif
|
||||
))
|
||||
{
|
||||
/* channel was freed or something was done, start over */
|
||||
channel = first_channel;
|
||||
@@ -3912,6 +4021,31 @@ channel_parse_messages(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if any channel has readahead. That means we should not block on
|
||||
* waiting for input.
|
||||
*/
|
||||
int
|
||||
channel_any_readahead(void)
|
||||
{
|
||||
channel_T *channel = first_channel;
|
||||
ch_part_T part = PART_SOCK;
|
||||
|
||||
while (channel != NULL)
|
||||
{
|
||||
if (channel_has_readahead(channel, part))
|
||||
return TRUE;
|
||||
if (part < PART_ERR)
|
||||
++part;
|
||||
else
|
||||
{
|
||||
channel = channel->ch_next;
|
||||
part = PART_SOCK;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark references to lists used in channels.
|
||||
*/
|
||||
@@ -4278,6 +4412,20 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported)
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
else if (STRCMP(hi->hi_key, "drop") == 0)
|
||||
{
|
||||
int never = FALSE;
|
||||
val = get_tv_string(item);
|
||||
|
||||
if (STRCMP(val, "never") == 0)
|
||||
never = TRUE;
|
||||
else if (STRCMP(val, "auto") != 0)
|
||||
{
|
||||
EMSG2(_(e_invarg2), "drop");
|
||||
return FAIL;
|
||||
}
|
||||
opt->jo_drop_never = never;
|
||||
}
|
||||
else if (STRCMP(hi->hi_key, "exit_cb") == 0)
|
||||
{
|
||||
if (!(supported & JO_EXIT_CB))
|
||||
|
||||
+54
-18
@@ -887,7 +887,7 @@ vim_isIDc(int c)
|
||||
|
||||
/*
|
||||
* return TRUE if 'c' is a keyword character: Letters and characters from
|
||||
* 'iskeyword' option for current buffer.
|
||||
* 'iskeyword' option for the current buffer.
|
||||
* For multi-byte characters mb_get_class() is used (builtin rules).
|
||||
*/
|
||||
int
|
||||
@@ -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,18 @@ getvcol(
|
||||
if (pos->col == MAXCOL)
|
||||
posptr = NULL; /* continue until the NUL */
|
||||
else
|
||||
{
|
||||
/* Special check for an empty line, which can happen on exit, when
|
||||
* ml_get_buf() always returns an empty string. */
|
||||
if (*ptr == NUL)
|
||||
pos->col = 0;
|
||||
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 +1911,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 +1926,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 +1943,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 +1958,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 +1976,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;
|
||||
|
||||
@@ -154,7 +154,6 @@
|
||||
#undef BAD_GETCWD
|
||||
|
||||
/* Define if you the function: */
|
||||
#undef HAVE_BCMP
|
||||
#undef HAVE_FCHDIR
|
||||
#undef HAVE_FCHOWN
|
||||
#undef HAVE_FSEEKO
|
||||
@@ -170,7 +169,6 @@
|
||||
#undef HAVE_ICONV
|
||||
#undef HAVE_NL_LANGINFO_CODESET
|
||||
#undef HAVE_LSTAT
|
||||
#undef HAVE_MEMCMP
|
||||
#undef HAVE_MEMSET
|
||||
#undef HAVE_MKDTEMP
|
||||
#undef HAVE_NANOSLEEP
|
||||
|
||||
+16
-4
@@ -1904,6 +1904,12 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
|
||||
rubyarchdir=`$vi_cv_path_ruby -r rbconfig -e "print ($ruby_rbconfig::CONFIG.has_key? 'rubyarchhdrdir') ? $ruby_rbconfig::CONFIG[['rubyarchhdrdir']] : '$rubyhdrdir/'+$ruby_rbconfig::CONFIG[['arch']]"`
|
||||
if test -d "$rubyarchdir"; then
|
||||
RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyarchdir"
|
||||
else
|
||||
dnl rbconfig says darwin15 but 10.12 SDK has darwin16
|
||||
rubyarchdir=${rubyarchdir/darwin15/darwin16}
|
||||
if test -d "$rubyarchdir"; then
|
||||
RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyarchdir"
|
||||
fi
|
||||
fi
|
||||
rubyversion=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['ruby_version']].gsub(/\./, '')[[0,2]]"`
|
||||
if test "X$rubyversion" = "X"; then
|
||||
@@ -1924,7 +1930,7 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
|
||||
dnl On Mac OS X it is safer to just use the -framework flag
|
||||
RUBY_LIBS="-framework Ruby"
|
||||
dnl Don't include the -I flag when -framework is set
|
||||
RUBY_CFLAGS="-DRUBY_VERSION=$rubyversion"
|
||||
RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion"
|
||||
librubyarg=
|
||||
fi
|
||||
|
||||
@@ -2053,7 +2059,7 @@ if test "$enable_channel" = "yes"; then
|
||||
/* Check bitfields */
|
||||
struct nbbuf {
|
||||
unsigned int initDone:1;
|
||||
ushort signmaplen;
|
||||
unsigned short signmaplen;
|
||||
};
|
||||
], [
|
||||
/* Check creating a socket. */
|
||||
@@ -3673,8 +3679,8 @@ fi
|
||||
|
||||
dnl Check for functions in one big call, to reduce the size of configure.
|
||||
dnl Can only be used for functions that do not require any include.
|
||||
AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \
|
||||
getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
|
||||
AC_CHECK_FUNCS(fchdir fchown fsync getcwd getpseudotty \
|
||||
getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat \
|
||||
memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
|
||||
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
|
||||
sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \
|
||||
@@ -4341,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
|
||||
|
||||
|
||||
+21
@@ -138,6 +138,23 @@ diff_buf_add(buf_T *buf)
|
||||
EMSGN(_("E96: Cannot diff more than %ld buffers"), DB_COUNT);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove all buffers to make diffs for.
|
||||
*/
|
||||
static void
|
||||
diff_buf_clear(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < DB_COUNT; ++i)
|
||||
if (curtab->tp_diffbuf[i] != NULL)
|
||||
{
|
||||
curtab->tp_diffbuf[i] = NULL;
|
||||
curtab->tp_diff_invalid = TRUE;
|
||||
diff_redraw(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Find buffer "buf" in the list of diff buffers for the current tab page.
|
||||
* Return its index or DB_COUNT if not found.
|
||||
@@ -1257,6 +1274,10 @@ ex_diffoff(exarg_T *eap)
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Also remove hidden buffers from the list. */
|
||||
if (eap->forceit)
|
||||
diff_buf_clear();
|
||||
|
||||
#ifdef FEAT_SCROLLBIND
|
||||
/* Remove "hor" from from 'scrollopt' if there are no diff windows left. */
|
||||
if (!diffwin && vim_strchr(p_sbo, 'h') != NULL)
|
||||
|
||||
+140
-13
@@ -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)
|
||||
@@ -3453,10 +3476,13 @@ ins_compl_bs(void)
|
||||
mb_ptr_back(line, p);
|
||||
|
||||
/* Stop completion when the whole word was deleted. For Omni completion
|
||||
* allow the word to be deleted, we won't match everything. */
|
||||
* allow the word to be deleted, we won't match everything.
|
||||
* Respect the 'backspace' option. */
|
||||
if ((int)(p - line) - (int)compl_col < 0
|
||||
|| ((int)(p - line) - (int)compl_col == 0
|
||||
&& ctrl_x_mode != CTRL_X_OMNI) || ctrl_x_mode == CTRL_X_EVAL)
|
||||
&& ctrl_x_mode != CTRL_X_OMNI) || ctrl_x_mode == CTRL_X_EVAL
|
||||
|| (!can_bs(BS_START) && (int)(p - line) - (int)compl_col
|
||||
- compl_length < 0))
|
||||
return K_BS;
|
||||
|
||||
/* Deleted more than what was used to find matches or didn't finish
|
||||
@@ -3889,7 +3915,7 @@ ins_compl_prep(int c)
|
||||
if (prev_col > 0)
|
||||
dec_cursor();
|
||||
/* only format when something was inserted */
|
||||
if (!arrow_used && !ins_need_undo)
|
||||
if (!arrow_used && !ins_need_undo && c != Ctrl_E)
|
||||
insertchar(NUL, 0, -1);
|
||||
if (prev_col > 0
|
||||
&& ml_get_curline()[curwin->w_cursor.col] != NUL)
|
||||
@@ -6157,6 +6183,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 +6194,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 +8644,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 +9485,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)
|
||||
|
||||
+65
-32
@@ -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.
|
||||
*/
|
||||
@@ -270,7 +294,7 @@ eval_init(void)
|
||||
p = &vimvars[i];
|
||||
if (STRLEN(p->vv_name) > 16)
|
||||
{
|
||||
EMSG("INTERNAL: name too long, increase size of dictitem16_T");
|
||||
IEMSG("INTERNAL: name too long, increase size of dictitem16_T");
|
||||
getout(1);
|
||||
}
|
||||
STRCPY(p->vv_di.di_key, p->vv_name);
|
||||
@@ -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;
|
||||
@@ -5971,6 +5986,22 @@ string2float(
|
||||
char *s = (char *)text;
|
||||
float_T f;
|
||||
|
||||
/* MS-Windows does not deal with "inf" and "nan" properly. */
|
||||
if (STRNICMP(text, "inf", 3) == 0)
|
||||
{
|
||||
*value = INFINITY;
|
||||
return 3;
|
||||
}
|
||||
if (STRNICMP(text, "-inf", 3) == 0)
|
||||
{
|
||||
*value = -INFINITY;
|
||||
return 4;
|
||||
}
|
||||
if (STRNICMP(text, "nan", 3) == 0)
|
||||
{
|
||||
*value = NAN;
|
||||
return 3;
|
||||
}
|
||||
f = strtod(s, &s);
|
||||
*value = f;
|
||||
return (int)((char_u *)s - text);
|
||||
@@ -9209,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));
|
||||
|
||||
+168
-126
@@ -76,6 +76,7 @@ static void f_call(typval_T *argvars, typval_T *rettv);
|
||||
static void f_ceil(typval_T *argvars, typval_T *rettv);
|
||||
#endif
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
static void f_ch_canread(typval_T *argvars, typval_T *rettv);
|
||||
static void f_ch_close(typval_T *argvars, typval_T *rettv);
|
||||
static void f_ch_close_in(typval_T *argvars, typval_T *rettv);
|
||||
static void f_ch_evalexpr(typval_T *argvars, typval_T *rettv);
|
||||
@@ -288,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);
|
||||
@@ -470,7 +474,7 @@ static struct fst
|
||||
{"assert_exception", 1, 2, f_assert_exception},
|
||||
{"assert_fails", 1, 2, f_assert_fails},
|
||||
{"assert_false", 1, 2, f_assert_false},
|
||||
{"assert_inrange", 2, 3, f_assert_inrange},
|
||||
{"assert_inrange", 3, 4, f_assert_inrange},
|
||||
{"assert_match", 2, 3, f_assert_match},
|
||||
{"assert_notequal", 2, 3, f_assert_notequal},
|
||||
{"assert_notmatch", 2, 3, f_assert_notmatch},
|
||||
@@ -499,6 +503,7 @@ static struct fst
|
||||
{"ceil", 1, 1, f_ceil},
|
||||
#endif
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
{"ch_canread", 1, 1, f_ch_canread},
|
||||
{"ch_close", 1, 1, f_ch_close},
|
||||
{"ch_close_in", 1, 1, f_ch_close_in},
|
||||
{"ch_evalexpr", 2, 3, f_ch_evalexpr},
|
||||
@@ -713,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},
|
||||
@@ -921,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
|
||||
@@ -1778,6 +1758,21 @@ f_ceil(typval_T *argvars, typval_T *rettv)
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
/*
|
||||
* "ch_canread()" function
|
||||
*/
|
||||
static void
|
||||
f_ch_canread(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
channel_T *channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0);
|
||||
|
||||
rettv->vval.v_number = 0;
|
||||
if (channel != NULL)
|
||||
rettv->vval.v_number = channel_has_readahead(channel, PART_SOCK)
|
||||
|| channel_has_readahead(channel, PART_OUT)
|
||||
|| channel_has_readahead(channel, PART_ERR);
|
||||
}
|
||||
|
||||
/*
|
||||
* "ch_close()" function
|
||||
*/
|
||||
@@ -2824,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;
|
||||
@@ -3315,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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3956,7 +3952,8 @@ get_buffer_info(buf_T *buf)
|
||||
dict_add_nr_str(dict, "bufnr", buf->b_fnum, NULL);
|
||||
dict_add_nr_str(dict, "name", 0L,
|
||||
buf->b_ffname != NULL ? buf->b_ffname : (char_u *)"");
|
||||
dict_add_nr_str(dict, "lnum", buflist_findlnum(buf), NULL);
|
||||
dict_add_nr_str(dict, "lnum", buf == curbuf ? curwin->w_cursor.lnum
|
||||
: buflist_findlnum(buf), NULL);
|
||||
dict_add_nr_str(dict, "loaded", buf->b_ml.ml_mfp != NULL, NULL);
|
||||
dict_add_nr_str(dict, "listed", buf->b_p_bl, NULL);
|
||||
dict_add_nr_str(dict, "changed", bufIsChanged(buf), NULL);
|
||||
@@ -4241,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();
|
||||
@@ -4250,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;
|
||||
@@ -5766,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",
|
||||
@@ -5978,6 +5973,10 @@ f_has(typval_T *argvars, typval_T *rettv)
|
||||
}
|
||||
else if (STRICMP(name, "vim_starting") == 0)
|
||||
n = (starting != 0);
|
||||
else if (STRICMP(name, "ttyin") == 0)
|
||||
n = mch_input_isatty();
|
||||
else if (STRICMP(name, "ttyout") == 0)
|
||||
n = stdout_isatty;
|
||||
#ifdef FEAT_MBYTE
|
||||
else if (STRICMP(name, "multi_byte_encoding") == 0)
|
||||
n = has_mbyte;
|
||||
@@ -6006,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)
|
||||
@@ -6815,8 +6827,7 @@ f_json_decode(typval_T *argvars, typval_T *rettv)
|
||||
reader.js_buf = get_tv_string(&argvars[0]);
|
||||
reader.js_fill = NULL;
|
||||
reader.js_used = 0;
|
||||
if (json_decode_all(&reader, rettv, 0) != OK)
|
||||
EMSG(_(e_invarg));
|
||||
json_decode_all(&reader, rettv, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -6885,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;
|
||||
@@ -7793,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
|
||||
{
|
||||
@@ -8044,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);
|
||||
}
|
||||
@@ -8059,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
|
||||
*/
|
||||
@@ -9514,15 +9555,15 @@ do_searchpair(
|
||||
|
||||
/* Make two search patterns: start/end (pat2, for in nested pairs) and
|
||||
* start/middle/end (pat3, for the top pair). */
|
||||
pat2 = alloc((unsigned)(STRLEN(spat) + STRLEN(epat) + 15));
|
||||
pat3 = alloc((unsigned)(STRLEN(spat) + STRLEN(mpat) + STRLEN(epat) + 23));
|
||||
pat2 = alloc((unsigned)(STRLEN(spat) + STRLEN(epat) + 17));
|
||||
pat3 = alloc((unsigned)(STRLEN(spat) + STRLEN(mpat) + STRLEN(epat) + 25));
|
||||
if (pat2 == NULL || pat3 == NULL)
|
||||
goto theend;
|
||||
sprintf((char *)pat2, "\\(%s\\m\\)\\|\\(%s\\m\\)", spat, epat);
|
||||
sprintf((char *)pat2, "\\m\\(%s\\m\\)\\|\\(%s\\m\\)", spat, epat);
|
||||
if (*mpat == NUL)
|
||||
STRCPY(pat3, pat2);
|
||||
else
|
||||
sprintf((char *)pat3, "\\(%s\\m\\)\\|\\(%s\\m\\)\\|\\(%s\\m\\)",
|
||||
sprintf((char *)pat3, "\\m\\(%s\\m\\)\\|\\(%s\\m\\)\\|\\(%s\\m\\)",
|
||||
spat, epat, mpat);
|
||||
if (flags & SP_START)
|
||||
options |= SEARCH_START;
|
||||
@@ -10137,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)
|
||||
{
|
||||
@@ -11072,10 +11108,13 @@ f_sqrt(typval_T *argvars, typval_T *rettv)
|
||||
f_str2float(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
char_u *p = skipwhite(get_tv_string(&argvars[0]));
|
||||
int isneg = (*p == '-');
|
||||
|
||||
if (*p == '+')
|
||||
if (*p == '+' || *p == '-')
|
||||
p = skipwhite(p + 1);
|
||||
(void)string2float(p, &rettv->vval.v_float);
|
||||
if (isneg)
|
||||
rettv->vval.v_float *= -1;
|
||||
rettv->v_type = VAR_FLOAT;
|
||||
}
|
||||
#endif
|
||||
@@ -11090,6 +11129,7 @@ f_str2nr(typval_T *argvars, typval_T *rettv)
|
||||
char_u *p;
|
||||
varnumber_T n;
|
||||
int what;
|
||||
int isneg;
|
||||
|
||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
@@ -11102,7 +11142,8 @@ f_str2nr(typval_T *argvars, typval_T *rettv)
|
||||
}
|
||||
|
||||
p = skipwhite(get_tv_string(&argvars[0]));
|
||||
if (*p == '+')
|
||||
isneg = (*p == '-');
|
||||
if (*p == '+' || *p == '-')
|
||||
p = skipwhite(p + 1);
|
||||
switch (base)
|
||||
{
|
||||
@@ -11112,7 +11153,11 @@ f_str2nr(typval_T *argvars, typval_T *rettv)
|
||||
default: what = 0;
|
||||
}
|
||||
vim_str2nr(p, NULL, NULL, what, &n, NULL, 0);
|
||||
rettv->vval.v_number = n;
|
||||
if (isneg)
|
||||
rettv->vval.v_number = -n;
|
||||
else
|
||||
rettv->vval.v_number = n;
|
||||
|
||||
}
|
||||
|
||||
#ifdef HAVE_STRFTIME
|
||||
@@ -11822,7 +11867,6 @@ get_cmd_output_as_rettv(
|
||||
char_u *res = NULL;
|
||||
char_u *p;
|
||||
char_u *infile = NULL;
|
||||
char_u buf[NUMBUFLEN];
|
||||
int err = FALSE;
|
||||
FILE *fd;
|
||||
list_T *list = NULL;
|
||||
@@ -11836,7 +11880,7 @@ get_cmd_output_as_rettv(
|
||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
/*
|
||||
* Write the string to a temp file, to be used for input of the shell
|
||||
* Write the text to a temp file, to be used for input of the shell
|
||||
* command.
|
||||
*/
|
||||
if ((infile = vim_tempname('i', TRUE)) == NULL)
|
||||
@@ -11851,14 +11895,43 @@ get_cmd_output_as_rettv(
|
||||
EMSG2(_(e_notopen), infile);
|
||||
goto errret;
|
||||
}
|
||||
if (argvars[1].v_type == VAR_LIST)
|
||||
if (argvars[1].v_type == VAR_NUMBER)
|
||||
{
|
||||
linenr_T lnum;
|
||||
buf_T *buf;
|
||||
|
||||
buf = buflist_findnr(argvars[1].vval.v_number);
|
||||
if (buf == NULL)
|
||||
{
|
||||
EMSGN(_(e_nobufnr), argvars[1].vval.v_number);
|
||||
fclose(fd);
|
||||
goto errret;
|
||||
}
|
||||
|
||||
for (lnum = 1; lnum <= buf->b_ml.ml_line_count; lnum++)
|
||||
{
|
||||
for (p = ml_get_buf(buf, lnum, FALSE); *p != NUL; ++p)
|
||||
if (putc(*p == '\n' ? NUL : *p, fd) == EOF)
|
||||
{
|
||||
err = TRUE;
|
||||
break;
|
||||
}
|
||||
if (putc(NL, fd) == EOF)
|
||||
{
|
||||
err = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (argvars[1].v_type == VAR_LIST)
|
||||
{
|
||||
if (write_list(fd, argvars[1].vval.v_list, TRUE) == FAIL)
|
||||
err = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t len;
|
||||
size_t len;
|
||||
char_u buf[NUMBUFLEN];
|
||||
|
||||
p = get_tv_string_buf_chk(&argvars[1], buf);
|
||||
if (p == NULL)
|
||||
@@ -12511,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]));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+13
-6
@@ -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())
|
||||
@@ -3967,7 +3967,8 @@ do_ecmd(
|
||||
* <VN> We could instead free the synblock
|
||||
* and re-attach to buffer, perhaps.
|
||||
*/
|
||||
if (curwin->w_s == &(curwin->w_buffer->b_s))
|
||||
if (curwin->w_buffer != NULL
|
||||
&& curwin->w_s == &(curwin->w_buffer->b_s))
|
||||
curwin->w_s = &(buf->b_s);
|
||||
#endif
|
||||
curwin->w_buffer = buf;
|
||||
@@ -5262,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. */
|
||||
@@ -6498,18 +6503,20 @@ find_help_tags(
|
||||
static char *(mtable[]) = {"*", "g*", "[*", "]*", ":*",
|
||||
"/*", "/\\*", "\"*", "**",
|
||||
"cpo-*", "/\\(\\)", "/\\%(\\)",
|
||||
"?", ":?", "?<CR>", "g?", "g?g?", "g??", "z?",
|
||||
"?", ":?", "?<CR>", "g?", "g?g?", "g??",
|
||||
"/\\?", "/\\z(\\)", "\\=", ":s\\=",
|
||||
"[count]", "[quotex]", "[range]",
|
||||
"[count]", "[quotex]",
|
||||
"[range]", ":[range]",
|
||||
"[pattern]", "\\|", "\\%$",
|
||||
"s/\\~", "s/\\U", "s/\\L",
|
||||
"s/\\1", "s/\\2", "s/\\3", "s/\\9"};
|
||||
static char *(rtable[]) = {"star", "gstar", "[star", "]star", ":star",
|
||||
"/star", "/\\\\star", "quotestar", "starstar",
|
||||
"cpo-star", "/\\\\(\\\\)", "/\\\\%(\\\\)",
|
||||
"?", ":?", "?<CR>", "g?", "g?g?", "g??", "z?",
|
||||
"?", ":?", "?<CR>", "g?", "g?g?", "g??",
|
||||
"/\\\\?", "/\\\\z(\\\\)", "\\\\=", ":s\\\\=",
|
||||
"\\[count]", "\\[quotex]", "\\[range]",
|
||||
"\\[count]", "\\[quotex]",
|
||||
"\\[range]", ":\\[range]",
|
||||
"\\[pattern]", "\\\\bar", "/\\\\%\\$",
|
||||
"s/\\\\\\~", "s/\\\\U", "s/\\\\L",
|
||||
"s/\\\\1", "s/\\\\2", "s/\\\\3", "s/\\\\9"};
|
||||
|
||||
+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),
|
||||
|
||||
+226
-29
@@ -3582,6 +3582,9 @@ add_pack_plugin(char_u *fname, void *cookie)
|
||||
size_t afterlen = 0;
|
||||
char_u *ffname = fix_fname(fname);
|
||||
size_t fname_len;
|
||||
char_u *buf = NULL;
|
||||
char_u *rtp_ffname;
|
||||
int match;
|
||||
|
||||
if (ffname == NULL)
|
||||
return;
|
||||
@@ -3606,26 +3609,28 @@ add_pack_plugin(char_u *fname, void *cookie)
|
||||
/* Find "ffname" in "p_rtp", ignoring '/' vs '\' differences. */
|
||||
fname_len = STRLEN(ffname);
|
||||
insp = p_rtp;
|
||||
for (;;)
|
||||
buf = alloc(MAXPATHL);
|
||||
if (buf == NULL)
|
||||
goto theend;
|
||||
while (*insp != NUL)
|
||||
{
|
||||
if (vim_fnamencmp(insp, ffname, fname_len) == 0)
|
||||
copy_option_part(&insp, buf, MAXPATHL, ",");
|
||||
add_pathsep(buf);
|
||||
rtp_ffname = fix_fname(buf);
|
||||
if (rtp_ffname == NULL)
|
||||
goto theend;
|
||||
match = vim_fnamencmp(rtp_ffname, ffname, fname_len) == 0;
|
||||
vim_free(rtp_ffname);
|
||||
if (match)
|
||||
break;
|
||||
insp = vim_strchr(insp, ',');
|
||||
if (insp == NULL)
|
||||
break;
|
||||
++insp;
|
||||
}
|
||||
|
||||
if (insp == NULL)
|
||||
if (*insp == NUL)
|
||||
/* not found, append at the end */
|
||||
insp = p_rtp + STRLEN(p_rtp);
|
||||
else
|
||||
{
|
||||
/* append after the matching directory. */
|
||||
insp += STRLEN(ffname);
|
||||
while (*insp != NUL && *insp != ',')
|
||||
++insp;
|
||||
}
|
||||
--insp;
|
||||
*p4 = c;
|
||||
|
||||
/* check if rtp/pack/name/start/name/after exists */
|
||||
@@ -3635,7 +3640,8 @@ add_pack_plugin(char_u *fname, void *cookie)
|
||||
|
||||
oldlen = STRLEN(p_rtp);
|
||||
addlen = STRLEN(ffname) + 1; /* add one for comma */
|
||||
new_rtp = alloc((int)(oldlen + addlen + afterlen + 1)); /* add one for NUL */
|
||||
new_rtp = alloc((int)(oldlen + addlen + afterlen + 1));
|
||||
/* add one for NUL */
|
||||
if (new_rtp == NULL)
|
||||
goto theend;
|
||||
keep = (int)(insp - p_rtp);
|
||||
@@ -3689,6 +3695,7 @@ add_pack_plugin(char_u *fname, void *cookie)
|
||||
}
|
||||
|
||||
theend:
|
||||
vim_free(buf);
|
||||
vim_free(ffname);
|
||||
}
|
||||
|
||||
@@ -3748,6 +3755,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 +5359,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 +5403,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
|
||||
|
||||
+277
-105
@@ -137,7 +137,7 @@ static int getargopt(exarg_T *eap);
|
||||
#endif
|
||||
|
||||
static int check_more(int, int);
|
||||
static linenr_T get_address(exarg_T *, char_u **, int addr_type, int skip, int to_other_file);
|
||||
static linenr_T get_address(exarg_T *, char_u **, int addr_type, int skip, int to_other_file, int address_count);
|
||||
static void get_flags(exarg_T *eap);
|
||||
#if !defined(FEAT_PERL) \
|
||||
|| !defined(FEAT_PYTHON) || !defined(FEAT_PYTHON3) \
|
||||
@@ -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
|
||||
@@ -794,8 +799,13 @@ do_cmdline(
|
||||
#endif
|
||||
|
||||
/* It's possible to create an endless loop with ":execute", catch that
|
||||
* here. The value of 200 allows nested function calls, ":source", etc. */
|
||||
if (call_depth == 200)
|
||||
* here. The value of 200 allows nested function calls, ":source", etc.
|
||||
* Allow 200 or 'maxfuncdepth', whatever is larger. */
|
||||
if (call_depth >= 200
|
||||
#ifdef FEAT_EVAL
|
||||
&& call_depth >= p_mfd
|
||||
#endif
|
||||
)
|
||||
{
|
||||
EMSG(_("E169: Command too recursive"));
|
||||
#ifdef FEAT_EVAL
|
||||
@@ -1798,6 +1808,7 @@ do_one_cmd(
|
||||
cmdmod_T save_cmdmod;
|
||||
int ni; /* set when Not Implemented */
|
||||
char_u *cmd;
|
||||
int address_count = 1;
|
||||
|
||||
vim_memset(&ea, 0, sizeof(ea));
|
||||
ea.line1 = 1;
|
||||
@@ -2022,7 +2033,7 @@ do_one_cmd(
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
long tabnr = get_address(&ea, &ea.cmd, ADDR_TABS,
|
||||
ea.skip, FALSE);
|
||||
ea.skip, FALSE, 1);
|
||||
if (tabnr == MAXLNUM)
|
||||
cmdmod.tab = tabpage_index(curtab) + 1;
|
||||
else
|
||||
@@ -2158,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;
|
||||
@@ -2171,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:
|
||||
@@ -2182,7 +2194,7 @@ do_one_cmd(
|
||||
}
|
||||
ea.cmd = skipwhite(ea.cmd);
|
||||
lnum = get_address(&ea, &ea.cmd, ea.addr_type, ea.skip,
|
||||
ea.addr_count == 0);
|
||||
ea.addr_count == 0, address_count++);
|
||||
if (ea.cmd == NULL) /* error detected */
|
||||
goto doend;
|
||||
if (lnum == MAXLNUM)
|
||||
@@ -2231,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;
|
||||
@@ -2284,7 +2300,11 @@ do_one_cmd(
|
||||
if (*ea.cmd == ';')
|
||||
{
|
||||
if (!ea.skip)
|
||||
{
|
||||
curwin->w_cursor.lnum = ea.line2;
|
||||
/* don't leave the cursor on an illegal line or column */
|
||||
check_cursor();
|
||||
}
|
||||
}
|
||||
else if (*ea.cmd != ',')
|
||||
break;
|
||||
@@ -2300,9 +2320,6 @@ do_one_cmd(
|
||||
ea.addr_count = 0;
|
||||
}
|
||||
|
||||
/* Don't leave the cursor on an illegal line (caused by ';') */
|
||||
check_cursor_lnum();
|
||||
|
||||
/*
|
||||
* 5. Parse the command.
|
||||
*/
|
||||
@@ -2480,7 +2497,7 @@ do_one_cmd(
|
||||
&& !IS_USER_CMDIDX(ea.cmdidx))
|
||||
{
|
||||
/* Command not allowed when editing the command line. */
|
||||
errormsg = get_text_locked_msg();
|
||||
errormsg = (char_u *)_(get_text_locked_msg());
|
||||
goto doend;
|
||||
}
|
||||
#ifdef FEAT_AUTOCMD
|
||||
@@ -2705,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;
|
||||
@@ -2781,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;
|
||||
}
|
||||
}
|
||||
@@ -3871,7 +3892,6 @@ set_one_cmd_context(
|
||||
case CMD_cfdo:
|
||||
case CMD_confirm:
|
||||
case CMD_debug:
|
||||
case CMD_filter:
|
||||
case CMD_folddoclosed:
|
||||
case CMD_folddoopen:
|
||||
case CMD_hide:
|
||||
@@ -3896,6 +3916,16 @@ set_one_cmd_context(
|
||||
case CMD_windo:
|
||||
return arg;
|
||||
|
||||
case CMD_filter:
|
||||
if (*arg != NUL)
|
||||
arg = skip_vimgrep_pat(arg, NULL, NULL);
|
||||
if (arg == NULL || *arg == NUL)
|
||||
{
|
||||
xp->xp_context = EXPAND_NOTHING;
|
||||
return NULL;
|
||||
}
|
||||
return skipwhite(arg);
|
||||
|
||||
#ifdef FEAT_CMDL_COMPL
|
||||
# ifdef FEAT_SEARCH_EXTRA
|
||||
case CMD_match:
|
||||
@@ -4100,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;
|
||||
|
||||
@@ -4338,9 +4374,16 @@ skip_range(
|
||||
{
|
||||
unsigned delim;
|
||||
|
||||
while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;", *cmd) != NULL)
|
||||
while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;\\", *cmd) != NULL)
|
||||
{
|
||||
if (*cmd == '\'')
|
||||
if (*cmd == '\\')
|
||||
{
|
||||
if (cmd[1] == '?' || cmd[1] == '/' || cmd[1] == '&')
|
||||
++cmd;
|
||||
else
|
||||
break;
|
||||
}
|
||||
else if (*cmd == '\'')
|
||||
{
|
||||
if (*++cmd == NUL && ctx != NULL)
|
||||
*ctx = EXPAND_NOTHING;
|
||||
@@ -4379,7 +4422,8 @@ get_address(
|
||||
char_u **ptr,
|
||||
int addr_type, /* flag: one of ADDR_LINES, ... */
|
||||
int skip, /* only skip the address, don't use it */
|
||||
int to_other_file) /* flag: may jump to other file */
|
||||
int to_other_file, /* flag: may jump to other file */
|
||||
int address_count UNUSED) /* 1 for first address, >1 after comma */
|
||||
{
|
||||
int c;
|
||||
int i;
|
||||
@@ -4416,6 +4460,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);
|
||||
@@ -4453,6 +4502,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);
|
||||
@@ -4635,6 +4689,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);
|
||||
@@ -4651,14 +4708,31 @@ 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);
|
||||
else if (i == '-')
|
||||
lnum -= n;
|
||||
else
|
||||
lnum += n;
|
||||
{
|
||||
#ifdef FEAT_FOLDING
|
||||
/* Relative line addressing, need to adjust for folded lines
|
||||
* now, but only do it after the first address. */
|
||||
if (addr_type == ADDR_LINES && (i == '-' || i == '+')
|
||||
&& address_count >= 2)
|
||||
(void)hasFolding(lnum, NULL, &lnum);
|
||||
#endif
|
||||
if (i == '-')
|
||||
lnum -= n;
|
||||
else
|
||||
lnum += n;
|
||||
}
|
||||
}
|
||||
} while (*cmd == '/' || *cmd == '?');
|
||||
|
||||
@@ -4774,6 +4848,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))
|
||||
@@ -7415,6 +7492,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.
|
||||
@@ -7423,6 +7601,7 @@ ex_win_close(
|
||||
ex_tabclose(exarg_T *eap)
|
||||
{
|
||||
tabpage_T *tp;
|
||||
int tab_number;
|
||||
|
||||
# ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
@@ -7433,9 +7612,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();
|
||||
@@ -7446,13 +7626,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7464,6 +7644,7 @@ ex_tabonly(exarg_T *eap)
|
||||
{
|
||||
tabpage_T *tp;
|
||||
int done;
|
||||
int tab_number;
|
||||
|
||||
# ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
@@ -7474,24 +7655,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7588,7 +7772,7 @@ ex_all(exarg_T *eap)
|
||||
#endif /* FEAT_WINDOWS */
|
||||
|
||||
static void
|
||||
ex_hide(exarg_T *eap)
|
||||
ex_hide(exarg_T *eap UNUSED)
|
||||
{
|
||||
/* ":hide" or ":hide | cmd": hide current window */
|
||||
#ifdef FEAT_WINDOWS
|
||||
@@ -8234,6 +8418,8 @@ tabpage_new(void)
|
||||
static void
|
||||
ex_tabnext(exarg_T *eap)
|
||||
{
|
||||
int tab_number;
|
||||
|
||||
switch (eap->cmdidx)
|
||||
{
|
||||
case CMD_tabfirst:
|
||||
@@ -8245,10 +8431,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;
|
||||
}
|
||||
}
|
||||
@@ -8261,59 +8477,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);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8849,7 +9015,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())
|
||||
@@ -9319,7 +9485,7 @@ ex_copymove(exarg_T *eap)
|
||||
{
|
||||
long n;
|
||||
|
||||
n = get_address(eap, &eap->arg, eap->addr_type, FALSE, FALSE);
|
||||
n = get_address(eap, &eap->arg, eap->addr_type, FALSE, FALSE, 1);
|
||||
if (eap->arg == NULL) /* error detected */
|
||||
{
|
||||
eap->nextcmd = NULL;
|
||||
@@ -11194,8 +11360,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;
|
||||
@@ -11265,6 +11433,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.
|
||||
@@ -11660,7 +11832,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)
|
||||
{
|
||||
|
||||
+16
-7
@@ -1801,6 +1801,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)
|
||||
@@ -2373,8 +2377,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();
|
||||
|
||||
@@ -2389,6 +2392,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 */
|
||||
@@ -4367,7 +4376,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
|
||||
{
|
||||
@@ -6915,9 +6926,7 @@ ex_window(void)
|
||||
redraw_later(SOME_VALID);
|
||||
|
||||
/* Save the command line info, can be used recursively. */
|
||||
save_ccline = ccline;
|
||||
ccline.cmdbuff = NULL;
|
||||
ccline.cmdprompt = NULL;
|
||||
save_cmdline(&save_ccline);
|
||||
|
||||
/* No Ex mode here! */
|
||||
exmode_active = 0;
|
||||
@@ -6964,7 +6973,7 @@ ex_window(void)
|
||||
# endif
|
||||
|
||||
/* Restore the command line info. */
|
||||
ccline = save_ccline;
|
||||
restore_cmdline(&save_ccline);
|
||||
cmdwin_type = 0;
|
||||
|
||||
exmode_active = save_exmode;
|
||||
|
||||
+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())
|
||||
|
||||
+17
-12
@@ -978,23 +978,22 @@ ins_typebuf(
|
||||
|
||||
addlen = (int)STRLEN(str);
|
||||
|
||||
/*
|
||||
* Easy case: there is room in front of typebuf.tb_buf[typebuf.tb_off]
|
||||
*/
|
||||
if (offset == 0 && addlen <= typebuf.tb_off)
|
||||
{
|
||||
/*
|
||||
* Easy case: there is room in front of typebuf.tb_buf[typebuf.tb_off]
|
||||
*/
|
||||
typebuf.tb_off -= addlen;
|
||||
mch_memmove(typebuf.tb_buf + typebuf.tb_off, str, (size_t)addlen);
|
||||
}
|
||||
|
||||
/*
|
||||
* Need to allocate a new buffer.
|
||||
* In typebuf.tb_buf there must always be room for 3 * MAXMAPLEN + 4
|
||||
* characters. We add some extra room to avoid having to allocate too
|
||||
* often.
|
||||
*/
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Need to allocate a new buffer.
|
||||
* In typebuf.tb_buf there must always be room for 3 * MAXMAPLEN + 4
|
||||
* characters. We add some extra room to avoid having to allocate too
|
||||
* often.
|
||||
*/
|
||||
newoff = MAXMAPLEN + 4;
|
||||
newlen = typebuf.tb_len + addlen + newoff + 4 * (MAXMAPLEN + 4);
|
||||
if (newlen < 0) /* string is getting too long */
|
||||
@@ -1818,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;
|
||||
}
|
||||
|
||||
@@ -1907,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 ".".
|
||||
@@ -2009,7 +2014,7 @@ vgetorpeek(int advance)
|
||||
{
|
||||
/* KeyTyped = FALSE; When the command that stuffed something
|
||||
* was typed, behave like the stuffed command was typed.
|
||||
* needed for CTRL-W CTRl-] to open a fold, for example. */
|
||||
* needed for CTRL-W CTRL-] to open a fold, for example. */
|
||||
KeyStuffed = TRUE;
|
||||
}
|
||||
if (typebuf.tb_no_abbr_cnt == 0)
|
||||
|
||||
+3
-1
@@ -643,6 +643,8 @@ EXTERN int exiting INIT(= FALSE);
|
||||
EXTERN int really_exiting INIT(= FALSE);
|
||||
/* TRUE when we are sure to exit, e.g., after
|
||||
* a deadly signal */
|
||||
EXTERN int stdout_isatty INIT(= TRUE); /* is stdout a terminal? */
|
||||
|
||||
#if defined(FEAT_AUTOCHDIR)
|
||||
EXTERN int test_autochdir INIT(= FALSE);
|
||||
#endif
|
||||
@@ -1583,7 +1585,7 @@ EXTERN char_u e_winheight[] INIT(= N_("E591: 'winheight' cannot be smaller than
|
||||
EXTERN char_u e_winwidth[] INIT(= N_("E592: 'winwidth' cannot be smaller than 'winminwidth'"));
|
||||
#endif
|
||||
EXTERN char_u e_write[] INIT(= N_("E80: Error while writing"));
|
||||
EXTERN char_u e_zerocount[] INIT(= N_("Zero count"));
|
||||
EXTERN char_u e_zerocount[] INIT(= N_("E939: Positive count required"));
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char_u e_usingsid[] INIT(= N_("E81: Using <SID> not in a script context"));
|
||||
#endif
|
||||
|
||||
@@ -1476,6 +1476,8 @@ gui_resize_shell(int pixel_width, int pixel_height)
|
||||
}
|
||||
|
||||
again:
|
||||
new_pixel_width = 0;
|
||||
new_pixel_height = 0;
|
||||
busy = TRUE;
|
||||
|
||||
/* Flush pending output before redrawing */
|
||||
@@ -1485,8 +1487,8 @@ again:
|
||||
gui.num_rows = (pixel_height - gui_get_base_height()) / gui.char_height;
|
||||
|
||||
gui_position_components(pixel_width);
|
||||
|
||||
gui_reset_scroll_region();
|
||||
|
||||
/*
|
||||
* At the "more" and ":confirm" prompt there is no redraw, put the cursor
|
||||
* at the last line here (why does it have to be one row too low?).
|
||||
@@ -1508,17 +1510,22 @@ again:
|
||||
|
||||
busy = FALSE;
|
||||
|
||||
/*
|
||||
* We could have been called again while redrawing the screen.
|
||||
* Need to do it all again with the latest size then.
|
||||
*/
|
||||
/* We may have been called again while redrawing the screen.
|
||||
* Need to do it all again with the latest size then. But only if the size
|
||||
* actually changed. */
|
||||
if (new_pixel_height)
|
||||
{
|
||||
pixel_width = new_pixel_width;
|
||||
pixel_height = new_pixel_height;
|
||||
new_pixel_width = 0;
|
||||
new_pixel_height = 0;
|
||||
goto again;
|
||||
if (pixel_width == new_pixel_width && pixel_height == new_pixel_height)
|
||||
{
|
||||
new_pixel_width = 0;
|
||||
new_pixel_height = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
pixel_width = new_pixel_width;
|
||||
pixel_height = new_pixel_height;
|
||||
goto again;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1528,18 +1535,10 @@ again:
|
||||
void
|
||||
gui_may_resize_shell(void)
|
||||
{
|
||||
int h, w;
|
||||
|
||||
if (new_pixel_height)
|
||||
{
|
||||
/* careful: gui_resize_shell() may postpone the resize again if we
|
||||
* were called indirectly by it */
|
||||
w = new_pixel_width;
|
||||
h = new_pixel_height;
|
||||
new_pixel_width = 0;
|
||||
new_pixel_height = 0;
|
||||
gui_resize_shell(w, h);
|
||||
}
|
||||
gui_resize_shell(new_pixel_width, new_pixel_height);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -51,6 +51,9 @@
|
||||
# ifdef _
|
||||
# undef _
|
||||
# endif
|
||||
# ifdef ngettext
|
||||
# undef ngettext
|
||||
# endif
|
||||
# ifdef N_
|
||||
# undef N_
|
||||
# endif
|
||||
|
||||
+22
-8
@@ -35,6 +35,9 @@
|
||||
# ifdef _
|
||||
# undef _
|
||||
# endif
|
||||
# ifdef ngettext
|
||||
# undef ngettext
|
||||
# endif
|
||||
# ifdef N_
|
||||
# undef N_
|
||||
# endif
|
||||
@@ -3102,7 +3105,7 @@ drawarea_configure_event_cb(GtkWidget *widget,
|
||||
g_return_val_if_fail(event
|
||||
&& event->width >= 1 && event->height >= 1, TRUE);
|
||||
|
||||
# if GTK_CHECK_VERSION(3,22,2)
|
||||
# if GTK_CHECK_VERSION(3,22,2) && !GTK_CHECK_VERSION(3,22,4)
|
||||
/* As of 3.22.2, GdkWindows have started distributing configure events to
|
||||
* their "native" children (https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=12579fe71b3b8f79eb9c1b80e429443bcc437dd0).
|
||||
*
|
||||
@@ -3123,6 +3126,10 @@ drawarea_configure_event_cb(GtkWidget *widget,
|
||||
* implementation details. Therefore, watch out any relevant internal
|
||||
* changes happening in GTK in the feature (sigh).
|
||||
*/
|
||||
/* Follow-up
|
||||
* After a few weeks later, the GdkWindow change mentioned above was
|
||||
* reverted (https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=f70039cb9603a02d2369fec4038abf40a1711155).
|
||||
* The corresponding official release is 3.22.4. */
|
||||
if (event->send_event == FALSE)
|
||||
return TRUE;
|
||||
# endif
|
||||
@@ -3164,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;
|
||||
@@ -3185,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
|
||||
@@ -3202,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;
|
||||
@@ -4492,7 +4502,7 @@ form_configure_event(GtkWidget *widget UNUSED,
|
||||
{
|
||||
int usable_height = event->height;
|
||||
|
||||
#if GTK_CHECK_VERSION(3,22,2)
|
||||
#if GTK_CHECK_VERSION(3,22,2) && !GTK_CHECK_VERSION(3,22,4)
|
||||
/* As of 3.22.2, GdkWindows have started distributing configure events to
|
||||
* their "native" children (https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=12579fe71b3b8f79eb9c1b80e429443bcc437dd0).
|
||||
*
|
||||
@@ -4508,6 +4518,10 @@ form_configure_event(GtkWidget *widget UNUSED,
|
||||
* To filter out such fallacious events, check if the given event is the
|
||||
* one that was sent out to the right place. Ignore it if not.
|
||||
*/
|
||||
/* Follow-up
|
||||
* After a few weeks later, the GdkWindow change mentioned above was
|
||||
* reverted (https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=f70039cb9603a02d2369fec4038abf40a1711155).
|
||||
* The corresponding official release is 3.22.4. */
|
||||
if (event->window != gtk_widget_get_window(gui.formwin))
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
+86
-98
@@ -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 */
|
||||
}
|
||||
@@ -2297,19 +2287,24 @@ GetTextWidthEnc(HDC hdc, char_u *str, int len)
|
||||
# define GetTextWidthEnc(h, s, l) GetTextWidth((h), (s), (l))
|
||||
#endif
|
||||
|
||||
static void get_work_area(RECT *spi_rect);
|
||||
|
||||
/*
|
||||
* A quick little routine that will center one window over another, handy for
|
||||
* dialog boxes. Taken from the Win32SDK samples.
|
||||
* dialog boxes. Taken from the Win32SDK samples and modified for multiple
|
||||
* monitors.
|
||||
*/
|
||||
static BOOL
|
||||
CenterWindow(
|
||||
HWND hwndChild,
|
||||
HWND hwndParent)
|
||||
{
|
||||
RECT rChild, rParent;
|
||||
int wChild, hChild, wParent, hParent;
|
||||
int wScreen, hScreen, xNew, yNew;
|
||||
HDC hdc;
|
||||
HMONITOR mon;
|
||||
MONITORINFO moninfo;
|
||||
RECT rChild, rParent, rScreen;
|
||||
int wChild, hChild, wParent, hParent;
|
||||
int xNew, yNew;
|
||||
HDC hdc;
|
||||
|
||||
GetWindowRect(hwndChild, &rChild);
|
||||
wChild = rChild.right - rChild.left;
|
||||
@@ -2317,32 +2312,39 @@ CenterWindow(
|
||||
|
||||
/* If Vim is minimized put the window in the middle of the screen. */
|
||||
if (hwndParent == NULL || IsMinimized(hwndParent))
|
||||
SystemParametersInfo(SPI_GETWORKAREA, 0, &rParent, 0);
|
||||
get_work_area(&rParent);
|
||||
else
|
||||
GetWindowRect(hwndParent, &rParent);
|
||||
wParent = rParent.right - rParent.left;
|
||||
hParent = rParent.bottom - rParent.top;
|
||||
|
||||
hdc = GetDC(hwndChild);
|
||||
wScreen = GetDeviceCaps (hdc, HORZRES);
|
||||
hScreen = GetDeviceCaps (hdc, VERTRES);
|
||||
ReleaseDC(hwndChild, hdc);
|
||||
|
||||
xNew = rParent.left + ((wParent - wChild) /2);
|
||||
if (xNew < 0)
|
||||
moninfo.cbSize = sizeof(MONITORINFO);
|
||||
mon = MonitorFromWindow(hwndChild, MONITOR_DEFAULTTOPRIMARY);
|
||||
if (mon != NULL && GetMonitorInfo(mon, &moninfo))
|
||||
{
|
||||
xNew = 0;
|
||||
rScreen = moninfo.rcWork;
|
||||
}
|
||||
else if ((xNew+wChild) > wScreen)
|
||||
else
|
||||
{
|
||||
xNew = wScreen - wChild;
|
||||
hdc = GetDC(hwndChild);
|
||||
rScreen.left = 0;
|
||||
rScreen.top = 0;
|
||||
rScreen.right = GetDeviceCaps(hdc, HORZRES);
|
||||
rScreen.bottom = GetDeviceCaps(hdc, VERTRES);
|
||||
ReleaseDC(hwndChild, hdc);
|
||||
}
|
||||
|
||||
yNew = rParent.top + ((hParent - hChild) /2);
|
||||
if (yNew < 0)
|
||||
yNew = 0;
|
||||
else if ((yNew+hChild) > hScreen)
|
||||
yNew = hScreen - hChild;
|
||||
xNew = rParent.left + ((wParent - wChild) / 2);
|
||||
if (xNew < rScreen.left)
|
||||
xNew = rScreen.left;
|
||||
else if ((xNew + wChild) > rScreen.right)
|
||||
xNew = rScreen.right - wChild;
|
||||
|
||||
yNew = rParent.top + ((hParent - hChild) / 2);
|
||||
if (yNew < rScreen.top)
|
||||
yNew = rScreen.top;
|
||||
else if ((yNew + hChild) > rScreen.bottom)
|
||||
yNew = rScreen.bottom - hChild;
|
||||
|
||||
return SetWindowPos(hwndChild, NULL, xNew, yNew, 0, 0,
|
||||
SWP_NOSIZE | SWP_NOZORDER);
|
||||
@@ -2805,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();
|
||||
}
|
||||
@@ -2817,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);
|
||||
@@ -2871,11 +2870,10 @@ _OnPaint(
|
||||
}
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
_OnSize(
|
||||
HWND hwnd,
|
||||
UINT state,
|
||||
UINT state UNUSED,
|
||||
int cx,
|
||||
int cy)
|
||||
{
|
||||
@@ -3112,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);
|
||||
@@ -3273,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;
|
||||
@@ -3404,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));
|
||||
}
|
||||
@@ -3539,12 +3534,12 @@ gui_mch_browseW(
|
||||
filterp = convert_filterW(filter);
|
||||
|
||||
vim_memset(&fileStruct, 0, sizeof(OPENFILENAMEW));
|
||||
#ifdef OPENFILENAME_SIZE_VERSION_400W
|
||||
# ifdef OPENFILENAME_SIZE_VERSION_400W
|
||||
/* be compatible with Windows NT 4.0 */
|
||||
fileStruct.lStructSize = OPENFILENAME_SIZE_VERSION_400W;
|
||||
#else
|
||||
# else
|
||||
fileStruct.lStructSize = sizeof(fileStruct);
|
||||
#endif
|
||||
# endif
|
||||
|
||||
if (title != NULL)
|
||||
titlep = enc_to_utf16(title, NULL);
|
||||
@@ -3581,10 +3576,10 @@ gui_mch_browseW(
|
||||
* Don't use OFN_OVERWRITEPROMPT, Vim has its own ":confirm" dialog.
|
||||
*/
|
||||
fileStruct.Flags = (OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY);
|
||||
#ifdef FEAT_SHORTCUT
|
||||
# ifdef FEAT_SHORTCUT
|
||||
if (curbuf->b_p_bin)
|
||||
fileStruct.Flags |= OFN_NODEREFERENCELINKS;
|
||||
#endif
|
||||
# endif
|
||||
if (saving)
|
||||
{
|
||||
if (!GetSaveFileNameW(&fileStruct))
|
||||
@@ -3760,10 +3755,9 @@ gui_mch_browse(
|
||||
}
|
||||
#endif /* FEAT_BROWSE */
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
_OnDropFiles(
|
||||
HWND hwnd,
|
||||
HWND hwnd UNUSED,
|
||||
HDROP hDrop)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
@@ -3821,10 +3815,9 @@ _OnDropFiles(
|
||||
#endif
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static int
|
||||
_OnScroll(
|
||||
HWND hwnd,
|
||||
HWND hwnd UNUSED,
|
||||
HWND hwndCtl,
|
||||
UINT code,
|
||||
int pos)
|
||||
@@ -3942,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)
|
||||
{
|
||||
@@ -5559,7 +5551,7 @@ get_work_area(RECT *spi_rect)
|
||||
MONITORINFO moninfo;
|
||||
|
||||
/* work out which monitor the window is on, and get *it's* work area */
|
||||
mon = MonitorFromWindow(s_hwnd, 1 /*MONITOR_DEFAULTTOPRIMARY*/);
|
||||
mon = MonitorFromWindow(s_hwnd, MONITOR_DEFAULTTOPRIMARY);
|
||||
if (mon != NULL)
|
||||
{
|
||||
moninfo.cbSize = sizeof(MONITORINFO);
|
||||
@@ -5576,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;
|
||||
@@ -5740,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;
|
||||
@@ -5790,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;
|
||||
@@ -6832,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)
|
||||
{
|
||||
@@ -8524,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;
|
||||
@@ -8566,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)
|
||||
{
|
||||
@@ -8607,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 */
|
||||
@@ -8647,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))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user