mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-02 11:19:22 +02:00
Compare commits
196 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 |
@@ -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.
|
||||
|
||||
+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'"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
+36
-14
@@ -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 14
|
||||
|
||||
|
||||
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}])
|
||||
@@ -2980,16 +2981,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 +3011,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 +3025,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 +3038,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 +3084,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 +3112,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 +3126,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 +3147,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 +3161,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()|.
|
||||
|
||||
@@ -5216,6 +5229,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 +5256,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.
|
||||
@@ -7235,7 +7250,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 +7563,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 +7617,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.
|
||||
|
||||
@@ -8420,6 +8440,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.
|
||||
|
||||
@@ -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}
|
||||
|
||||
*'(* *`(*
|
||||
|
||||
+42
-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 15
|
||||
|
||||
|
||||
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'*
|
||||
@@ -5933,6 +5954,21 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
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.
|
||||
|
||||
*'quoteescape'* *'qe'*
|
||||
@@ -5955,6 +5991,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 +8010,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,9 @@ 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
|
||||
'quoteescape' 'qe' escape characters used in a string
|
||||
'readonly' 'ro' disallow writing the buffer
|
||||
'redrawtime' 'rdt' timeout for 'hlsearch' and |:match| highlighting
|
||||
@@ -1074,6 +1076,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*
|
||||
|
||||
+12
-2
@@ -1378,6 +1378,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 +1866,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:$ cmdline.txt /*:$*
|
||||
:% cmdline.txt /*:%*
|
||||
:& change.txt /*:&*
|
||||
:&& change.txt /*:&&*
|
||||
:' cmdline.txt /*:'*
|
||||
:, cmdline.txt /*:,*
|
||||
:. cmdline.txt /*:.*
|
||||
@@ -4537,6 +4539,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*
|
||||
@@ -5302,6 +5306,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 +5354,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*
|
||||
@@ -7021,6 +7027,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 +7163,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 +7879,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*
|
||||
@@ -9215,16 +9222,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*
|
||||
|
||||
@@ -89,6 +89,18 @@ 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.
|
||||
|
||||
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.
|
||||
|
||||
*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 +318,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 +414,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 brackted 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".
|
||||
|
||||
+123
-69
@@ -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 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -29,32 +29,23 @@ 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)
|
||||
get_syn_options() does not respect skip in else part. (Zyx)
|
||||
|
||||
+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?
|
||||
@@ -85,8 +76,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,53 +106,93 @@ 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)
|
||||
|
||||
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.
|
||||
'] mark invalid after undoing insert "hello".
|
||||
|
||||
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)
|
||||
Concatenation with null string causes an error: 'a'[1:0] .. 'b'
|
||||
Might as well handle it like an empty string.
|
||||
|
||||
When using symbolic links, a package path will not be inserted at the right
|
||||
position in 'runtimepath'. (Dugan Chen, 2016 Nov 18)
|
||||
|
||||
json_encode(): should convert to utf-8. (Nikolai Pavlov, 2016 Jan 23)
|
||||
What if there is an invalid character?
|
||||
|
||||
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.
|
||||
Include rust files. (Klabnik, #1356)
|
||||
|
||||
Allow using json with empty key? Dict already has it.
|
||||
|
||||
Json string with trailing \u should be an error. (Lcd)
|
||||
|
||||
Patch to reset ex_exitvalue after catch. (Christian Brabandt, 2016 Oct 23)
|
||||
|
||||
Patch to deal with changed configure events in GTK 3. (Jan Alexander Steffens,
|
||||
2016 Oct 23 #1193)
|
||||
Remarks from nuko8, 2016 Nov 2.
|
||||
|
||||
Multi-byte bug: dv} splits char. (Urtica Dioica, 2017 Jan 9)
|
||||
|
||||
Patch to change order of compiler flags. (Yousong Zhou, 2016 Sep 19, #1100)
|
||||
|
||||
Patch to add command line completion for :cexpr commands. (Yegappan
|
||||
Lakshmanan, 2016 Dec 13)
|
||||
|
||||
Patch for :pyx, run python commands depending on the supported version.
|
||||
(Marc Weber, update from Ken Takata, 2016 Sep 19, 2017 Jan 6)
|
||||
|
||||
Patch to avoid warnings for overflow. (Mike Williams, 2016 Dec 16)
|
||||
Update Dec 19.
|
||||
|
||||
When an item in the quickfix list has a file name that does not exist, behave
|
||||
like the item was not a match for :cnext.
|
||||
|
||||
Wrong diff highlighting with three files. (2016 Oct 20, #1186)
|
||||
Also get E749 on exit.
|
||||
Another example in #1309
|
||||
|
||||
Patch to fix vim_iswordp() works differently on chars <256 that are two bytes.
|
||||
Ozaki Kiichi, 2016 Dec 11.
|
||||
|
||||
When deleting a mark or register, leave a tombstone, so that it's also deleted
|
||||
when writing viminfo (and the delete was the most recent action). #1339
|
||||
|
||||
Relevant neovim patch:
|
||||
https://github.com/neovim/neovim/pull/5717
|
||||
test case:
|
||||
https://github.com/neovim/neovim/pull/5717#issuecomment-264845481
|
||||
Others:
|
||||
https://github.com/neovim/neovim/issues/5713#issuecomment-265136186
|
||||
https://github.com/neovim/neovim/pull/5737#issuecomment-266055165
|
||||
|
||||
Patch for better explanation of 'compatible' side effects.
|
||||
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)
|
||||
|
||||
@@ -175,18 +206,27 @@ 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)
|
||||
|
||||
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 +235,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 +262,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 +287,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 +315,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 +347,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 +462,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 +478,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,
|
||||
@@ -894,11 +962,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 +1037,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()
|
||||
@@ -1144,8 +1204,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 +1341,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 +1359,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
|
||||
|
||||
@@ -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 04
|
||||
|
||||
" 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.
|
||||
|
||||
+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 »
|
||||
* (
|
||||
( )
|
||||
\\ '
|
||||
| ՞
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -1345,10 +1345,18 @@ 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)
|
||||
|
||||
@@ -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',
|
||||
|
||||
+18
-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 04
|
||||
" 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 datalist
|
||||
syn keyword htmlTagName contained details embed figcaption figure
|
||||
syn keyword htmlTagName contained footer header hgroup 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,10 @@ 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 contenteditable contextmenu draggable dropzone
|
||||
syn keyword htmlArg contained hidden spellcheck title translate
|
||||
|
||||
" special characters
|
||||
syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
|
||||
|
||||
|
||||
+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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1255,7 +1255,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>116</string>
|
||||
<string>122</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)
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
BOOL cgLayerEnabled;
|
||||
CGLayerRef cgLayer;
|
||||
CGContextRef cgLayerContext;
|
||||
NSLock *cgLayerLock;
|
||||
|
||||
// These are used in MMCoreTextView+ToolTip.m
|
||||
id trackingRectOwner_; // (not retained)
|
||||
|
||||
+64
-16
@@ -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,18 +590,12 @@ defaultAdvanceForFont(NSFont *font)
|
||||
NSGraphicsContext *context = [NSGraphicsContext currentContext];
|
||||
[context setShouldAntialias:antialias];
|
||||
|
||||
id data;
|
||||
NSEnumerator *e = [drawData objectEnumerator];
|
||||
while ((data = [e nextObject]))
|
||||
[self batchDrawData:data];
|
||||
|
||||
[drawData removeAllObjects];
|
||||
|
||||
if (cgLayerEnabled) {
|
||||
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;
|
||||
@@ -607,19 +605,46 @@ defaultAdvanceForFont(NSFont *font)
|
||||
cgLayerSize.width,
|
||||
cgLayerSize.height);
|
||||
|
||||
CGContextDrawLayerInRect([context graphicsPort], drawRect, l);
|
||||
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
|
||||
@@ -642,11 +667,12 @@ defaultAdvanceForFont(NSFont *font)
|
||||
- (CGLayerRef)getCGLayer
|
||||
{
|
||||
NSParameterAssert(cgLayerEnabled);
|
||||
if (!cgLayer) {
|
||||
if (!cgLayer && [self lockFocusIfCanDraw]) {
|
||||
NSGraphicsContext *context = [NSGraphicsContext currentContext];
|
||||
NSRect frame = [self frame];
|
||||
cgLayer = CGLayerCreateWithContext(
|
||||
[context graphicsPort], frame.size, NULL);
|
||||
[self unlockFocus];
|
||||
}
|
||||
return cgLayer;
|
||||
}
|
||||
@@ -662,6 +688,18 @@ defaultAdvanceForFont(NSFont *font)
|
||||
}
|
||||
}
|
||||
|
||||
- (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
|
||||
{
|
||||
@@ -978,6 +1016,7 @@ defaultAdvanceForFont(NSFont *font)
|
||||
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);
|
||||
@@ -1474,6 +1513,8 @@ 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
|
||||
@@ -1487,9 +1528,11 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
|
||||
// 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];
|
||||
@@ -1544,6 +1587,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
|
||||
CGContextSetBlendMode(context, kCGBlendModeCopy);
|
||||
CGContextFillRect(context, *(CGRect*)&rect);
|
||||
CGContextSetBlendMode(context, kCGBlendModeNormal);
|
||||
[self setNeedsDisplayCGLayerInRect:rect];
|
||||
}
|
||||
|
||||
- (void)clearAll
|
||||
@@ -1560,6 +1604,8 @@ 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
|
||||
@@ -1607,6 +1653,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
|
||||
CGContextFillRect(context, *(CGRect*)&rect);
|
||||
}
|
||||
|
||||
[self setNeedsDisplayCGLayerInRect:rect];
|
||||
CGContextRestoreGState(context);
|
||||
}
|
||||
|
||||
@@ -1623,6 +1670,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
|
||||
numColumns:ncols];
|
||||
CGContextFillRect(cgctx, *(CGRect*)&rect);
|
||||
|
||||
[self setNeedsDisplayCGLayerInRect:rect];
|
||||
CGContextRestoreGState(cgctx);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1123,9 +1123,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:
|
||||
|
||||
+54
-18
@@ -1695,27 +1695,42 @@ OBJ_COMMON = \
|
||||
$(WSDEBUG_OBJ)
|
||||
|
||||
# The files included by tests are not in OBJ_COMMON.
|
||||
OBJ = $(OBJ_COMMON) \
|
||||
OBJ_MAIN = \
|
||||
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/memfile.o \
|
||||
objects/message.o \
|
||||
objects/json_test.o
|
||||
|
||||
MEMFILE_TEST_OBJ = $(OBJ_COMMON) \
|
||||
JSON_TEST_OBJ = $(OBJ_COMMON) $(OBJ_JSON_TEST)
|
||||
|
||||
OBJ_MEMFILE_TEST = \
|
||||
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/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_MEMFILE_TEST) \
|
||||
$(OBJ_MESSAGE_TEST)
|
||||
|
||||
|
||||
PRO_AUTO = \
|
||||
arabic.pro \
|
||||
blowfish.pro \
|
||||
@@ -1879,7 +1894,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.
|
||||
@@ -2069,7 +2086,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 +2110,8 @@ test_arglist \
|
||||
test_delete \
|
||||
test_diffmode \
|
||||
test_digraph \
|
||||
test_functions \
|
||||
test_display \
|
||||
test_ex_undo \
|
||||
test_execute_func \
|
||||
test_expand \
|
||||
@@ -2105,8 +2124,10 @@ test_arglist \
|
||||
test_fileformat \
|
||||
test_filter_cmd \
|
||||
test_filter_map \
|
||||
test_float_func \
|
||||
test_fnameescape \
|
||||
test_fnamemodify \
|
||||
test_fold \
|
||||
test_glob2regpat \
|
||||
test_gf \
|
||||
test_gn \
|
||||
@@ -2135,6 +2156,8 @@ test_arglist \
|
||||
test_matchadd_conceal_utf8 \
|
||||
test_menu \
|
||||
test_messages \
|
||||
test_mksession \
|
||||
test_mksession_utf8 \
|
||||
test_nested_function \
|
||||
test_netbeans \
|
||||
test_normal \
|
||||
@@ -2143,10 +2166,13 @@ test_arglist \
|
||||
test_partial \
|
||||
test_perl \
|
||||
test_popup \
|
||||
test_profile \
|
||||
test_put \
|
||||
test_quickfix \
|
||||
test_regexp_latin \
|
||||
test_regexp_utf8 \
|
||||
test_reltime \
|
||||
test_retab \
|
||||
test_ruby \
|
||||
test_search \
|
||||
test_searchpos \
|
||||
@@ -2162,6 +2188,7 @@ test_arglist \
|
||||
test_substitute \
|
||||
test_syn_attr \
|
||||
test_syntax \
|
||||
test_system \
|
||||
test_tabline \
|
||||
test_tabpage \
|
||||
test_tagcase \
|
||||
@@ -2868,8 +2895,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 +3003,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 +3039,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 +3048,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
|
||||
@@ -3090,7 +3126,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
|
||||
|
||||
Vendored
+10
-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 \
|
||||
|
||||
+10
-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
|
||||
/*
|
||||
@@ -4868,8 +4871,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
|
||||
{
|
||||
|
||||
+160
-20
@@ -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;
|
||||
@@ -1916,9 +1924,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 +1950,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)
|
||||
{
|
||||
@@ -2071,11 +2083,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 +2103,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 +2120,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 +2509,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 +2553,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 +2630,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 +2639,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 +2676,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 +2712,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 +2901,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 +3201,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 +3357,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 +3378,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;
|
||||
@@ -3840,6 +3929,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 +3978,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 +4013,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 +4404,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))
|
||||
|
||||
+32
-6
@@ -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
|
||||
@@ -1901,7 +1901,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 +1916,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 +1933,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 +1948,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 +1966,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
|
||||
|
||||
+10
-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 \
|
||||
|
||||
+106
-6
@@ -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.
|
||||
@@ -782,10 +783,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 +1030,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 +1207,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:
|
||||
@@ -3889,7 +3904,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)
|
||||
@@ -9457,6 +9472,91 @@ 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;
|
||||
|
||||
/* 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;
|
||||
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)
|
||||
{
|
||||
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;
|
||||
|
||||
return ret_char;
|
||||
}
|
||||
|
||||
#if defined(FEAT_GUI_TABLINE) || defined(PROTO)
|
||||
static void
|
||||
ins_tabline(int c)
|
||||
|
||||
+62
-28
@@ -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);
|
||||
@@ -9216,6 +9247,8 @@ fill_assert_error(
|
||||
{
|
||||
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)
|
||||
@@ -9225,16 +9258,17 @@ fill_assert_error(
|
||||
}
|
||||
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));
|
||||
vim_free(tofree);
|
||||
if (atype != ASSERT_NOTEQUAL)
|
||||
{
|
||||
if (atype == ASSERT_MATCH)
|
||||
ga_concat(gap, (char_u *)" does not match ");
|
||||
else if (atype == ASSERT_NOTMATCH)
|
||||
ga_concat(gap, (char_u *)" does match ");
|
||||
else
|
||||
ga_concat(gap, (char_u *)" but got ");
|
||||
ga_concat_esc(gap, tv2string(got_tv, &tofree, numbuf, 0));
|
||||
vim_free(tofree);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+80
-61
@@ -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);
|
||||
@@ -470,7 +471,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 +500,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},
|
||||
@@ -921,34 +923,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 +1752,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
|
||||
*/
|
||||
@@ -3315,21 +3304,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 +3936,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 +4222,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 +4231,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;
|
||||
@@ -5978,6 +5959,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;
|
||||
@@ -6815,8 +6800,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 +6869,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;
|
||||
@@ -9514,15 +9496,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;
|
||||
@@ -11072,10 +11054,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 +11075,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 +11088,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 +11099,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 +11813,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 +11826,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 +11841,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)
|
||||
|
||||
+7
-2
@@ -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. */
|
||||
|
||||
+18
-16
@@ -5164,24 +5164,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 +5208,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
|
||||
|
||||
+49
-16
@@ -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) \
|
||||
@@ -794,8 +794,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 +1803,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 +2028,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
|
||||
@@ -2182,7 +2188,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)
|
||||
@@ -2284,7 +2290,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 */
|
||||
check_cursor_lnum();
|
||||
}
|
||||
}
|
||||
else if (*ea.cmd != ',')
|
||||
break;
|
||||
@@ -2300,9 +2310,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.
|
||||
*/
|
||||
@@ -3871,7 +3878,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 +3902,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 +4116,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;
|
||||
|
||||
@@ -4379,7 +4401,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;
|
||||
@@ -4655,10 +4678,20 @@ get_address(
|
||||
|| 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 == '?');
|
||||
|
||||
@@ -7588,7 +7621,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
|
||||
@@ -8849,7 +8882,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 +9352,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;
|
||||
|
||||
+4
-5
@@ -212,7 +212,8 @@ getcmdline(
|
||||
#endif
|
||||
expand_T xpc;
|
||||
long *b_im_ptr = NULL;
|
||||
#if defined(FEAT_WILDMENU) || defined(FEAT_EVAL) || defined(FEAT_SEARCH_EXTRA)
|
||||
#if defined(FEAT_WILDMENU) || defined(FEAT_EVAL) \
|
||||
|| defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CMDWIN)
|
||||
/* Everything that may work recursively should save and restore the
|
||||
* current command line in save_ccline. That includes update_screen(), a
|
||||
* custom status line may invoke ":normal". */
|
||||
@@ -6915,9 +6916,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 +6963,7 @@ ex_window(void)
|
||||
# endif
|
||||
|
||||
/* Restore the command line info. */
|
||||
ccline = save_ccline;
|
||||
restore_cmdline(&save_ccline);
|
||||
cmdwin_type = 0;
|
||||
|
||||
exmode_active = save_exmode;
|
||||
|
||||
+8
-3
@@ -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(
|
||||
@@ -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)
|
||||
@@ -7174,7 +7179,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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -51,6 +51,9 @@
|
||||
# ifdef _
|
||||
# undef _
|
||||
# endif
|
||||
# ifdef ngettext
|
||||
# undef ngettext
|
||||
# endif
|
||||
# ifdef N_
|
||||
# undef N_
|
||||
# endif
|
||||
|
||||
+13
-2
@@ -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
|
||||
@@ -4492,7 +4499,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 +4515,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
|
||||
|
||||
+39
-27
@@ -2297,19 +2297,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 +2322,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);
|
||||
@@ -3539,12 +3551,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 +3593,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))
|
||||
@@ -5559,7 +5571,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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
+9
-5
@@ -933,13 +933,17 @@ Python_Init(void)
|
||||
EMSG(_("E263: Sorry, this command is disabled, the Python library could not be loaded."));
|
||||
goto fail;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PYTHON_HOME
|
||||
# ifdef DYNAMIC_PYTHON
|
||||
if (mch_getenv((char_u *)"PYTHONHOME") == NULL)
|
||||
# endif
|
||||
if (p_pyhome && *p_pyhome != '\0')
|
||||
Py_SetPythonHome((char *)p_pyhome);
|
||||
# ifdef PYTHON_HOME
|
||||
else if (mch_getenv((char_u *)"PYTHONHOME") == NULL)
|
||||
Py_SetPythonHome(PYTHON_HOME);
|
||||
# endif
|
||||
#else
|
||||
# ifdef PYTHON_HOME
|
||||
Py_SetPythonHome(PYTHON_HOME);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
init_structs();
|
||||
|
||||
+19
-5
@@ -860,12 +860,26 @@ Python3_Init(void)
|
||||
|
||||
init_structs();
|
||||
|
||||
|
||||
#ifdef PYTHON3_HOME
|
||||
# ifdef DYNAMIC_PYTHON3
|
||||
if (mch_getenv((char_u *)"PYTHONHOME") == NULL)
|
||||
# endif
|
||||
#ifdef DYNAMIC_PYTHON3
|
||||
if (*p_py3home != '\0')
|
||||
{
|
||||
int len;
|
||||
wchar_t *buf;
|
||||
len = mbstowcs(NULL, (char *)p_py3home, 0) + 1;
|
||||
buf = (wchar_t *)alloc(len * sizeof(wchar_t));
|
||||
if (buf && mbstowcs(buf, (char *)p_py3home, len) != (size_t)-1) {
|
||||
Py_SetPythonHome(buf);
|
||||
/* We must keep buf for Py_SetPythonHome */
|
||||
}
|
||||
}
|
||||
# ifdef PYTHON3_HOME
|
||||
else if (mch_getenv((char_u *)"PYTHONHOME") == NULL)
|
||||
Py_SetPythonHome(PYTHON3_HOME);
|
||||
# endif
|
||||
#else
|
||||
# ifdef PYTHON3_HOME
|
||||
Py_SetPythonHome(PYTHON3_HOME);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
PyImport_AppendInittab("vim", Py3Init_vim);
|
||||
|
||||
+10
-5
@@ -312,6 +312,7 @@ static void ruby_vim_init(void);
|
||||
# define ruby_init_loadpath dll_ruby_init_loadpath
|
||||
# ifdef WIN3264
|
||||
# define NtInitialize dll_NtInitialize
|
||||
# define ruby_sysinit dll_ruby_sysinit
|
||||
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
|
||||
# define rb_w32_snprintf dll_rb_w32_snprintf
|
||||
# endif
|
||||
@@ -414,6 +415,7 @@ static void (*dll_ruby_init) (void);
|
||||
static void (*dll_ruby_init_loadpath) (void);
|
||||
# ifdef WIN3264
|
||||
static void (*dll_NtInitialize) (int*, char***);
|
||||
static void (*dll_ruby_sysinit) (int*, char***);
|
||||
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
|
||||
static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...);
|
||||
# endif
|
||||
@@ -523,9 +525,10 @@ static struct
|
||||
{
|
||||
{"rb_assoc_new", (RUBY_PROC*)&dll_rb_assoc_new},
|
||||
{"rb_cFalseClass", (RUBY_PROC*)&dll_rb_cFalseClass},
|
||||
{"rb_cFixnum", (RUBY_PROC*)&dll_rb_cFixnum},
|
||||
# if defined(USE_RUBY_INTEGER)
|
||||
{"rb_cInteger", (RUBY_PROC*)&dll_rb_cInteger},
|
||||
# else
|
||||
{"rb_cFixnum", (RUBY_PROC*)&dll_rb_cFixnum},
|
||||
# endif
|
||||
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20
|
||||
{"rb_cFloat", (RUBY_PROC*)&dll_rb_cFloat},
|
||||
@@ -602,13 +605,11 @@ static struct
|
||||
{"ruby_init", (RUBY_PROC*)&dll_ruby_init},
|
||||
{"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath},
|
||||
# ifdef WIN3264
|
||||
{
|
||||
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 19
|
||||
"NtInitialize",
|
||||
{"NtInitialize", (RUBY_PROC*)&dll_NtInitialize},
|
||||
# else
|
||||
"ruby_sysinit",
|
||||
{"ruby_sysinit", (RUBY_PROC*)&dll_ruby_sysinit},
|
||||
# endif
|
||||
(RUBY_PROC*)&dll_NtInitialize},
|
||||
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
|
||||
{"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf},
|
||||
# endif
|
||||
@@ -870,7 +871,11 @@ static int ensure_ruby_initialized(void)
|
||||
int argc = 1;
|
||||
char *argv[] = {"gvim.exe"};
|
||||
char **argvp = argv;
|
||||
# ifdef RUBY19_OR_LATER
|
||||
ruby_sysinit(&argc, &argvp);
|
||||
# else
|
||||
NtInitialize(&argc, &argvp);
|
||||
# endif
|
||||
#endif
|
||||
{
|
||||
#if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
|
||||
|
||||
+436
-293
@@ -378,176 +378,7 @@ json_skip_white(js_read_T *reader)
|
||||
}
|
||||
|
||||
static int
|
||||
json_decode_array(js_read_T *reader, typval_T *res, int options)
|
||||
{
|
||||
char_u *p;
|
||||
typval_T item;
|
||||
listitem_T *li;
|
||||
int ret;
|
||||
|
||||
if (res != NULL && rettv_list_alloc(res) == FAIL)
|
||||
{
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_NONE;
|
||||
return FAIL;
|
||||
}
|
||||
++reader->js_used; /* consume the '[' */
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
json_skip_white(reader);
|
||||
p = reader->js_buf + reader->js_used;
|
||||
if (*p == NUL)
|
||||
return MAYBE;
|
||||
if (*p == ']')
|
||||
{
|
||||
++reader->js_used; /* consume the ']' */
|
||||
break;
|
||||
}
|
||||
|
||||
ret = json_decode_item(reader, res == NULL ? NULL : &item, options);
|
||||
if (ret != OK)
|
||||
return ret;
|
||||
if (res != NULL)
|
||||
{
|
||||
li = listitem_alloc();
|
||||
if (li == NULL)
|
||||
{
|
||||
clear_tv(&item);
|
||||
return FAIL;
|
||||
}
|
||||
li->li_tv = item;
|
||||
list_append(res->vval.v_list, li);
|
||||
}
|
||||
|
||||
json_skip_white(reader);
|
||||
p = reader->js_buf + reader->js_used;
|
||||
if (*p == ',')
|
||||
++reader->js_used;
|
||||
else if (*p != ']')
|
||||
{
|
||||
if (*p == NUL)
|
||||
return MAYBE;
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int
|
||||
json_decode_object(js_read_T *reader, typval_T *res, int options)
|
||||
{
|
||||
char_u *p;
|
||||
typval_T tvkey;
|
||||
typval_T item;
|
||||
dictitem_T *di;
|
||||
char_u buf[NUMBUFLEN];
|
||||
char_u *key = NULL;
|
||||
int ret;
|
||||
|
||||
if (res != NULL && rettv_dict_alloc(res) == FAIL)
|
||||
{
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_NONE;
|
||||
return FAIL;
|
||||
}
|
||||
++reader->js_used; /* consume the '{' */
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
json_skip_white(reader);
|
||||
p = reader->js_buf + reader->js_used;
|
||||
if (*p == NUL)
|
||||
return MAYBE;
|
||||
if (*p == '}')
|
||||
{
|
||||
++reader->js_used; /* consume the '}' */
|
||||
break;
|
||||
}
|
||||
|
||||
if ((options & JSON_JS) && reader->js_buf[reader->js_used] != '"')
|
||||
{
|
||||
/* accept a key that is not in quotes */
|
||||
key = p = reader->js_buf + reader->js_used;
|
||||
while (*p != NUL && *p != ':' && *p > ' ')
|
||||
++p;
|
||||
tvkey.v_type = VAR_STRING;
|
||||
tvkey.vval.v_string = vim_strnsave(key, (int)(p - key));
|
||||
reader->js_used += (int)(p - key);
|
||||
key = tvkey.vval.v_string;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = json_decode_item(reader, res == NULL ? NULL : &tvkey,
|
||||
options);
|
||||
if (ret != OK)
|
||||
return ret;
|
||||
if (res != NULL)
|
||||
{
|
||||
key = get_tv_string_buf_chk(&tvkey, buf);
|
||||
if (key == NULL || *key == NUL)
|
||||
{
|
||||
clear_tv(&tvkey);
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
json_skip_white(reader);
|
||||
p = reader->js_buf + reader->js_used;
|
||||
if (*p != ':')
|
||||
{
|
||||
if (res != NULL)
|
||||
clear_tv(&tvkey);
|
||||
if (*p == NUL)
|
||||
return MAYBE;
|
||||
return FAIL;
|
||||
}
|
||||
++reader->js_used;
|
||||
json_skip_white(reader);
|
||||
|
||||
ret = json_decode_item(reader, res == NULL ? NULL : &item, options);
|
||||
if (ret != OK)
|
||||
{
|
||||
if (res != NULL)
|
||||
clear_tv(&tvkey);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (res != NULL)
|
||||
{
|
||||
di = dictitem_alloc(key);
|
||||
clear_tv(&tvkey);
|
||||
if (di == NULL)
|
||||
{
|
||||
clear_tv(&item);
|
||||
return FAIL;
|
||||
}
|
||||
di->di_tv = item;
|
||||
di->di_tv.v_lock = 0;
|
||||
if (dict_add(res->vval.v_dict, di) == FAIL)
|
||||
{
|
||||
dictitem_free(di);
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
json_skip_white(reader);
|
||||
p = reader->js_buf + reader->js_used;
|
||||
if (*p == ',')
|
||||
++reader->js_used;
|
||||
else if (*p != '}')
|
||||
{
|
||||
if (*p == NUL)
|
||||
return MAYBE;
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int
|
||||
json_decode_string(js_read_T *reader, typval_T *res)
|
||||
json_decode_string(js_read_T *reader, typval_T *res, int quote)
|
||||
{
|
||||
garray_T ga;
|
||||
int len;
|
||||
@@ -558,8 +389,8 @@ json_decode_string(js_read_T *reader, typval_T *res)
|
||||
if (res != NULL)
|
||||
ga_init2(&ga, 1, 200);
|
||||
|
||||
p = reader->js_buf + reader->js_used + 1; /* skip over " */
|
||||
while (*p != '"')
|
||||
p = reader->js_buf + reader->js_used + 1; /* skip over " or ' */
|
||||
while (*p != quote)
|
||||
{
|
||||
/* The JSON is always expected to be utf-8, thus use utf functions
|
||||
* here. The string is converted below if needed. */
|
||||
@@ -673,7 +504,7 @@ json_decode_string(js_read_T *reader, typval_T *res)
|
||||
}
|
||||
|
||||
reader->js_used = (int)(p - reader->js_buf);
|
||||
if (*p == '"')
|
||||
if (*p == quote)
|
||||
{
|
||||
++reader->js_used;
|
||||
if (res != NULL)
|
||||
@@ -711,11 +542,24 @@ json_decode_string(js_read_T *reader, typval_T *res)
|
||||
return MAYBE;
|
||||
}
|
||||
|
||||
typedef enum {
|
||||
JSON_ARRAY, /* parsing items in an array */
|
||||
JSON_OBJECT_KEY, /* parsing key of an object */
|
||||
JSON_OBJECT /* parsing item in an object, after the key */
|
||||
} json_decode_T;
|
||||
|
||||
typedef struct {
|
||||
json_decode_T jd_type;
|
||||
typval_T jd_tv; /* the list or dict */
|
||||
typval_T jd_key_tv;
|
||||
char_u *jd_key;
|
||||
} json_dec_item_T;
|
||||
|
||||
/*
|
||||
* Decode one item and put it in "res". If "res" is NULL only advance.
|
||||
* Must already have skipped white space.
|
||||
*
|
||||
* Return FAIL for a decoding error.
|
||||
* Return FAIL for a decoding error (and give an error).
|
||||
* Return MAYBE for an incomplete message.
|
||||
*/
|
||||
static int
|
||||
@@ -723,150 +567,441 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
|
||||
{
|
||||
char_u *p;
|
||||
int len;
|
||||
int retval;
|
||||
garray_T stack;
|
||||
typval_T item;
|
||||
typval_T *cur_item;
|
||||
json_dec_item_T *top_item;
|
||||
char_u key_buf[NUMBUFLEN];
|
||||
|
||||
ga_init2(&stack, sizeof(json_dec_item_T), 100);
|
||||
cur_item = res;
|
||||
init_tv(&item);
|
||||
if (res != NULL)
|
||||
init_tv(res);
|
||||
|
||||
fill_numbuflen(reader);
|
||||
p = reader->js_buf + reader->js_used;
|
||||
switch (*p)
|
||||
for (;;)
|
||||
{
|
||||
case '[': /* array */
|
||||
return json_decode_array(reader, res, options);
|
||||
|
||||
case '{': /* object */
|
||||
return json_decode_object(reader, res, options);
|
||||
|
||||
case '"': /* string */
|
||||
return json_decode_string(reader, res);
|
||||
|
||||
case ',': /* comma: empty item */
|
||||
if ((options & JSON_JS) == 0)
|
||||
return FAIL;
|
||||
/* FALLTHROUGH */
|
||||
case NUL: /* empty */
|
||||
if (res != NULL)
|
||||
top_item = NULL;
|
||||
if (stack.ga_len > 0)
|
||||
{
|
||||
top_item = ((json_dec_item_T *)stack.ga_data) + stack.ga_len - 1;
|
||||
json_skip_white(reader);
|
||||
p = reader->js_buf + reader->js_used;
|
||||
if (*p == NUL)
|
||||
{
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_NONE;
|
||||
retval = MAYBE;
|
||||
if (top_item->jd_type == JSON_OBJECT)
|
||||
/* did get the key, clear it */
|
||||
clear_tv(&top_item->jd_key_tv);
|
||||
goto theend;
|
||||
}
|
||||
return OK;
|
||||
|
||||
default:
|
||||
if (VIM_ISDIGIT(*p) || *p == '-')
|
||||
if (top_item->jd_type == JSON_OBJECT_KEY
|
||||
|| top_item->jd_type == JSON_ARRAY)
|
||||
{
|
||||
#ifdef FEAT_FLOAT
|
||||
char_u *sp = p;
|
||||
|
||||
if (*sp == '-')
|
||||
/* Check for end of object or array. */
|
||||
if (*p == (top_item->jd_type == JSON_ARRAY ? ']' : '}'))
|
||||
{
|
||||
++sp;
|
||||
if (*sp == NUL)
|
||||
return MAYBE;
|
||||
if (!VIM_ISDIGIT(*sp))
|
||||
return FAIL;
|
||||
}
|
||||
sp = skipdigits(sp);
|
||||
if (*sp == '.' || *sp == 'e' || *sp == 'E')
|
||||
{
|
||||
if (res == NULL)
|
||||
++reader->js_used; /* consume the ']' or '}' */
|
||||
--stack.ga_len;
|
||||
if (stack.ga_len == 0)
|
||||
{
|
||||
float_T f;
|
||||
|
||||
len = string2float(p, &f);
|
||||
retval = OK;
|
||||
goto theend;
|
||||
}
|
||||
if (cur_item != NULL)
|
||||
cur_item = &top_item->jd_tv;
|
||||
goto item_end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (top_item != NULL && top_item->jd_type == JSON_OBJECT_KEY
|
||||
&& (options & JSON_JS)
|
||||
&& reader->js_buf[reader->js_used] != '"'
|
||||
&& reader->js_buf[reader->js_used] != '\'')
|
||||
{
|
||||
char_u *key;
|
||||
|
||||
/* accept an object key that is not in quotes */
|
||||
key = p = reader->js_buf + reader->js_used;
|
||||
while (*p != NUL && *p != ':' && *p > ' ')
|
||||
++p;
|
||||
if (cur_item != NULL)
|
||||
{
|
||||
cur_item->v_type = VAR_STRING;
|
||||
cur_item->vval.v_string = vim_strnsave(key, (int)(p - key));
|
||||
top_item->jd_key = cur_item->vval.v_string;
|
||||
}
|
||||
reader->js_used += (int)(p - key);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (*p)
|
||||
{
|
||||
case '[': /* start of array */
|
||||
if (ga_grow(&stack, 1) == FAIL)
|
||||
{
|
||||
retval = FAIL;
|
||||
break;
|
||||
}
|
||||
if (cur_item != NULL && rettv_list_alloc(cur_item) == FAIL)
|
||||
{
|
||||
cur_item->v_type = VAR_SPECIAL;
|
||||
cur_item->vval.v_number = VVAL_NONE;
|
||||
retval = FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
++reader->js_used; /* consume the '[' */
|
||||
top_item = ((json_dec_item_T *)stack.ga_data)
|
||||
+ stack.ga_len;
|
||||
top_item->jd_type = JSON_ARRAY;
|
||||
++stack.ga_len;
|
||||
if (cur_item != NULL)
|
||||
{
|
||||
top_item->jd_tv = *cur_item;
|
||||
cur_item = &item;
|
||||
}
|
||||
continue;
|
||||
|
||||
case '{': /* start of object */
|
||||
if (ga_grow(&stack, 1) == FAIL)
|
||||
{
|
||||
retval = FAIL;
|
||||
break;
|
||||
}
|
||||
if (cur_item != NULL && rettv_dict_alloc(cur_item) == FAIL)
|
||||
{
|
||||
cur_item->v_type = VAR_SPECIAL;
|
||||
cur_item->vval.v_number = VVAL_NONE;
|
||||
retval = FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
++reader->js_used; /* consume the '{' */
|
||||
top_item = ((json_dec_item_T *)stack.ga_data)
|
||||
+ stack.ga_len;
|
||||
top_item->jd_type = JSON_OBJECT_KEY;
|
||||
++stack.ga_len;
|
||||
if (cur_item != NULL)
|
||||
{
|
||||
top_item->jd_tv = *cur_item;
|
||||
cur_item = &top_item->jd_key_tv;
|
||||
}
|
||||
continue;
|
||||
|
||||
case '"': /* string */
|
||||
retval = json_decode_string(reader, cur_item, *p);
|
||||
break;
|
||||
|
||||
case '\'':
|
||||
if (options & JSON_JS)
|
||||
retval = json_decode_string(reader, cur_item, *p);
|
||||
else
|
||||
{
|
||||
res->v_type = VAR_FLOAT;
|
||||
len = string2float(p, &res->vval.v_float);
|
||||
EMSG(_(e_invarg));
|
||||
retval = FAIL;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
varnumber_T nr;
|
||||
break;
|
||||
|
||||
vim_str2nr(reader->js_buf + reader->js_used,
|
||||
NULL, &len, 0, /* what */
|
||||
&nr, NULL, 0);
|
||||
if (res != NULL)
|
||||
case ',': /* comma: empty item */
|
||||
if ((options & JSON_JS) == 0)
|
||||
{
|
||||
res->v_type = VAR_NUMBER;
|
||||
res->vval.v_number = nr;
|
||||
EMSG(_(e_invarg));
|
||||
retval = FAIL;
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
case NUL: /* empty */
|
||||
if (cur_item != NULL)
|
||||
{
|
||||
cur_item->v_type = VAR_SPECIAL;
|
||||
cur_item->vval.v_number = VVAL_NONE;
|
||||
}
|
||||
retval = OK;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (VIM_ISDIGIT(*p) || *p == '-')
|
||||
{
|
||||
#ifdef FEAT_FLOAT
|
||||
char_u *sp = p;
|
||||
|
||||
if (*sp == '-')
|
||||
{
|
||||
++sp;
|
||||
if (*sp == NUL)
|
||||
{
|
||||
retval = MAYBE;
|
||||
break;
|
||||
}
|
||||
if (!VIM_ISDIGIT(*sp))
|
||||
{
|
||||
EMSG(_(e_invarg));
|
||||
retval = FAIL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
sp = skipdigits(sp);
|
||||
if (*sp == '.' || *sp == 'e' || *sp == 'E')
|
||||
{
|
||||
if (cur_item == NULL)
|
||||
{
|
||||
float_T f;
|
||||
|
||||
len = string2float(p, &f);
|
||||
}
|
||||
else
|
||||
{
|
||||
cur_item->v_type = VAR_FLOAT;
|
||||
len = string2float(p, &cur_item->vval.v_float);
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
varnumber_T nr;
|
||||
|
||||
vim_str2nr(reader->js_buf + reader->js_used,
|
||||
NULL, &len, 0, /* what */
|
||||
&nr, NULL, 0);
|
||||
if (cur_item != NULL)
|
||||
{
|
||||
cur_item->v_type = VAR_NUMBER;
|
||||
cur_item->vval.v_number = nr;
|
||||
}
|
||||
}
|
||||
reader->js_used += len;
|
||||
retval = OK;
|
||||
break;
|
||||
}
|
||||
if (STRNICMP((char *)p, "false", 5) == 0)
|
||||
{
|
||||
reader->js_used += 5;
|
||||
if (cur_item != NULL)
|
||||
{
|
||||
cur_item->v_type = VAR_SPECIAL;
|
||||
cur_item->vval.v_number = VVAL_FALSE;
|
||||
}
|
||||
retval = OK;
|
||||
break;
|
||||
}
|
||||
if (STRNICMP((char *)p, "true", 4) == 0)
|
||||
{
|
||||
reader->js_used += 4;
|
||||
if (cur_item != NULL)
|
||||
{
|
||||
cur_item->v_type = VAR_SPECIAL;
|
||||
cur_item->vval.v_number = VVAL_TRUE;
|
||||
}
|
||||
retval = OK;
|
||||
break;
|
||||
}
|
||||
if (STRNICMP((char *)p, "null", 4) == 0)
|
||||
{
|
||||
reader->js_used += 4;
|
||||
if (cur_item != NULL)
|
||||
{
|
||||
cur_item->v_type = VAR_SPECIAL;
|
||||
cur_item->vval.v_number = VVAL_NULL;
|
||||
}
|
||||
retval = OK;
|
||||
break;
|
||||
}
|
||||
#ifdef FEAT_FLOAT
|
||||
if (STRNICMP((char *)p, "NaN", 3) == 0)
|
||||
{
|
||||
reader->js_used += 3;
|
||||
if (cur_item != NULL)
|
||||
{
|
||||
cur_item->v_type = VAR_FLOAT;
|
||||
cur_item->vval.v_float = NAN;
|
||||
}
|
||||
retval = OK;
|
||||
break;
|
||||
}
|
||||
if (STRNICMP((char *)p, "Infinity", 8) == 0)
|
||||
{
|
||||
reader->js_used += 8;
|
||||
if (cur_item != NULL)
|
||||
{
|
||||
cur_item->v_type = VAR_FLOAT;
|
||||
cur_item->vval.v_float = INFINITY;
|
||||
}
|
||||
retval = OK;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
/* check for truncated name */
|
||||
len = (int)(reader->js_end - (reader->js_buf + reader->js_used));
|
||||
if (
|
||||
(len < 5 && STRNICMP((char *)p, "false", len) == 0)
|
||||
#ifdef FEAT_FLOAT
|
||||
|| (len < 8 && STRNICMP((char *)p, "Infinity", len) == 0)
|
||||
|| (len < 3 && STRNICMP((char *)p, "NaN", len) == 0)
|
||||
#endif
|
||||
|| (len < 4 && (STRNICMP((char *)p, "true", len) == 0
|
||||
|| STRNICMP((char *)p, "null", len) == 0)))
|
||||
|
||||
retval = MAYBE;
|
||||
else
|
||||
retval = FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
/* We are finished when retval is FAIL or MAYBE and when at the
|
||||
* toplevel. */
|
||||
if (retval == FAIL)
|
||||
break;
|
||||
if (retval == MAYBE || stack.ga_len == 0)
|
||||
goto theend;
|
||||
|
||||
if (top_item != NULL && top_item->jd_type == JSON_OBJECT_KEY
|
||||
&& cur_item != NULL)
|
||||
{
|
||||
top_item->jd_key = get_tv_string_buf_chk(cur_item, key_buf);
|
||||
if (top_item->jd_key == NULL || *top_item->jd_key == NUL)
|
||||
{
|
||||
clear_tv(cur_item);
|
||||
EMSG(_(e_invarg));
|
||||
retval = FAIL;
|
||||
goto theend;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
item_end:
|
||||
top_item = ((json_dec_item_T *)stack.ga_data) + stack.ga_len - 1;
|
||||
switch (top_item->jd_type)
|
||||
{
|
||||
case JSON_ARRAY:
|
||||
if (res != NULL)
|
||||
{
|
||||
listitem_T *li = listitem_alloc();
|
||||
|
||||
if (li == NULL)
|
||||
{
|
||||
clear_tv(cur_item);
|
||||
retval = FAIL;
|
||||
goto theend;
|
||||
}
|
||||
li->li_tv = *cur_item;
|
||||
list_append(top_item->jd_tv.vval.v_list, li);
|
||||
}
|
||||
if (cur_item != NULL)
|
||||
cur_item = &item;
|
||||
|
||||
json_skip_white(reader);
|
||||
p = reader->js_buf + reader->js_used;
|
||||
if (*p == ',')
|
||||
++reader->js_used;
|
||||
else if (*p != ']')
|
||||
{
|
||||
if (*p == NUL)
|
||||
retval = MAYBE;
|
||||
else
|
||||
{
|
||||
EMSG(_(e_invarg));
|
||||
retval = FAIL;
|
||||
}
|
||||
goto theend;
|
||||
}
|
||||
break;
|
||||
|
||||
case JSON_OBJECT_KEY:
|
||||
json_skip_white(reader);
|
||||
p = reader->js_buf + reader->js_used;
|
||||
if (*p != ':')
|
||||
{
|
||||
if (cur_item != NULL)
|
||||
clear_tv(cur_item);
|
||||
if (*p == NUL)
|
||||
retval = MAYBE;
|
||||
else
|
||||
{
|
||||
EMSG(_(e_invarg));
|
||||
retval = FAIL;
|
||||
}
|
||||
goto theend;
|
||||
}
|
||||
++reader->js_used;
|
||||
json_skip_white(reader);
|
||||
top_item->jd_type = JSON_OBJECT;
|
||||
if (cur_item != NULL)
|
||||
cur_item = &item;
|
||||
break;
|
||||
|
||||
case JSON_OBJECT:
|
||||
if (cur_item != NULL
|
||||
&& dict_find(top_item->jd_tv.vval.v_dict,
|
||||
top_item->jd_key, -1) != NULL)
|
||||
{
|
||||
EMSG2(_("E938: Duplicate key in JSON: \"%s\""),
|
||||
top_item->jd_key);
|
||||
clear_tv(&top_item->jd_key_tv);
|
||||
clear_tv(cur_item);
|
||||
retval = FAIL;
|
||||
goto theend;
|
||||
}
|
||||
|
||||
if (cur_item != NULL)
|
||||
{
|
||||
dictitem_T *di = dictitem_alloc(top_item->jd_key);
|
||||
|
||||
clear_tv(&top_item->jd_key_tv);
|
||||
if (di == NULL)
|
||||
{
|
||||
clear_tv(cur_item);
|
||||
retval = FAIL;
|
||||
goto theend;
|
||||
}
|
||||
di->di_tv = *cur_item;
|
||||
di->di_tv.v_lock = 0;
|
||||
if (dict_add(top_item->jd_tv.vval.v_dict, di) == FAIL)
|
||||
{
|
||||
dictitem_free(di);
|
||||
retval = FAIL;
|
||||
goto theend;
|
||||
}
|
||||
}
|
||||
reader->js_used += len;
|
||||
return OK;
|
||||
}
|
||||
if (STRNICMP((char *)p, "false", 5) == 0)
|
||||
{
|
||||
reader->js_used += 5;
|
||||
if (res != NULL)
|
||||
|
||||
json_skip_white(reader);
|
||||
p = reader->js_buf + reader->js_used;
|
||||
if (*p == ',')
|
||||
++reader->js_used;
|
||||
else if (*p != '}')
|
||||
{
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_FALSE;
|
||||
if (*p == NUL)
|
||||
retval = MAYBE;
|
||||
else
|
||||
{
|
||||
EMSG(_(e_invarg));
|
||||
retval = FAIL;
|
||||
}
|
||||
goto theend;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
if (STRNICMP((char *)p, "true", 4) == 0)
|
||||
{
|
||||
reader->js_used += 4;
|
||||
if (res != NULL)
|
||||
{
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_TRUE;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
if (STRNICMP((char *)p, "null", 4) == 0)
|
||||
{
|
||||
reader->js_used += 4;
|
||||
if (res != NULL)
|
||||
{
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_NULL;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
#ifdef FEAT_FLOAT
|
||||
if (STRNICMP((char *)p, "NaN", 3) == 0)
|
||||
{
|
||||
reader->js_used += 3;
|
||||
if (res != NULL)
|
||||
{
|
||||
res->v_type = VAR_FLOAT;
|
||||
res->vval.v_float = NAN;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
if (STRNICMP((char *)p, "Infinity", 8) == 0)
|
||||
{
|
||||
reader->js_used += 8;
|
||||
if (res != NULL)
|
||||
{
|
||||
res->v_type = VAR_FLOAT;
|
||||
res->vval.v_float = INFINITY;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
/* check for truncated name */
|
||||
len = (int)(reader->js_end - (reader->js_buf + reader->js_used));
|
||||
if (
|
||||
(len < 5 && STRNICMP((char *)p, "false", len) == 0)
|
||||
#ifdef FEAT_FLOAT
|
||||
|| (len < 8 && STRNICMP((char *)p, "Infinity", len) == 0)
|
||||
|| (len < 3 && STRNICMP((char *)p, "NaN", len) == 0)
|
||||
#endif
|
||||
|| (len < 4 && (STRNICMP((char *)p, "true", len) == 0
|
||||
|| STRNICMP((char *)p, "null", len) == 0)))
|
||||
return MAYBE;
|
||||
break;
|
||||
top_item->jd_type = JSON_OBJECT_KEY;
|
||||
if (cur_item != NULL)
|
||||
cur_item = &top_item->jd_key_tv;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Get here when parsing failed. */
|
||||
if (res != NULL)
|
||||
{
|
||||
clear_tv(res);
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_NONE;
|
||||
}
|
||||
return FAIL;
|
||||
EMSG(_(e_invarg));
|
||||
|
||||
theend:
|
||||
ga_clear(&stack);
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -884,10 +1019,17 @@ json_decode_all(js_read_T *reader, typval_T *res, int options)
|
||||
json_skip_white(reader);
|
||||
ret = json_decode_item(reader, res, options);
|
||||
if (ret != OK)
|
||||
{
|
||||
if (ret == MAYBE)
|
||||
EMSG(_(e_invarg));
|
||||
return FAIL;
|
||||
}
|
||||
json_skip_white(reader);
|
||||
if (reader->js_buf[reader->js_used] != NUL)
|
||||
{
|
||||
EMSG(_(e_trailing));
|
||||
return FAIL;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -914,7 +1056,8 @@ json_decode(js_read_T *reader, typval_T *res, int options)
|
||||
|
||||
/*
|
||||
* Decode the JSON from "reader" to find the end of the message.
|
||||
* "options" can be JSON_JS or zero;
|
||||
* "options" can be JSON_JS or zero.
|
||||
* This is only used for testing.
|
||||
* Return FAIL if the message has a decoding error.
|
||||
* Return MAYBE if the message is truncated, need to read more.
|
||||
* This only works reliable if the message contains an object, array or
|
||||
|
||||
+7
-1
@@ -107,6 +107,12 @@ test_decode_find_end(void)
|
||||
reader.js_buf = (char_u *)" { ";
|
||||
assert(json_find_end(&reader, 0) == MAYBE);
|
||||
|
||||
/* JS object with white space */
|
||||
reader.js_buf = (char_u *)" { a : 123 } ";
|
||||
assert(json_find_end(&reader, JSON_JS) == OK);
|
||||
reader.js_buf = (char_u *)" { a : ";
|
||||
assert(json_find_end(&reader, JSON_JS) == MAYBE);
|
||||
|
||||
/* array without white space */
|
||||
reader.js_buf = (char_u *)"[\"a\",123]";
|
||||
assert(json_find_end(&reader, 0) == OK);
|
||||
@@ -181,7 +187,7 @@ test_fill_called_on_string(void)
|
||||
reader.js_buf = (char_u *)" \"foo";
|
||||
reader.js_end = reader.js_buf + STRLEN(reader.js_buf);
|
||||
reader.js_cookie = " \"foobar\" ";
|
||||
assert(json_decode_string(&reader, NULL) == OK);
|
||||
assert(json_decode_string(&reader, NULL, '"') == OK);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+5
-2
@@ -398,6 +398,8 @@ enum key_extra
|
||||
#define K_KMULTIPLY TERMCAP2KEY('K', '9') /* keypad * */
|
||||
#define K_KENTER TERMCAP2KEY('K', 'A') /* keypad Enter */
|
||||
#define K_KPOINT TERMCAP2KEY('K', 'B') /* keypad . or ,*/
|
||||
#define K_PS TERMCAP2KEY('P', 'S') /* paste start */
|
||||
#define K_PE TERMCAP2KEY('P', 'E') /* paste end */
|
||||
|
||||
#define K_K0 TERMCAP2KEY('K', 'C') /* keypad 0 */
|
||||
#define K_K1 TERMCAP2KEY('K', 'D') /* keypad 1 */
|
||||
@@ -494,9 +496,10 @@ enum key_extra
|
||||
|
||||
/*
|
||||
* The length of the longest special key name, including modifiers.
|
||||
* Current longest is <M-C-S-T-4-MiddleRelease> (length includes '<' and '>').
|
||||
* Current longest is <M-C-S-T-D-A-4-ScrollWheelRight> (length includes '<' and
|
||||
* '>').
|
||||
*/
|
||||
#define MAX_KEY_NAME_LEN 25
|
||||
#define MAX_KEY_NAME_LEN 32
|
||||
|
||||
/* Maximum length of a special key event as tokens. This includes modifiers.
|
||||
* The longest event is something like <M-C-S-T-4-LeftDrag> which would be the
|
||||
|
||||
+1
-1
@@ -885,7 +885,7 @@ failret:
|
||||
}
|
||||
|
||||
/*
|
||||
* Write list of strings to file
|
||||
* Write "list" of strings to file "fd".
|
||||
*/
|
||||
int
|
||||
write_list(FILE *fd, list_T *list, int binary)
|
||||
|
||||
+10
-4
@@ -1036,7 +1036,7 @@ common_init(mparm_T *paramp)
|
||||
* (needed for :! to * work). mch_check_win() will also handle the -d or
|
||||
* -dev argument.
|
||||
*/
|
||||
paramp->stdout_isatty = (mch_check_win(paramp->argc, paramp->argv) != FAIL);
|
||||
stdout_isatty = (mch_check_win(paramp->argc, paramp->argv) != FAIL);
|
||||
TIME_MSG("window checked");
|
||||
|
||||
/*
|
||||
@@ -1906,6 +1906,7 @@ command_line_scan(mparm_T *parmp)
|
||||
/* "--literal" take files literally */
|
||||
/* "--nofork" don't fork */
|
||||
/* "--not-a-term" don't warn for not a term */
|
||||
/* "--ttyfail" exit if not a term */
|
||||
/* "--noplugin[s]" skip plugins */
|
||||
/* "--cmd <cmd>" execute cmd before vimrc */
|
||||
if (STRICMP(argv[0] + argv_idx, "help") == 0)
|
||||
@@ -1935,6 +1936,8 @@ command_line_scan(mparm_T *parmp)
|
||||
p_lpl = FALSE;
|
||||
else if (STRNICMP(argv[0] + argv_idx, "not-a-term", 10) == 0)
|
||||
parmp->not_a_term = TRUE;
|
||||
else if (STRNICMP(argv[0] + argv_idx, "ttyfail", 7) == 0)
|
||||
parmp->tty_fail = TRUE;
|
||||
else if (STRNICMP(argv[0] + argv_idx, "cmd", 3) == 0)
|
||||
{
|
||||
want_argument = TRUE;
|
||||
@@ -2573,7 +2576,7 @@ check_tty(mparm_T *parmp)
|
||||
if (!input_isatty)
|
||||
silent_mode = TRUE;
|
||||
}
|
||||
else if (parmp->want_full_screen && (!parmp->stdout_isatty || !input_isatty)
|
||||
else if (parmp->want_full_screen && (!stdout_isatty || !input_isatty)
|
||||
#ifdef FEAT_GUI
|
||||
/* don't want the delay when started from the desktop */
|
||||
&& !gui.starting
|
||||
@@ -2588,7 +2591,7 @@ check_tty(mparm_T *parmp)
|
||||
* input buffer so fast I can't even kill the process in under 2
|
||||
* minutes (and it beeps continuously the whole time :-)
|
||||
*/
|
||||
if (netbeans_active() && (!parmp->stdout_isatty || !input_isatty))
|
||||
if (netbeans_active() && (!stdout_isatty || !input_isatty))
|
||||
{
|
||||
mch_errmsg(_("Vim: Error: Failure to start gvim from NetBeans\n"));
|
||||
exit(1);
|
||||
@@ -2601,11 +2604,13 @@ check_tty(mparm_T *parmp)
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
if (!parmp->stdout_isatty)
|
||||
if (!stdout_isatty)
|
||||
mch_errmsg(_("Vim: Warning: Output is not to a terminal\n"));
|
||||
if (!input_isatty)
|
||||
mch_errmsg(_("Vim: Warning: Input is not from a terminal\n"));
|
||||
out_flush();
|
||||
if (parmp->tty_fail && (!stdout_isatty || !input_isatty))
|
||||
exit(1);
|
||||
if (scriptin[0] == NULL)
|
||||
ui_delay(2000L, TRUE);
|
||||
TIME_MSG("Warning delay");
|
||||
@@ -3371,6 +3376,7 @@ usage(void)
|
||||
#endif
|
||||
main_msg(_("-T <terminal>\tSet terminal type to <terminal>"));
|
||||
main_msg(_("--not-a-term\t\tSkip warning for input/output not being a terminal"));
|
||||
main_msg(_("--ttyfail\t\tExit if input or output is not a terminal"));
|
||||
main_msg(_("-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"));
|
||||
#ifdef FEAT_GUI
|
||||
main_msg(_("-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"));
|
||||
|
||||
+2
-43
@@ -4583,47 +4583,6 @@ static HINSTANCE hMsvcrtDLL = 0;
|
||||
# define DYNAMIC_MSVCRT_DLL "msvcrt.dll"
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Get the address of 'funcname' which is imported by 'hInst' DLL.
|
||||
*/
|
||||
static void *
|
||||
get_iconv_import_func(HINSTANCE hInst, const char *funcname)
|
||||
{
|
||||
PBYTE pImage = (PBYTE)hInst;
|
||||
PIMAGE_DOS_HEADER pDOS = (PIMAGE_DOS_HEADER)hInst;
|
||||
PIMAGE_NT_HEADERS pPE;
|
||||
PIMAGE_IMPORT_DESCRIPTOR pImpDesc;
|
||||
PIMAGE_THUNK_DATA pIAT; /* Import Address Table */
|
||||
PIMAGE_THUNK_DATA pINT; /* Import Name Table */
|
||||
PIMAGE_IMPORT_BY_NAME pImpName;
|
||||
|
||||
if (pDOS->e_magic != IMAGE_DOS_SIGNATURE)
|
||||
return NULL;
|
||||
pPE = (PIMAGE_NT_HEADERS)(pImage + pDOS->e_lfanew);
|
||||
if (pPE->Signature != IMAGE_NT_SIGNATURE)
|
||||
return NULL;
|
||||
pImpDesc = (PIMAGE_IMPORT_DESCRIPTOR)(pImage
|
||||
+ pPE->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT]
|
||||
.VirtualAddress);
|
||||
for (; pImpDesc->FirstThunk; ++pImpDesc)
|
||||
{
|
||||
if (!pImpDesc->OriginalFirstThunk)
|
||||
continue;
|
||||
pIAT = (PIMAGE_THUNK_DATA)(pImage + pImpDesc->FirstThunk);
|
||||
pINT = (PIMAGE_THUNK_DATA)(pImage + pImpDesc->OriginalFirstThunk);
|
||||
for (; pIAT->u1.Function; ++pIAT, ++pINT)
|
||||
{
|
||||
if (IMAGE_SNAP_BY_ORDINAL(pINT->u1.Ordinal))
|
||||
continue;
|
||||
pImpName = (PIMAGE_IMPORT_BY_NAME)(pImage
|
||||
+ (UINT_PTR)(pINT->u1.AddressOfData));
|
||||
if (strcmp((char *)pImpName->Name, funcname) == 0)
|
||||
return (void *)pIAT->u1.Function;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try opening the iconv.dll and return TRUE if iconv() can be used.
|
||||
*/
|
||||
@@ -4671,7 +4630,7 @@ iconv_enabled(int verbose)
|
||||
iconv_open = (void *)GetProcAddress(hIconvDLL, "libiconv_open");
|
||||
iconv_close = (void *)GetProcAddress(hIconvDLL, "libiconv_close");
|
||||
iconvctl = (void *)GetProcAddress(hIconvDLL, "libiconvctl");
|
||||
iconv_errno = get_iconv_import_func(hIconvDLL, "_errno");
|
||||
iconv_errno = get_dll_import_func(hIconvDLL, "_errno");
|
||||
if (iconv_errno == NULL)
|
||||
iconv_errno = (void *)GetProcAddress(hMsvcrtDLL, "_errno");
|
||||
if (iconv == NULL || iconv_open == NULL || iconv_close == NULL
|
||||
@@ -5807,7 +5766,7 @@ static char e_xim[] = N_("E285: Failed to create input context");
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_GUI_X11) || defined(PROTO)
|
||||
# if defined(XtSpecificationRelease) && XtSpecificationRelease >= 6 && !defined(sun)
|
||||
# if defined(XtSpecificationRelease) && XtSpecificationRelease >= 6 && !defined(SUN_SYSTEM)
|
||||
# define USE_X11R6_XIM
|
||||
# endif
|
||||
|
||||
|
||||
+1
-1
@@ -1519,7 +1519,7 @@ ml_recover(void)
|
||||
line_count = pp->pb_pointer[idx].pe_line_count;
|
||||
if (readfile(curbuf->b_ffname, NULL, lnum,
|
||||
pp->pb_pointer[idx].pe_old_lnum - 1,
|
||||
line_count, NULL, 0) == FAIL)
|
||||
line_count, NULL, 0) != OK)
|
||||
cannot_open = TRUE;
|
||||
else
|
||||
lnum += line_count;
|
||||
|
||||
+26
-3
@@ -42,6 +42,9 @@ static int confirm_msg_used = FALSE; /* displaying confirm_msg */
|
||||
static char_u *confirm_msg = NULL; /* ":confirm" message */
|
||||
static char_u *confirm_msg_tail; /* tail of confirm_msg */
|
||||
#endif
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
static int emsg_to_channel_log = FALSE;
|
||||
#endif
|
||||
|
||||
struct msg_hist
|
||||
{
|
||||
@@ -166,6 +169,14 @@ msg_attr_keep(
|
||||
&& STRCMP(s, last_msg_hist->msg)))
|
||||
add_msg_hist(s, -1, attr);
|
||||
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
if (emsg_to_channel_log)
|
||||
{
|
||||
/* Write message in the channel log. */
|
||||
ch_logs(NULL, "ERROR: %s", (char *)s);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* When displaying keep_msg, don't let msg_start() free it, caller must do
|
||||
* that. */
|
||||
if (s == keep_msg)
|
||||
@@ -556,6 +567,7 @@ emsg(char_u *s)
|
||||
{
|
||||
int attr;
|
||||
char_u *p;
|
||||
int r;
|
||||
#ifdef FEAT_EVAL
|
||||
int ignore = FALSE;
|
||||
int severe;
|
||||
@@ -566,8 +578,6 @@ emsg(char_u *s)
|
||||
return TRUE;
|
||||
|
||||
called_emsg = TRUE;
|
||||
if (emsg_silent == 0)
|
||||
ex_exitval = 1;
|
||||
|
||||
/*
|
||||
* If "emsg_severe" is TRUE: When an error exception is to be thrown,
|
||||
@@ -624,9 +634,14 @@ emsg(char_u *s)
|
||||
}
|
||||
redir_write(s, -1);
|
||||
}
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
ch_logs(NULL, "ERROR: %s", (char *)s);
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
ex_exitval = 1;
|
||||
|
||||
/* Reset msg_silent, an error causes messages to be switched back on. */
|
||||
msg_silent = 0;
|
||||
cmd_silent = FALSE;
|
||||
@@ -650,6 +665,9 @@ emsg(char_u *s)
|
||||
* and a redraw is expected because
|
||||
* msg_scrolled is non-zero */
|
||||
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
emsg_to_channel_log = TRUE;
|
||||
#endif
|
||||
/*
|
||||
* Display name and line number for the source of the error.
|
||||
*/
|
||||
@@ -659,7 +677,12 @@ emsg(char_u *s)
|
||||
* Display the error message itself.
|
||||
*/
|
||||
msg_nowait = FALSE; /* wait for this msg */
|
||||
return msg_attr(s, attr);
|
||||
r = msg_attr(s, attr);
|
||||
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
emsg_to_channel_log = FALSE;
|
||||
#endif
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+27
-18
@@ -2177,16 +2177,19 @@ ins_bytes_len(char_u *p, int len)
|
||||
void
|
||||
ins_char(int c)
|
||||
{
|
||||
#if defined(FEAT_MBYTE) || defined(PROTO)
|
||||
char_u buf[MB_MAXBYTES + 1];
|
||||
int n;
|
||||
int n = 1;
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
n = (*mb_char2bytes)(c, buf);
|
||||
|
||||
/* When "c" is 0x100, 0x200, etc. we don't want to insert a NUL byte.
|
||||
* Happens for CTRL-Vu9900. */
|
||||
if (buf[0] == 0)
|
||||
buf[0] = '\n';
|
||||
#else
|
||||
buf[0] = c;
|
||||
#endif
|
||||
|
||||
ins_char_bytes(buf, n);
|
||||
}
|
||||
@@ -2195,7 +2198,6 @@ ins_char(int c)
|
||||
ins_char_bytes(char_u *buf, int charlen)
|
||||
{
|
||||
int c = buf[0];
|
||||
#endif
|
||||
int newlen; /* nr of bytes inserted */
|
||||
int oldlen; /* nr of bytes deleted (0 when not replacing) */
|
||||
char_u *p;
|
||||
@@ -2218,11 +2220,7 @@ ins_char_bytes(char_u *buf, int charlen)
|
||||
|
||||
/* The lengths default to the values for when not replacing. */
|
||||
oldlen = 0;
|
||||
#ifdef FEAT_MBYTE
|
||||
newlen = charlen;
|
||||
#else
|
||||
newlen = 1;
|
||||
#endif
|
||||
|
||||
if (State & REPLACE_FLAG)
|
||||
{
|
||||
@@ -4461,6 +4459,9 @@ vim_setenv(char_u *name, char_u *val)
|
||||
{
|
||||
sprintf((char *)envbuf, "%s=%s", name, val);
|
||||
putenv((char *)envbuf);
|
||||
# ifdef libintl_putenv
|
||||
libintl_putenv((char *)envbuf);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
#ifdef FEAT_GETTEXT
|
||||
@@ -5428,7 +5429,6 @@ static int skip_label(linenr_T, char_u **pp);
|
||||
static int cin_first_id_amount(void);
|
||||
static int cin_get_equal_amount(linenr_T lnum);
|
||||
static int cin_ispreproc(char_u *);
|
||||
static int cin_ispreproc_cont(char_u **pp, linenr_T *lnump);
|
||||
static int cin_iscomment(char_u *);
|
||||
static int cin_islinecomment(char_u *);
|
||||
static int cin_isterminated(char_u *, int, int);
|
||||
@@ -6008,13 +6008,18 @@ cin_ispreproc(char_u *s)
|
||||
* Return TRUE if line "*pp" at "*lnump" is a preprocessor statement or a
|
||||
* continuation line of a preprocessor statement. Decrease "*lnump" to the
|
||||
* start and return the line in "*pp".
|
||||
* Put the amount of indent in "*amount".
|
||||
*/
|
||||
static int
|
||||
cin_ispreproc_cont(char_u **pp, linenr_T *lnump)
|
||||
cin_ispreproc_cont(char_u **pp, linenr_T *lnump, int *amount)
|
||||
{
|
||||
char_u *line = *pp;
|
||||
linenr_T lnum = *lnump;
|
||||
int retval = FALSE;
|
||||
int candidate_amount = *amount;
|
||||
|
||||
if (*line != NUL && line[STRLEN(line) - 1] == '\\')
|
||||
candidate_amount = get_indent_lnum(lnum);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -6033,6 +6038,8 @@ cin_ispreproc_cont(char_u **pp, linenr_T *lnump)
|
||||
|
||||
if (lnum != *lnump)
|
||||
*pp = ml_get(*lnump);
|
||||
if (retval)
|
||||
*amount = candidate_amount;
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -7396,7 +7403,7 @@ get_c_indent(void)
|
||||
l = skipwhite(ml_get(lnum));
|
||||
if (cin_nocode(l)) /* skip comment lines */
|
||||
continue;
|
||||
if (cin_ispreproc_cont(&l, &lnum))
|
||||
if (cin_ispreproc_cont(&l, &lnum, &amount))
|
||||
continue; /* ignore #define, #if, etc. */
|
||||
curwin->w_cursor.lnum = lnum;
|
||||
|
||||
@@ -7809,10 +7816,10 @@ get_c_indent(void)
|
||||
*/
|
||||
if (curwin->w_cursor.lnum <= ourscope)
|
||||
{
|
||||
/* we reached end of scope:
|
||||
* if looking for a enum or structure initialization
|
||||
/* We reached end of scope:
|
||||
* If looking for a enum or structure initialization
|
||||
* go further back:
|
||||
* if it is an initializer (enum xxx or xxx =), then
|
||||
* If it is an initializer (enum xxx or xxx =), then
|
||||
* don't add ind_continuation, otherwise it is a variable
|
||||
* declaration:
|
||||
* int x,
|
||||
@@ -7851,7 +7858,8 @@ get_c_indent(void)
|
||||
/*
|
||||
* Skip preprocessor directives and blank lines.
|
||||
*/
|
||||
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum))
|
||||
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum,
|
||||
&amount))
|
||||
continue;
|
||||
|
||||
if (cin_nocode(l))
|
||||
@@ -7968,7 +7976,8 @@ get_c_indent(void)
|
||||
}
|
||||
|
||||
/* Skip preprocessor directives and blank lines. */
|
||||
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum))
|
||||
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum,
|
||||
&amount))
|
||||
continue;
|
||||
|
||||
/* Finally the actual check for "namespace". */
|
||||
@@ -8144,7 +8153,7 @@ get_c_indent(void)
|
||||
* unlocked it)
|
||||
*/
|
||||
l = ml_get_curline();
|
||||
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum)
|
||||
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum, &amount)
|
||||
|| cin_nocode(l))
|
||||
continue;
|
||||
|
||||
@@ -8865,7 +8874,7 @@ term_again:
|
||||
/*
|
||||
* Skip preprocessor directives and blank lines.
|
||||
*/
|
||||
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum))
|
||||
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum, &amount))
|
||||
continue;
|
||||
|
||||
if (cin_nocode(l))
|
||||
@@ -8966,7 +8975,7 @@ term_again:
|
||||
{
|
||||
look = ml_get(--curwin->w_cursor.lnum);
|
||||
if (!(cin_nocode(look) || cin_ispreproc_cont(
|
||||
&look, &curwin->w_cursor.lnum)))
|
||||
&look, &curwin->w_cursor.lnum, &amount)))
|
||||
break;
|
||||
}
|
||||
if (curwin->w_cursor.lnum > 0
|
||||
|
||||
+42
-24
@@ -403,7 +403,7 @@ incl(pos_T *lp)
|
||||
int
|
||||
dec_cursor(void)
|
||||
{
|
||||
return dec(&curwin->w_cursor);
|
||||
return dec(&curwin->w_cursor);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -1740,27 +1740,6 @@ vim_memset(void *ptr, int c, size_t size)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef VIM_MEMCMP
|
||||
/*
|
||||
* Return zero when "b1" and "b2" are the same for "len" bytes.
|
||||
* Return non-zero otherwise.
|
||||
*/
|
||||
int
|
||||
vim_memcmp(void *b1, void *b2, size_t len)
|
||||
{
|
||||
char_u *p1 = (char_u *)b1, *p2 = (char_u *)b2;
|
||||
|
||||
for ( ; len > 0; --len)
|
||||
{
|
||||
if (*p1 != *p2)
|
||||
return 1;
|
||||
++p1;
|
||||
++p2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* skipped when generating prototypes, the prototype is in vim.h */
|
||||
#ifdef VIM_MEMMOVE
|
||||
/*
|
||||
@@ -2183,6 +2162,7 @@ static struct modmasktable
|
||||
/* 'A' must be the last one */
|
||||
{MOD_MASK_ALT, MOD_MASK_ALT, (char_u)'A'},
|
||||
{0, 0, NUL}
|
||||
/* NOTE: when adding an entry, update MAX_KEY_NAME_LEN! */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -2315,6 +2295,8 @@ static struct key_name_entry
|
||||
{K_XDOWN, (char_u *)"xDown"},
|
||||
{K_XLEFT, (char_u *)"xLeft"},
|
||||
{K_XRIGHT, (char_u *)"xRight"},
|
||||
{K_PS, (char_u *)"PasteStart"},
|
||||
{K_PE, (char_u *)"PasteEnd"},
|
||||
|
||||
{K_F1, (char_u *)"F1"},
|
||||
{K_F2, (char_u *)"F2"},
|
||||
@@ -2456,6 +2438,7 @@ static struct key_name_entry
|
||||
{K_SWIPEDOWN, (char_u *)"SwipeDown"},
|
||||
#endif
|
||||
{0, NULL}
|
||||
/* NOTE: When adding a long name update MAX_KEY_NAME_LEN. */
|
||||
};
|
||||
|
||||
#define KEY_NAMES_TABLE_LEN (sizeof(key_names_table) / sizeof(struct key_name_entry))
|
||||
@@ -2684,8 +2667,13 @@ get_special_key_name(int c, int modifiers)
|
||||
}
|
||||
else /* use name of special key */
|
||||
{
|
||||
STRCPY(string + idx, key_names_table[table_idx].name);
|
||||
idx = (int)STRLEN(string);
|
||||
size_t len = STRLEN(key_names_table[table_idx].name);
|
||||
|
||||
if (len + idx + 2 <= MAX_KEY_NAME_LEN)
|
||||
{
|
||||
STRCPY(string + idx, key_names_table[table_idx].name);
|
||||
idx += (int)len;
|
||||
}
|
||||
}
|
||||
string[idx++] = '>';
|
||||
string[idx] = NUL;
|
||||
@@ -6269,3 +6257,33 @@ parse_queued_messages(void)
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef PROTO /* proto is defined in vim.h */
|
||||
# ifdef ELAPSED_TIMEVAL
|
||||
/*
|
||||
* Return time in msec since "start_tv".
|
||||
*/
|
||||
long
|
||||
elapsed(struct timeval *start_tv)
|
||||
{
|
||||
struct timeval now_tv;
|
||||
|
||||
gettimeofday(&now_tv, NULL);
|
||||
return (now_tv.tv_sec - start_tv->tv_sec) * 1000L
|
||||
+ (now_tv.tv_usec - start_tv->tv_usec) / 1000L;
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef ELAPSED_TICKCOUNT
|
||||
/*
|
||||
* Return time in msec since "start_tick".
|
||||
*/
|
||||
long
|
||||
elapsed(DWORD start_tick)
|
||||
{
|
||||
DWORD now = GetTickCount();
|
||||
|
||||
return (long)now - (long)start_tick;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -2870,6 +2870,10 @@ do_check_cursorbind(void)
|
||||
restart_edit_save = restart_edit;
|
||||
restart_edit = TRUE;
|
||||
check_cursor();
|
||||
# ifdef FEAT_SYN_HL
|
||||
if (curwin->w_p_cul || curwin->w_p_cuc)
|
||||
validate_cursor();
|
||||
# endif
|
||||
restart_edit = restart_edit_save;
|
||||
# ifdef FEAT_MBYTE
|
||||
/* Correct cursor for multi-byte character. */
|
||||
|
||||
+9
-5
@@ -2332,7 +2332,8 @@ special_keys(char_u *args)
|
||||
char *save_str = nb_unquote(args, NULL);
|
||||
char *tok = strtok(save_str, " ");
|
||||
char *sep;
|
||||
char keybuf[64];
|
||||
#define KEYBUFLEN 64
|
||||
char keybuf[KEYBUFLEN];
|
||||
char cmdbuf[256];
|
||||
|
||||
while (tok != NULL)
|
||||
@@ -2359,10 +2360,13 @@ special_keys(char_u *args)
|
||||
tok++;
|
||||
}
|
||||
|
||||
strcpy(&keybuf[i], tok);
|
||||
vim_snprintf(cmdbuf, sizeof(cmdbuf),
|
||||
"<silent><%s> :nbkey %s<CR>", keybuf, keybuf);
|
||||
do_map(0, (char_u *)cmdbuf, NORMAL, FALSE);
|
||||
if (strlen(tok) + i < KEYBUFLEN)
|
||||
{
|
||||
strcpy(&keybuf[i], tok);
|
||||
vim_snprintf(cmdbuf, sizeof(cmdbuf),
|
||||
"<silent><%s> :nbkey %s<CR>", keybuf, keybuf);
|
||||
do_map(0, (char_u *)cmdbuf, NORMAL, FALSE);
|
||||
}
|
||||
tok = strtok(NULL, " ");
|
||||
}
|
||||
vim_free(save_str);
|
||||
|
||||
+18
-7
@@ -426,6 +426,7 @@ static const struct nv_cmd
|
||||
#ifdef FEAT_AUTOCMD
|
||||
{K_CURSORHOLD, nv_cursorhold, NV_KEEPREG, 0},
|
||||
#endif
|
||||
{K_PS, nv_edit, 0, 0},
|
||||
};
|
||||
|
||||
/* Number of commands in nv_cmds[]. */
|
||||
@@ -1984,7 +1985,7 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
|
||||
op_formatexpr(oap); /* use expression */
|
||||
else
|
||||
#endif
|
||||
if (*p_fp != NUL)
|
||||
if (*p_fp != NUL || *curbuf->b_p_fp != NUL)
|
||||
op_colon(oap); /* use external command */
|
||||
else
|
||||
op_format(oap, FALSE); /* use internal function */
|
||||
@@ -2197,10 +2198,12 @@ op_colon(oparg_T *oap)
|
||||
}
|
||||
else if (oap->op_type == OP_FORMAT)
|
||||
{
|
||||
if (*p_fp == NUL)
|
||||
stuffReadbuff((char_u *)"fmt");
|
||||
else
|
||||
if (*curbuf->b_p_fp != NUL)
|
||||
stuffReadbuff(curbuf->b_p_fp);
|
||||
else if (*p_fp != NUL)
|
||||
stuffReadbuff(p_fp);
|
||||
else
|
||||
stuffReadbuff((char_u *)"fmt");
|
||||
stuffReadbuff((char_u *)"\n']");
|
||||
}
|
||||
|
||||
@@ -2982,9 +2985,9 @@ do_mouse(
|
||||
if (State & INSERT)
|
||||
stuffcharReadbuff(Ctrl_O);
|
||||
if (curwin->w_llist_ref == NULL) /* quickfix window */
|
||||
stuffReadbuff((char_u *)":.cc\n");
|
||||
do_cmdline_cmd((char_u *)".cc");
|
||||
else /* location list window */
|
||||
stuffReadbuff((char_u *)":.ll\n");
|
||||
do_cmdline_cmd((char_u *)".ll");
|
||||
got_click = FALSE; /* ignore drag&release now */
|
||||
}
|
||||
#endif
|
||||
@@ -3858,7 +3861,7 @@ add_to_showcmd(int c)
|
||||
K_VER_SCROLLBAR, K_HOR_SCROLLBAR,
|
||||
K_LEFTMOUSE_NM, K_LEFTRELEASE_NM,
|
||||
# endif
|
||||
K_IGNORE,
|
||||
K_IGNORE, K_PS,
|
||||
K_LEFTMOUSE, K_LEFTDRAG, K_LEFTRELEASE,
|
||||
K_MIDDLEMOUSE, K_MIDDLEDRAG, K_MIDDLERELEASE,
|
||||
K_RIGHTMOUSE, K_RIGHTDRAG, K_RIGHTRELEASE,
|
||||
@@ -9047,6 +9050,7 @@ nv_esc(cmdarg_T *cap)
|
||||
|
||||
/*
|
||||
* Handle "A", "a", "I", "i" and <Insert> commands.
|
||||
* Also handle K_PS, start bracketed paste.
|
||||
*/
|
||||
static void
|
||||
nv_edit(cmdarg_T *cap)
|
||||
@@ -9074,6 +9078,9 @@ nv_edit(cmdarg_T *cap)
|
||||
/* Only give this error when 'insertmode' is off. */
|
||||
EMSG(_(e_modifiable));
|
||||
clearop(cap->oap);
|
||||
if (cap->cmdchar == K_PS)
|
||||
/* drop the pasted text */
|
||||
bracketed_paste(PASTE_INSERT, TRUE, NULL);
|
||||
}
|
||||
else if (!checkclearopq(cap->oap))
|
||||
{
|
||||
@@ -9105,6 +9112,7 @@ nv_edit(cmdarg_T *cap)
|
||||
break;
|
||||
|
||||
case 'a': /* "a"ppend is like "i"nsert on the next character. */
|
||||
case K_PS: /* bracketed paste works like "a"ppend */
|
||||
#ifdef FEAT_VIRTUALEDIT
|
||||
/* increment coladd when in virtual space, increment the
|
||||
* column otherwise, also to append after an unprintable char */
|
||||
@@ -9135,6 +9143,9 @@ nv_edit(cmdarg_T *cap)
|
||||
|
||||
invoke_edit(cap, FALSE, cap->cmdchar, FALSE);
|
||||
}
|
||||
else if (cap->cmdchar == K_PS)
|
||||
/* drop the pasted text */
|
||||
bracketed_paste(PASTE_INSERT, TRUE, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -259,11 +259,6 @@ op_shift(oparg_T *oap, int curs_top, int amount)
|
||||
}
|
||||
|
||||
changed_lines(oap->start.lnum, 0, oap->end.lnum + 1, 0L);
|
||||
#ifdef FEAT_FOLDING
|
||||
/* The cursor line is not in a closed fold */
|
||||
foldOpenCursor();
|
||||
#endif
|
||||
|
||||
if (oap->block_mode)
|
||||
{
|
||||
curwin->w_cursor.lnum = oap->start.lnum;
|
||||
@@ -277,6 +272,12 @@ op_shift(oparg_T *oap, int curs_top, int amount)
|
||||
else
|
||||
--curwin->w_cursor.lnum; /* put cursor on last line, for ":>" */
|
||||
|
||||
#ifdef FEAT_FOLDING
|
||||
/* The cursor line is not in a closed fold */
|
||||
foldOpenCursor();
|
||||
#endif
|
||||
|
||||
|
||||
if (oap->line_count > p_report)
|
||||
{
|
||||
if (oap->op_type == OP_RSHIFT)
|
||||
@@ -3350,6 +3351,8 @@ do_put(
|
||||
*/
|
||||
if (regname == '.')
|
||||
{
|
||||
if (VIsual_active)
|
||||
stuffcharReadbuff(VIsual_mode);
|
||||
(void)stuff_inserted((dir == FORWARD ? (count == -1 ? 'o' : 'a') :
|
||||
(count == -1 ? 'O' : 'i')), count, FALSE);
|
||||
/* Putting the text is done later, so can't really move the cursor to
|
||||
@@ -3547,7 +3550,7 @@ do_put(
|
||||
*/
|
||||
if (y_type == MBLOCK)
|
||||
{
|
||||
char c = gchar_cursor();
|
||||
int c = gchar_cursor();
|
||||
colnr_T endcol2 = 0;
|
||||
|
||||
if (dir == FORWARD && c != NUL)
|
||||
|
||||
+49
-20
@@ -107,6 +107,7 @@
|
||||
#if defined(FEAT_BEVAL) && defined(FEAT_EVAL)
|
||||
# define PV_BEXPR OPT_BOTH(OPT_BUF(BV_BEXPR))
|
||||
#endif
|
||||
#define PV_FP OPT_BOTH(OPT_BUF(BV_FP))
|
||||
#ifdef FEAT_EVAL
|
||||
# define PV_FEX OPT_BUF(BV_FEX)
|
||||
#endif
|
||||
@@ -441,8 +442,8 @@ struct vimoption
|
||||
|
||||
/* when option changed, what to display: */
|
||||
#define P_RSTAT 0x1000 /* redraw status lines */
|
||||
#define P_RWIN 0x2000 /* redraw current window */
|
||||
#define P_RBUF 0x4000 /* redraw current buffer */
|
||||
#define P_RWIN 0x2000 /* redraw current window and recompute text */
|
||||
#define P_RBUF 0x4000 /* redraw current buffer and recompute text */
|
||||
#define P_RALL 0x6000 /* redraw all windows */
|
||||
#define P_RCLR 0x7000 /* clear and redraw all */
|
||||
|
||||
@@ -458,10 +459,12 @@ struct vimoption
|
||||
#define P_NFNAME 0x400000L /* only normal file name chars allowed */
|
||||
#define P_INSECURE 0x800000L /* option was set from a modeline */
|
||||
#define P_PRI_MKRC 0x1000000L /* priority for :mkvimrc (setting option has
|
||||
side effects) */
|
||||
side effects) */
|
||||
#define P_NO_ML 0x2000000L /* not allowed in modeline */
|
||||
#define P_CURSWANT 0x4000000L /* update curswant required; not needed when
|
||||
* there is a redraw flag */
|
||||
#define P_NDNAME 0x8000000L /* only normal dir name chars allowed */
|
||||
#define P_RWINONLY 0x10000000L /* only redraw current window */
|
||||
|
||||
#define ISK_LATIN1 (char_u *)"@,48-57,_,192-255"
|
||||
|
||||
@@ -978,7 +981,7 @@ static struct vimoption options[] =
|
||||
(char_u *)NULL, PV_NONE,
|
||||
#endif
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"cursorline", "cul", P_BOOL|P_VI_DEF|P_RWIN,
|
||||
{"cursorline", "cul", P_BOOL|P_VI_DEF|P_RWINONLY,
|
||||
#ifdef FEAT_SYN_HL
|
||||
(char_u *)VAR_WIN, PV_CUL,
|
||||
#else
|
||||
@@ -1004,7 +1007,7 @@ static struct vimoption options[] =
|
||||
(char_u *)NULL, PV_NONE,
|
||||
#endif
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"dictionary", "dict", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP,
|
||||
{"dictionary", "dict", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP|P_NDNAME,
|
||||
#ifdef FEAT_INS_EXPAND
|
||||
(char_u *)&p_dict, PV_DICT,
|
||||
#else
|
||||
@@ -1268,7 +1271,7 @@ static struct vimoption options[] =
|
||||
{(char_u *)"^\\s*\\d\\+[\\]:.)}\\t ]\\s*",
|
||||
(char_u *)0L} SCRIPTID_INIT},
|
||||
{"formatprg", "fp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
|
||||
(char_u *)&p_fp, PV_NONE,
|
||||
(char_u *)&p_fp, PV_FP,
|
||||
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
|
||||
{"fsync", "fs", P_BOOL|P_SECURE|P_VI_DEF,
|
||||
#ifdef HAVE_FSYNC
|
||||
@@ -2111,7 +2114,7 @@ static struct vimoption options[] =
|
||||
{(char_u *)NULL, (char_u *)0L}
|
||||
#endif
|
||||
SCRIPTID_INIT},
|
||||
{"printexpr", "pexpr", P_STRING|P_VI_DEF,
|
||||
{"printexpr", "pexpr", P_STRING|P_VI_DEF|P_SECURE,
|
||||
#ifdef FEAT_POSTSCRIPT
|
||||
(char_u *)&p_pexpr, PV_NONE,
|
||||
{(char_u *)"", (char_u *)0L}
|
||||
@@ -2186,12 +2189,20 @@ static struct vimoption options[] =
|
||||
(char_u *)&p_py3dll, PV_NONE,
|
||||
{(char_u *)DYNAMIC_PYTHON3_DLL, (char_u *)0L}
|
||||
SCRIPTID_INIT},
|
||||
{"pythonthreehome", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
|
||||
(char_u *)&p_py3home, PV_NONE,
|
||||
{(char_u *)"", (char_u *)0L}
|
||||
SCRIPTID_INIT},
|
||||
#endif
|
||||
#if defined(DYNAMIC_PYTHON)
|
||||
{"pythondll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
|
||||
(char_u *)&p_pydll, PV_NONE,
|
||||
{(char_u *)DYNAMIC_PYTHON_DLL, (char_u *)0L}
|
||||
SCRIPTID_INIT},
|
||||
{"pythonhome", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
|
||||
(char_u *)&p_pyhome, PV_NONE,
|
||||
{(char_u *)"", (char_u *)0L}
|
||||
SCRIPTID_INIT},
|
||||
#endif
|
||||
{"quoteescape", "qe", P_STRING|P_ALLOCED|P_VI_DEF,
|
||||
#ifdef FEAT_TEXTOBJ
|
||||
@@ -2712,7 +2723,7 @@ static struct vimoption options[] =
|
||||
{"textwidth", "tw", P_NUM|P_VI_DEF|P_VIM|P_RBUF,
|
||||
(char_u *)&p_tw, PV_TW,
|
||||
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"thesaurus", "tsr", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP,
|
||||
{"thesaurus", "tsr", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP|P_NDNAME,
|
||||
#ifdef FEAT_INS_EXPAND
|
||||
(char_u *)&p_tsr, PV_TSR,
|
||||
#else
|
||||
@@ -3097,6 +3108,8 @@ static struct vimoption options[] =
|
||||
p_term("t_ZR", T_CZR)
|
||||
p_term("t_8f", T_8F)
|
||||
p_term("t_8b", T_8B)
|
||||
p_term("t_BE", T_BE)
|
||||
p_term("t_BD", T_BD)
|
||||
|
||||
/* terminal key codes are not in here */
|
||||
|
||||
@@ -5564,6 +5577,7 @@ check_buf_options(buf_T *buf)
|
||||
#if defined(FEAT_CRYPT)
|
||||
check_string_option(&buf->b_p_cm);
|
||||
#endif
|
||||
check_string_option(&buf->b_p_fp);
|
||||
#if defined(FEAT_EVAL)
|
||||
check_string_option(&buf->b_p_fex);
|
||||
#endif
|
||||
@@ -5961,11 +5975,15 @@ did_set_string_option(
|
||||
errmsg = e_secure;
|
||||
}
|
||||
|
||||
/* Check for a "normal" file name in some options. Disallow a path
|
||||
* separator (slash and/or backslash), wildcards and characters that are
|
||||
* often illegal in a file name. */
|
||||
else if ((options[opt_idx].flags & P_NFNAME)
|
||||
&& vim_strpbrk(*varp, (char_u *)"/\\*?[|<>") != NULL)
|
||||
/* Check for a "normal" directory or file name in some options. Disallow a
|
||||
* path separator (slash and/or backslash), wildcards and characters that
|
||||
* are often illegal in a file name. Be more permissive if "secure" is off.
|
||||
*/
|
||||
else if (((options[opt_idx].flags & P_NFNAME)
|
||||
&& vim_strpbrk(*varp, (char_u *)(secure
|
||||
? "/\\*?[|;&<>\r\n" : "/\\*?[<>\r\n")) != NULL)
|
||||
|| ((options[opt_idx].flags & P_NDNAME)
|
||||
&& vim_strpbrk(*varp, (char_u *)"*?[|;&<>\r\n") != NULL))
|
||||
{
|
||||
errmsg = e_invarg;
|
||||
}
|
||||
@@ -7111,6 +7129,7 @@ did_set_string_option(
|
||||
|
||||
|
||||
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
|
||||
/* 'toolbar' */
|
||||
else if (varp == &p_toolbar)
|
||||
{
|
||||
if (opt_strings_flags(p_toolbar, p_toolbar_values,
|
||||
@@ -7335,6 +7354,7 @@ did_set_string_option(
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_RENDER_OPTIONS)
|
||||
/* 'renderoptions' */
|
||||
else if (varp == &p_rop && gui.in_use)
|
||||
{
|
||||
if (!gui_mch_set_rendering_options(p_rop))
|
||||
@@ -7362,19 +7382,19 @@ did_set_string_option(
|
||||
else
|
||||
{
|
||||
p = NULL;
|
||||
if (varp == &p_ww)
|
||||
if (varp == &p_ww) /* 'whichwrap' */
|
||||
p = (char_u *)WW_ALL;
|
||||
if (varp == &p_shm)
|
||||
if (varp == &p_shm) /* 'shortmess' */
|
||||
p = (char_u *)SHM_ALL;
|
||||
else if (varp == &(p_cpo))
|
||||
else if (varp == &(p_cpo)) /* 'cpoptions' */
|
||||
p = (char_u *)CPO_ALL;
|
||||
else if (varp == &(curbuf->b_p_fo))
|
||||
else if (varp == &(curbuf->b_p_fo)) /* 'formatoptions' */
|
||||
p = (char_u *)FO_ALL;
|
||||
#ifdef FEAT_CONCEAL
|
||||
else if (varp == &curwin->w_p_cocu)
|
||||
else if (varp == &curwin->w_p_cocu) /* 'concealcursor' */
|
||||
p = (char_u *)COCU_ALL;
|
||||
#endif
|
||||
else if (varp == &p_mouse)
|
||||
else if (varp == &p_mouse) /* 'mouse' */
|
||||
{
|
||||
#ifdef FEAT_MOUSE
|
||||
p = (char_u *)MOUSE_ALL;
|
||||
@@ -7384,7 +7404,7 @@ did_set_string_option(
|
||||
#endif
|
||||
}
|
||||
#if defined(FEAT_GUI)
|
||||
else if (varp == &p_go)
|
||||
else if (varp == &p_go) /* 'guioptions' */
|
||||
p = (char_u *)GO_ALL;
|
||||
#endif
|
||||
if (p != NULL)
|
||||
@@ -9223,6 +9243,8 @@ check_redraw(long_u flags)
|
||||
changed_window_setting();
|
||||
if (flags & P_RBUF)
|
||||
redraw_curbuf_later(NOT_VALID);
|
||||
if (flags & P_RWINONLY)
|
||||
redraw_later(NOT_VALID);
|
||||
if (doclear)
|
||||
redraw_all_later(CLEAR);
|
||||
else if (all)
|
||||
@@ -10340,6 +10362,9 @@ unset_global_local_option(char_u *name, void *from)
|
||||
clear_string_option(&buf->b_p_tsr);
|
||||
break;
|
||||
#endif
|
||||
case PV_FP:
|
||||
clear_string_option(&buf->b_p_fp);
|
||||
break;
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case PV_EFM:
|
||||
clear_string_option(&buf->b_p_efm);
|
||||
@@ -10393,6 +10418,7 @@ get_varp_scope(struct vimoption *p, int opt_flags)
|
||||
{
|
||||
switch ((int)p->indir)
|
||||
{
|
||||
case PV_FP: return (char_u *)&(curbuf->b_p_fp);
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case PV_EFM: return (char_u *)&(curbuf->b_p_efm);
|
||||
case PV_GP: return (char_u *)&(curbuf->b_p_gp);
|
||||
@@ -10473,6 +10499,8 @@ get_varp(struct vimoption *p)
|
||||
case PV_TSR: return *curbuf->b_p_tsr != NUL
|
||||
? (char_u *)&(curbuf->b_p_tsr) : p->var;
|
||||
#endif
|
||||
case PV_FP: return *curbuf->b_p_fp != NUL
|
||||
? (char_u *)&(curbuf->b_p_fp) : p->var;
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case PV_EFM: return *curbuf->b_p_efm != NUL
|
||||
? (char_u *)&(curbuf->b_p_efm) : p->var;
|
||||
@@ -11041,6 +11069,7 @@ buf_copy_options(buf_T *buf, int flags)
|
||||
buf->b_p_inde = vim_strsave(p_inde);
|
||||
buf->b_p_indk = vim_strsave(p_indk);
|
||||
#endif
|
||||
buf->b_p_fp = empty_option;
|
||||
#if defined(FEAT_EVAL)
|
||||
buf->b_p_fex = vim_strsave(p_fex);
|
||||
#endif
|
||||
|
||||
@@ -706,9 +706,11 @@ EXTERN char_u *p_perldll; /* 'perldll' */
|
||||
#endif
|
||||
#if defined(DYNAMIC_PYTHON3)
|
||||
EXTERN char_u *p_py3dll; /* 'pythonthreedll' */
|
||||
EXTERN char_u *p_py3home; /* 'pythonthreehome' */
|
||||
#endif
|
||||
#if defined(DYNAMIC_PYTHON)
|
||||
EXTERN char_u *p_pydll; /* 'pythondll' */
|
||||
EXTERN char_u *p_pyhome; /* 'pythonhome' */
|
||||
#endif
|
||||
#ifdef FEAT_RELTIME
|
||||
EXTERN long p_rdt; /* 'redrawtime' */
|
||||
@@ -1049,6 +1051,7 @@ enum
|
||||
, BV_EP
|
||||
, BV_ET
|
||||
, BV_FENC
|
||||
, BV_FP
|
||||
#ifdef FEAT_EVAL
|
||||
, BV_BEXPR
|
||||
, BV_FEX
|
||||
|
||||
+4
-2
@@ -40,7 +40,7 @@
|
||||
# include <dlgs.h>
|
||||
# include <winspool.h>
|
||||
# include <commdlg.h>
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#endif /* PROTO */
|
||||
|
||||
@@ -1619,7 +1619,9 @@ mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
|
||||
|
||||
if (psettings->n_uncollated_copies == 0)
|
||||
psettings->n_uncollated_copies = 1;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
psettings->n_collated_copies = 1;
|
||||
psettings->n_uncollated_copies = 1;
|
||||
}
|
||||
|
||||
+32
-46
@@ -376,21 +376,6 @@ mch_write(char_u *s, int len)
|
||||
RealWaitForChar(read_cmd_fd, p_wd, NULL, NULL);
|
||||
}
|
||||
|
||||
#if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
|
||||
/*
|
||||
* Return time in msec since "start_tv".
|
||||
*/
|
||||
static long
|
||||
elapsed(struct timeval *start_tv)
|
||||
{
|
||||
struct timeval now_tv;
|
||||
|
||||
gettimeofday(&now_tv, NULL);
|
||||
return (now_tv.tv_sec - start_tv->tv_sec) * 1000L
|
||||
+ (now_tv.tv_usec - start_tv->tv_usec) / 1000L;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* mch_inchar(): low level input function.
|
||||
* Get a characters from the keyboard.
|
||||
@@ -411,10 +396,10 @@ mch_inchar(
|
||||
int did_start_blocking = FALSE;
|
||||
long wait_time;
|
||||
long elapsed_time = 0;
|
||||
#if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
|
||||
struct timeval start_tv;
|
||||
#ifdef ELAPSED_FUNC
|
||||
ELAPSED_TYPE start_tv;
|
||||
|
||||
gettimeofday(&start_tv, NULL);
|
||||
ELAPSED_INIT(start_tv);
|
||||
#endif
|
||||
|
||||
/* repeat until we got a character or waited long enough */
|
||||
@@ -438,8 +423,8 @@ mch_inchar(
|
||||
else
|
||||
/* going to block after p_ut */
|
||||
wait_time = p_ut;
|
||||
#if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
|
||||
elapsed_time = elapsed(&start_tv);
|
||||
#ifdef ELAPSED_FUNC
|
||||
elapsed_time = ELAPSED_FUNC(start_tv);
|
||||
#endif
|
||||
wait_time -= elapsed_time;
|
||||
if (wait_time < 0)
|
||||
@@ -477,6 +462,10 @@ mch_inchar(
|
||||
/* Checking if a job ended requires polling. Do this every 100 msec. */
|
||||
if (has_pending_job() && (wait_time < 0 || wait_time > 100L))
|
||||
wait_time = 100L;
|
||||
/* If there is readahead then parse_queued_messages() timed out and we
|
||||
* should call it again soon. */
|
||||
if ((wait_time < 0 || wait_time > 100L) && channel_any_readahead())
|
||||
wait_time = 10L;
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -1554,18 +1543,16 @@ mch_input_isatty(void)
|
||||
|
||||
#ifdef FEAT_X11
|
||||
|
||||
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) \
|
||||
# if defined(ELAPSED_TIMEVAL) \
|
||||
&& (defined(FEAT_XCLIPBOARD) || defined(FEAT_TITLE))
|
||||
|
||||
static void xopen_message(struct timeval *start_tv);
|
||||
|
||||
/*
|
||||
* Give a message about the elapsed time for opening the X window.
|
||||
*/
|
||||
static void
|
||||
xopen_message(struct timeval *start_tv)
|
||||
xopen_message(long elapsed_msec)
|
||||
{
|
||||
smsg((char_u *)_("Opening the X display took %ld msec"), elapsed(start_tv));
|
||||
smsg((char_u *)_("Opening the X display took %ld msec"), elapsed_msec);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -1864,11 +1851,11 @@ get_x11_windis(void)
|
||||
#endif
|
||||
if (x11_display != NULL)
|
||||
{
|
||||
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
|
||||
# ifdef ELAPSED_FUNC
|
||||
if (p_verbose > 0)
|
||||
{
|
||||
verbose_enter();
|
||||
xopen_message(&start_tv);
|
||||
xopen_message(ELAPSED_FUNC(start_tv));
|
||||
verbose_leave();
|
||||
}
|
||||
# endif
|
||||
@@ -4648,8 +4635,8 @@ mch_call_shell(
|
||||
ga_init2(&ga, 1, BUFLEN);
|
||||
|
||||
noread_cnt = 0;
|
||||
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
|
||||
gettimeofday(&start_tv, NULL);
|
||||
# ifdef ELAPSED_FUNC
|
||||
ELAPSED_INIT(start_tv);
|
||||
# endif
|
||||
for (;;)
|
||||
{
|
||||
@@ -4684,8 +4671,8 @@ mch_call_shell(
|
||||
/* Get extra characters when we don't have any.
|
||||
* Reset the counter and timer. */
|
||||
noread_cnt = 0;
|
||||
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
|
||||
gettimeofday(&start_tv, NULL);
|
||||
# ifdef ELAPSED_FUNC
|
||||
ELAPSED_INIT(start_tv);
|
||||
# endif
|
||||
len = ui_inchar(ta_buf, BUFLEN, 10L, 0);
|
||||
}
|
||||
@@ -4908,10 +4895,10 @@ mch_call_shell(
|
||||
if (got_int)
|
||||
break;
|
||||
|
||||
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
|
||||
# ifdef ELAPSED_FUNC
|
||||
if (wait_pid == 0)
|
||||
{
|
||||
long msec = elapsed(&start_tv);
|
||||
long msec = ELAPSED_FUNC(start_tv);
|
||||
|
||||
/* Avoid that we keep looping here without
|
||||
* checking for a CTRL-C for a long time. Don't
|
||||
@@ -5654,15 +5641,14 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED, int *interrupted)
|
||||
/* May retry getting characters after an event was handled. */
|
||||
# define MAY_LOOP
|
||||
|
||||
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
|
||||
# ifdef ELAPSED_FUNC
|
||||
/* Remember at what time we started, so that we know how much longer we
|
||||
* should wait after being interrupted. */
|
||||
# define USE_START_TV
|
||||
long start_msec = msec;
|
||||
struct timeval start_tv;
|
||||
ELAPSED_TYPE start_tv;
|
||||
|
||||
if (msec > 0)
|
||||
gettimeofday(&start_tv, NULL);
|
||||
ELAPSED_INIT(start_tv);
|
||||
# endif
|
||||
|
||||
/* Handle being called recursively. This may happen for the session
|
||||
@@ -5969,9 +5955,9 @@ select_eintr:
|
||||
/* We're going to loop around again, find out for how long */
|
||||
if (msec > 0)
|
||||
{
|
||||
# ifdef USE_START_TV
|
||||
# ifdef ELAPSED_FUNC
|
||||
/* Compute remaining wait time. */
|
||||
msec = start_msec - elapsed(&start_tv);
|
||||
msec = start_msec - ELAPSED_FUNC(start_tv);
|
||||
# else
|
||||
/* Guess we got interrupted halfway. */
|
||||
msec = msec / 2;
|
||||
@@ -6954,7 +6940,7 @@ mch_libcall(
|
||||
if (argstring != NULL)
|
||||
{
|
||||
# if defined(USE_DLOPEN)
|
||||
ProcAdd = (STRPROCSTR)dlsym(hinstLib, (const char *)funcname);
|
||||
*(void **)(&ProcAdd) = dlsym(hinstLib, (const char *)funcname);
|
||||
dlerr = (char *)dlerror();
|
||||
# else
|
||||
if (shl_findsym(&hinstLib, (const char *)funcname,
|
||||
@@ -6976,7 +6962,7 @@ mch_libcall(
|
||||
else
|
||||
{
|
||||
# if defined(USE_DLOPEN)
|
||||
ProcAddI = (INTPROCSTR)dlsym(hinstLib, (const char *)funcname);
|
||||
*(void **)(&ProcAddI) = dlsym(hinstLib, (const char *)funcname);
|
||||
dlerr = (char *)dlerror();
|
||||
# else
|
||||
if (shl_findsym(&hinstLib, (const char *)funcname,
|
||||
@@ -7068,11 +7054,11 @@ setup_term_clip(void)
|
||||
#if defined(HAVE_SETJMP_H)
|
||||
int (*oldIOhandler)();
|
||||
#endif
|
||||
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
|
||||
struct timeval start_tv;
|
||||
# ifdef ELAPSED_FUNC
|
||||
ELAPSED_TYPE start_tv;
|
||||
|
||||
if (p_verbose > 0)
|
||||
gettimeofday(&start_tv, NULL);
|
||||
ELAPSED_INIT(start_tv);
|
||||
# endif
|
||||
|
||||
/* Ignore X errors while opening the display */
|
||||
@@ -7114,11 +7100,11 @@ setup_term_clip(void)
|
||||
/* Catch terminating error of the X server connection. */
|
||||
(void)XSetIOErrorHandler(x_IOerror_handler);
|
||||
|
||||
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
|
||||
# ifdef ELAPSED_FUNC
|
||||
if (p_verbose > 0)
|
||||
{
|
||||
verbose_enter();
|
||||
xopen_message(&start_tv);
|
||||
xopen_message(ELAPSED_FUNC(start_tv));
|
||||
verbose_leave();
|
||||
}
|
||||
# endif
|
||||
|
||||
+3
-3
@@ -17,8 +17,8 @@
|
||||
# define signal sigset
|
||||
#endif
|
||||
|
||||
/* sun's sys/ioctl.h redefines symbols from termio world */
|
||||
#if defined(HAVE_SYS_IOCTL_H) && !defined(sun)
|
||||
/* Sun's sys/ioctl.h redefines symbols from termio world */
|
||||
#if defined(HAVE_SYS_IOCTL_H) && !defined(SUN_SYSTEM)
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
|
||||
/* shared library access */
|
||||
#if defined(HAVE_DLFCN_H) && defined(USE_DLOPEN)
|
||||
# ifdef __MVS__
|
||||
# if defined(__MVS__) && !defined (__SUSV3)
|
||||
/* needed to define RTLD_LAZY (Anthony Giorgio) */
|
||||
# define __SUSV3
|
||||
# endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user