mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Merge remote-tracking branch 'vim/master'
This commit is contained in:
@@ -262,7 +262,6 @@ SRC_DOS_UNIX = \
|
||||
src/if_python3.c \
|
||||
src/if_py_both.h \
|
||||
src/if_ruby.c \
|
||||
src/if_sniff.h \
|
||||
src/if_tcl.c \
|
||||
src/proto/if_cscope.pro \
|
||||
src/proto/if_lua.pro \
|
||||
@@ -455,7 +454,6 @@ SRC_EXTRA = \
|
||||
$(SRC_VMS) \
|
||||
README_os390.txt \
|
||||
src/Make_mint.mak \
|
||||
src/if_sniff.c \
|
||||
src/infplist.xml \
|
||||
src/link.390 \
|
||||
src/os_beos.c \
|
||||
|
||||
+61
-35
@@ -1,4 +1,4 @@
|
||||
*channel.txt* For Vim version 7.4. Last change: 2016 Feb 23
|
||||
*channel.txt* For Vim version 7.4. Last change: 2016 Feb 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -74,7 +74,7 @@ In T1 you should see:
|
||||
=== socket opened === ~
|
||||
|
||||
You can now send a message to the server: >
|
||||
echo ch_sendexpr(channel, 'hello!')
|
||||
echo ch_evalexpr(channel, 'hello!')
|
||||
|
||||
The message is received in T1 and a response is sent back to Vim.
|
||||
You can see the raw messages in T1. What Vim sends is:
|
||||
@@ -101,7 +101,7 @@ Instead of giving a callback with every send call, it can also be specified
|
||||
when opening the channel: >
|
||||
call ch_close(channel)
|
||||
let channel = ch_open('localhost:8765', {'callback': "MyHandler"})
|
||||
call ch_sendexpr(channel, 'hello!', {'callback': 0})
|
||||
call ch_sendexpr(channel, 'hello!')
|
||||
|
||||
==============================================================================
|
||||
3. Opening a channel *channel-open*
|
||||
@@ -130,6 +130,8 @@ Use |ch_status()| to see if the channel could be opened.
|
||||
overwritten. Therefore set "mode" first and the part specific
|
||||
mode later.
|
||||
|
||||
Note: when writing to a file or buffer NL mode is always used.
|
||||
|
||||
*channel-callback*
|
||||
"callback" A function that is called when a message is received that is
|
||||
not handled otherwise. It gets two arguments: the channel
|
||||
@@ -169,7 +171,7 @@ Use |ch_status()| to see if the channel could be opened.
|
||||
msec at least.
|
||||
|
||||
"timeout" The time to wait for a request when blocking, E.g. when using
|
||||
ch_sendexpr(). In milliseconds. The default is 2000 (2
|
||||
ch_evalexpr(). In milliseconds. The default is 2000 (2
|
||||
seconds).
|
||||
*out-timeout* *err-timeout*
|
||||
"out-timeout" Timeout for stdout. Only when using pipes.
|
||||
@@ -198,6 +200,7 @@ Once done with the channel, disconnect it like this: >
|
||||
When a socket is used this will close the socket for both directions. When
|
||||
pipes are used (stdin/stdout/stderr) they are all closed. This might not be
|
||||
what you want! Stopping the job with job_stop() might be better.
|
||||
All readahead is discarded, callbacks will no longer be invoked.
|
||||
|
||||
When the channel can't be opened you will get an error message. There is a
|
||||
difference between MS-Windows and Unix: On Unix when the port doesn't exist
|
||||
@@ -211,7 +214,7 @@ If there is an error reading or writing a channel it will be closed.
|
||||
4. Using a JSON or JS channel *channel-use*
|
||||
|
||||
If mode is JSON then a message can be sent synchronously like this: >
|
||||
let response = ch_sendexpr(channel, {expr})
|
||||
let response = ch_evalexpr(channel, {expr})
|
||||
This awaits a response from the other side.
|
||||
|
||||
When mode is JS this works the same, except that the messages use
|
||||
@@ -219,7 +222,7 @@ JavaScript encoding. See |js_encode()| for the difference.
|
||||
|
||||
To send a message, without handling a response or letting the channel callback
|
||||
handle the response: >
|
||||
call ch_sendexpr(channel, {expr}, {'callback': 0})
|
||||
call ch_sendexpr(channel, {expr})
|
||||
|
||||
To send a message and letting the response handled by a specific function,
|
||||
asynchronously: >
|
||||
@@ -260,8 +263,9 @@ On read error or ch_close(), when using a socket, the string "DETACH" is sent,
|
||||
if still possible. The channel will then be inactive. For a JSON and JS mode
|
||||
channel quotes are used around DETACH, otherwise there are no quotes.
|
||||
|
||||
It is also possible to use ch_sendraw() on a JSON or JS channel. The caller
|
||||
is then completely responsible for correct encoding and decoding.
|
||||
It is also possible to use ch_sendraw() and ch_evalraw() on a JSON or JS
|
||||
channel. The caller is then completely responsible for correct encoding and
|
||||
decoding.
|
||||
|
||||
==============================================================================
|
||||
5. Channel commands *channel-commands*
|
||||
@@ -327,7 +331,7 @@ It will send back the result of the expression:
|
||||
[-2, "last line"] ~
|
||||
The format is:
|
||||
[{number}, {result}]
|
||||
*E915*
|
||||
|
||||
Here {number} is the same as what was in the request. Use a negative number
|
||||
to avoid confusion with message that Vim sends. Use a different number on
|
||||
every request to be able to match the request with the response.
|
||||
@@ -360,7 +364,7 @@ Leave out the fourth argument if no response is to be sent:
|
||||
6. Using a RAW or NL channel *channel-raw*
|
||||
|
||||
If mode is RAW or NL then a message can be send like this: >
|
||||
let response = ch_sendraw(channel, {string})
|
||||
let response = ch_evalraw(channel, {string})
|
||||
|
||||
The {string} is sent as-is. The response will be what can be read from the
|
||||
channel right away. Since Vim doesn't know how to recognize the end of the
|
||||
@@ -374,18 +378,18 @@ first NL. This can also be just the NL for an empty response.
|
||||
If no NL was read before the channel timeout an empty string is returned.
|
||||
|
||||
To send a message, without expecting a response: >
|
||||
call ch_sendraw(channel, {string}, 0)
|
||||
call ch_sendraw(channel, {string})
|
||||
The process can send back a response, the channel handler will be called with
|
||||
it.
|
||||
|
||||
To send a message and letting the response handled by a specific function,
|
||||
asynchronously: >
|
||||
call ch_sendraw(channel, {string}, {callback})
|
||||
call ch_sendraw(channel, {string}, {'callback': 'MyHandler'})
|
||||
|
||||
This {string} can also be JSON, use |json_encode()| to create it and
|
||||
|json_decode()| to handle a received JSON message.
|
||||
|
||||
It is not possible to use |ch_sendexpr()| on a raw channel.
|
||||
It is not possible to use |ch_evalexpr()| or |ch_sendexpr()| on a raw channel.
|
||||
|
||||
==============================================================================
|
||||
7. More channel functions *channel-more*
|
||||
@@ -397,7 +401,7 @@ are:
|
||||
"closed" The channel was closed.
|
||||
|
||||
TODO:
|
||||
To objain the job associated with a channel: ch_getjob(channel)
|
||||
To obtain the job associated with a channel: ch_getjob(channel)
|
||||
|
||||
To read one message from a channel: >
|
||||
let output = ch_read(channel)
|
||||
@@ -444,14 +448,17 @@ If you want to handle both stderr and stdout with one handler use the
|
||||
"callback" option: >
|
||||
let job = job_start(command, {"callback": "MyHandler"})
|
||||
|
||||
You can send a message to the command with ch_sendraw(). If the channel is in
|
||||
JSON or JS mode you can use ch_sendexpr().
|
||||
You can send a message to the command with ch_evalraw(). If the channel is in
|
||||
JSON or JS mode you can use ch_evalexpr().
|
||||
|
||||
There are several options you can use, see |job-options|.
|
||||
For example, to start a job and write its output in buffer "dummy": >
|
||||
let logjob = job_start("tail -f /tmp/log",
|
||||
\ {'out-io': 'buffer', 'out-name': 'dummy'})
|
||||
sbuf dummy
|
||||
|
||||
TODO:
|
||||
To run a job and read its output once it is done: >
|
||||
|
||||
let job = job_start({command}, {'exit-cb': 'MyHandler'})
|
||||
func MyHandler(job, status)
|
||||
let channel = job_getchannel()
|
||||
@@ -508,7 +515,7 @@ See |job_setoptions()| and |ch_setoptions()|.
|
||||
*job-err-cb*
|
||||
"err-cb": handler Callback for when there is something to read on
|
||||
stderr.
|
||||
TODO: *job-close-cb*
|
||||
*job-close-cb*
|
||||
"close-cb": handler Callback for when the channel is closed. Same as
|
||||
"close-cb" on ch_open().
|
||||
*job-exit-cb*
|
||||
@@ -527,28 +534,47 @@ TODO: *job-term*
|
||||
"term": "open" Start a terminal and connect the job
|
||||
stdin/stdout/stderr to it.
|
||||
|
||||
TODO: *job-in-io*
|
||||
"in-io": "null" disconnect stdin
|
||||
*job-in-io*
|
||||
"in-io": "null" disconnect stdin TODO
|
||||
"in-io": "pipe" stdin is connected to the channel (default)
|
||||
"in-io": "file" stdin reads from a file
|
||||
"in-file": "/path/file" the file to read from
|
||||
"in-io": "file" stdin reads from a file TODO
|
||||
"in-io": "buffer" stdin reads from a buffer TODO
|
||||
"in-name": "/path/file" the name of he file or buffer to read from
|
||||
"in-buf": number the number of the buffer to read from TODO
|
||||
|
||||
TODO: *job-out-io*
|
||||
"out-io": "null" disconnect stdout
|
||||
*job-out-io*
|
||||
"out-io": "null" disconnect stdout TODO
|
||||
"out-io": "pipe" stdout is connected to the channel (default)
|
||||
"out-io": "file" stdout writes to a file
|
||||
"out-file": "/path/file" the file to write to
|
||||
"out-io": "file" stdout writes to a file TODO
|
||||
"out-io": "buffer" stdout appends to a buffer
|
||||
"out-buffer": "name" buffer to append to
|
||||
"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 TODO
|
||||
|
||||
TODO: *job-err-io*
|
||||
"err-io": "out" same type as stdout (default)
|
||||
"err-io": "null" disconnect stderr
|
||||
"err-io": "pipe" stderr is connected to the channel
|
||||
"err-io": "file" stderr writes to a file
|
||||
"err-file": "/path/file" the file to write to
|
||||
"err-io": "buffer" stderr appends to a buffer
|
||||
"err-buffer": "name" buffer to append to
|
||||
*job-err-io*
|
||||
"err-io": "out" same as stdout TODO
|
||||
"err-io": "null" disconnect stderr TODO
|
||||
"err-io": "pipe" stderr is connected to the channel (default)
|
||||
"err-io": "file" stderr writes to a file TODO
|
||||
"err-io": "buffer" stderr appends to a buffer TODO
|
||||
"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 TODO
|
||||
|
||||
When the IO mode is "buffer" and there is a callback, the text is appended to
|
||||
the buffer before invoking the callback.
|
||||
|
||||
The name of the buffer is compared the full name of existing buffers. If
|
||||
there is a match that buffer is used. Otherwise a new buffer is created.
|
||||
Use an empty name to always create a new buffer. |ch_getbufnr()| can then be
|
||||
used to get the buffer number.
|
||||
|
||||
For a new buffer 'buftype' is set to "nofile" and 'bufhidden' to "hide". If
|
||||
you prefer other settings, create the buffer first and pass the buffer number.
|
||||
|
||||
When the buffer written to is displayed in a window and the cursor is in the
|
||||
first column of the last line, the cursor will be moved to the newly added
|
||||
line and the window is scrolled up to show the cursor if needed.
|
||||
|
||||
Undo is synced for every added line.
|
||||
|
||||
==============================================================================
|
||||
11. Controlling a job *job-control*
|
||||
|
||||
+49
-20
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 7.4. Last change: 2016 Feb 23
|
||||
*eval.txt* For Vim version 7.4. Last change: 2016 Feb 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1818,6 +1818,11 @@ call( {func}, {arglist} [, {dict}])
|
||||
any call {func} with arguments {arglist}
|
||||
ceil( {expr}) Float round {expr} up
|
||||
ch_close( {channel}) none close {channel}
|
||||
ch_evalexpr( {channel}, {expr} [, {options}])
|
||||
any evaluate {expr} on JSON {channel}
|
||||
ch_evalraw( {channel}, {string} [, {options}])
|
||||
any evaluate {string} on raw {channel}
|
||||
ch_getbufnr( {channel}, {what}) Number get buffer number for {channel}/{what}
|
||||
ch_getjob( {channel}) Job get the Job of {channel}
|
||||
ch_log( {msg} [, {channel}]) none write {msg} in the channel log file
|
||||
ch_logfile( {fname} [, {mode}]) none start logging channel activity
|
||||
@@ -2692,6 +2697,38 @@ ch_close({channel}) *ch_close()*
|
||||
Close {channel}. See |channel-close|.
|
||||
{only available when compiled with the |+channel| feature}
|
||||
|
||||
ch_evalexpr({channel}, {expr} [, {options}]) *ch_evalexpr()*
|
||||
Send {expr} over {channel}. The {expr} is encoded
|
||||
according to the type of channel. The function cannot be used
|
||||
with a raw channel. See |channel-use|.
|
||||
*E917*
|
||||
{options} must be a Dictionary. It must not have a "callback"
|
||||
entry.
|
||||
|
||||
ch_evalexpr() waits for a response and returns the decoded
|
||||
expression. When there is an error or timeout it returns an
|
||||
empty string.
|
||||
|
||||
{only available when compiled with the |+channel| feature}
|
||||
|
||||
ch_evalraw({channel}, {string} [, {options}]) *ch_evalraw()*
|
||||
Send {string} over {channel}.
|
||||
Works like |ch_evalexpr()|, but does not encode the request or
|
||||
decode the response. The caller is responsible for the
|
||||
correct contents. Also does not add a newline for a channel
|
||||
in NL mode, the caller must do that. The NL in the response
|
||||
is removed.
|
||||
See |channel-use|.
|
||||
|
||||
{only available when compiled with the |+channel| feature}
|
||||
|
||||
ch_getbufnr({channel}, {what}) *ch_getbufnr()*
|
||||
Get the buffer number that {channel} is using for {what}.
|
||||
{what} can be "err" for stderr, "out" for stdout or empty for
|
||||
socket output.
|
||||
Returns -1 when there is no buffer.
|
||||
{only available when compiled with the |+channel| feature}
|
||||
|
||||
ch_getjob({channel}) *ch_getjob()*
|
||||
Get the Job associated with {channel}.
|
||||
If there is no job calling |job_status()| on the returned Job
|
||||
@@ -2767,18 +2804,13 @@ ch_readraw({channel} [, {options}]) *ch_readraw()*
|
||||
ch_sendexpr({channel}, {expr} [, {options}]) *ch_sendexpr()*
|
||||
Send {expr} over {channel}. The {expr} is encoded
|
||||
according to the type of channel. The function cannot be used
|
||||
with a raw channel. See |channel-use|. *E912*
|
||||
with a raw channel. See |channel-use|. *E912*
|
||||
|
||||
{options} must be a Dictionary.
|
||||
When "callback" is a Funcref or the name of a function,
|
||||
ch_sendexpr() returns immediately. The callback is invoked
|
||||
when the response is received. See |channel-callback|.
|
||||
|
||||
Without "callback" ch_sendexpr() waits for a response and
|
||||
returns the decoded expression. When there is an error or
|
||||
timeout it returns an empty string.
|
||||
|
||||
When "callback" is zero no response is expected.
|
||||
{options} must be a Dictionary. The "callback" item is a
|
||||
Funcref or the name of a function it is invoked when the
|
||||
response is received. See |channel-callback|.
|
||||
Without "callback" the channel handler is invoked, otherwise
|
||||
any received message is dropped.
|
||||
|
||||
{only available when compiled with the |+channel| feature}
|
||||
|
||||
@@ -4561,6 +4593,8 @@ json_encode({expr}) *json_encode()*
|
||||
Vim values are converted as follows:
|
||||
Number decimal number
|
||||
Float floating point number
|
||||
Float nan "NaN"
|
||||
Float inf "Infinity"
|
||||
String in double quotes (possibly null)
|
||||
Funcref not possible, error
|
||||
List as an array (possibly null); when
|
||||
@@ -4571,13 +4605,9 @@ json_encode({expr}) *json_encode()*
|
||||
v:true "true"
|
||||
v:none "null"
|
||||
v:null "null"
|
||||
Note that using v:none is permitted, although the JSON
|
||||
standard does not allow empty items. This can be useful for
|
||||
omitting items in an array:
|
||||
[0,,,,,5] ~
|
||||
This is much more efficient than:
|
||||
[0,null,null,null,null,5] ~
|
||||
But a strict JSON parser will not accept it.
|
||||
Note that NaN and Infinity are passed on as values. This is
|
||||
missing in the JSON standard, but several implementations do
|
||||
allow it. If not then you will get an error.
|
||||
|
||||
keys({dict}) *keys()*
|
||||
Return a |List| with all the keys of {dict}. The |List| is in
|
||||
@@ -7396,7 +7426,6 @@ scrollbind Compiled with 'scrollbind' support.
|
||||
showcmd Compiled with 'showcmd' support.
|
||||
signs Compiled with |:sign| support.
|
||||
smartindent Compiled with 'smartindent' support.
|
||||
sniff Compiled with SNiFF interface support.
|
||||
spell Compiled with spell checking support |spell|.
|
||||
startuptime Compiled with |--startuptime| support.
|
||||
statusline Compiled with support for 'statusline', 'rulerformat'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*help.txt* For Vim version 7.4. Last change: 2016 Feb 22
|
||||
*help.txt* For Vim version 7.4. Last change: 2016 Feb 27
|
||||
|
||||
VIM - main help file
|
||||
k
|
||||
@@ -165,7 +165,6 @@ Interfaces ~
|
||||
|if_mzsch.txt| MzScheme interface
|
||||
|if_perl.txt| Perl interface
|
||||
|if_pyth.txt| Python interface
|
||||
|if_sniff.txt| SNiFF+ interface
|
||||
|if_tcl.txt| Tcl interface
|
||||
|if_ole.txt| OLE automation interface for Win32
|
||||
|if_ruby.txt| Ruby interface
|
||||
|
||||
@@ -1,95 +1,11 @@
|
||||
*if_sniff.txt* For Vim version 7.4. Last change: 2005 Mar 29
|
||||
*if_sniff.txt* For Vim version 7.4. Last change: 2016 Feb 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL
|
||||
by Anton Leherbauer (toni@takefive.co.at)
|
||||
|
||||
|
||||
SNiFF+ and Vim *sniff*
|
||||
|
||||
1. Introduction |sniff-intro|
|
||||
2. Commands |sniff-commands|
|
||||
3. Compiling Vim with SNiFF+ interface |sniff-compiling|
|
||||
|
||||
{Vi does not have any of these commands} *E275* *E274* *E276* *E278* *E279*
|
||||
|
||||
The SNiFF+ interface only works, when Vim was compiled with the |+sniff|
|
||||
feature.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *sniff-intro*
|
||||
|
||||
The following features for the use with SNiFF+ are available:
|
||||
|
||||
* Vim can be used for all editing requests
|
||||
* SNiFF+ recognizes and updates all browsers when a file is saved in Vim
|
||||
* SNiFF+ commands can be issued directly from Vim
|
||||
|
||||
How to use Vim with SNiFF+
|
||||
1. Make sure SNiFF+ is running.
|
||||
2. In the Editor view of the Preferences dialog set the Field named
|
||||
'External Editor' to 'Emacs/Vim'.
|
||||
4. Start Vim
|
||||
5. Connect to SNiFF+ (:sniff connect)
|
||||
|
||||
Once a connection is established, SNiFF+ uses Vim for all requests to show or
|
||||
edit source code. On the other hand, you can send queries to SNiFF+ with the
|
||||
:sniff command.
|
||||
|
||||
==============================================================================
|
||||
2. Commands *sniff-commands*
|
||||
|
||||
*:sniff* *:sni*
|
||||
:sni[ff] request [symbol] Send request to sniff with optional symbol.
|
||||
{not in Vi}
|
||||
:sni[ff] Display all possible requests and the connection
|
||||
status
|
||||
|
||||
Most requests require a symbol (identifier) as parameter. If it is omitted,
|
||||
Vim will use the current word under the cursor.
|
||||
The available requests are listed below:
|
||||
|
||||
request mapping description
|
||||
-------------------------------------------------------------------------------
|
||||
connect sc Establish connection with SNiFF+.
|
||||
Make sure SNiFF+ is prepared for this in the
|
||||
Preferences
|
||||
disconnect sq Disconnect from SNiFF+. You can reconnect any
|
||||
time with :sniff connect (or 'sc')
|
||||
toggle st Toggle between implementation
|
||||
and definition file
|
||||
find-symbol sf Load the symbol into a Symbol Browser
|
||||
browse-class sb Loads the class into a Class Browser
|
||||
superclass ss Edit superclass of symbol
|
||||
overridden so Edit overridden method of symbol
|
||||
retrieve-file srf Retrieve symbol in current file
|
||||
retrieve-project srp Retrieve symbol in current project
|
||||
retrieve-all-projects srP Retrieve symbol in all projects
|
||||
retrieve-next sR Retrieve symbol using current Retriever
|
||||
settings
|
||||
goto-symbol sg Goto definition or implementation of symbol
|
||||
hierarchy sh Load symbol into the Hierarchy Browser
|
||||
restr-hier sH same as above but show only related classes
|
||||
xref-to sxt Start a refers-to query on symbol and
|
||||
load the results into the Cross Referencer
|
||||
xref-by sxb Start a referred-by query on symbol
|
||||
xref-has sxh Start a refers-to components query on symbol
|
||||
xref-used-by sxu Start a referred-by as component query on
|
||||
symbol
|
||||
show-docu sd Show documentation of symbol
|
||||
gen-docu sD Generate documentation of symbol
|
||||
|
||||
The mappings are defined in a file 'sniff.vim', which is part of every SNiFF+
|
||||
product ($SNIFF_DIR/config/sniff.vim). This file is sourced whenever Vim
|
||||
connects to SNiFF+.
|
||||
|
||||
==============================================================================
|
||||
3. Compiling Vim with SNiFF+ interface *sniff-compiling*
|
||||
|
||||
To compile Vim with SNiFF+ support, you need two source files of the extra
|
||||
archive: if_sniff.c and if_sniff.h.
|
||||
On Unix: Edit the Makefile and uncomment the line "--enable-sniff". Or run
|
||||
configure manually with this argument.
|
||||
On NT: Specify SNIFF=yes with your make command.
|
||||
The SNiFF+ support was removed at patch 7.4.1433. If you want to check it out
|
||||
sync to before that.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 7.4. Last change: 2016 Feb 24
|
||||
*index.txt* For Vim version 7.4. Last change: 2016 Feb 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1501,7 +1501,6 @@ tag command action ~
|
||||
|:smile| :smi[le] make the user happy
|
||||
|:snext| :sn[ext] split window and go to next file in the
|
||||
argument list
|
||||
|:sniff| :sni[ff] send request to sniff
|
||||
|:snomagic| :sno[magic] :substitute with 'nomagic'
|
||||
|:snoremap| :snor[emap] like ":noremap" but for Select mode
|
||||
|:snoremenu| :snoreme[nu] like ":noremenu" but for Select mode
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*message.txt* For Vim version 7.4. Last change: 2013 Feb 23
|
||||
*message.txt* For Vim version 7.4. Last change: 2016 Feb 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -476,8 +476,6 @@ in memory, you can reduce that with these options:
|
||||
helps for a change that affects all lines.
|
||||
- 'undoreload' Set to zero to disable.
|
||||
|
||||
Also see |msdos-limitations|.
|
||||
|
||||
*E339* >
|
||||
Pattern too long
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*os_390.txt* For Vim version 7.4. Last change: 2010 May 30
|
||||
*os_390.txt* For Vim version 7.4. Last change: 2016 Feb 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Ralf Schandl
|
||||
@@ -108,7 +108,6 @@ Never tested:
|
||||
- Langmap (|'langmap'|)
|
||||
- Python support (|Python|)
|
||||
- Right-to-left mode (|'rightleft'|)
|
||||
- SNiFF+ interface (|sniff|)
|
||||
- TCL interface (|tcl|)
|
||||
...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*repeat.txt* For Vim version 7.4. Last change: 2016 Feb 24
|
||||
*repeat.txt* For Vim version 7.4. Last change: 2016 Feb 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -221,6 +221,10 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
'runtimepath'. And the directory found is added to
|
||||
'runtimepath'.
|
||||
|
||||
If you have a directory under 'packpath' that doesn't
|
||||
actually have a plugin file, just create an empty one.
|
||||
This will still add the directory to 'runtimepath'.
|
||||
|
||||
Note that {name} is the directory name, not the name
|
||||
of the .vim file. If the "{name}/plugin" directory
|
||||
contains more than one file they are all sourced.
|
||||
@@ -564,7 +568,7 @@ Additionally, these commands can be used:
|
||||
About the additional commands in debug mode:
|
||||
- There is no command-line completion for them, you get the completion for the
|
||||
normal Ex commands only.
|
||||
- You can shorten them, up to a single character, unless more then one command
|
||||
- You can shorten them, up to a single character, unless more than one command
|
||||
starts with the same letter. "f" stands for "finish", use "fr" for "frame".
|
||||
- Hitting <CR> will repeat the previous one. When doing another command, this
|
||||
is reset (because it's not clear what you want to repeat).
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*starting.txt* For Vim version 7.4. Last change: 2016 Feb 21
|
||||
*starting.txt* For Vim version 7.4. Last change: 2016 Feb 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -414,9 +414,10 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
|
||||
not needed, because Vim will be able to find out what type
|
||||
of terminal you are using. (See |terminal-info|.) {not in Vi}
|
||||
|
||||
*--not-a-term*
|
||||
--not-a-term Tells Vim that the user knows that the input and/or output is
|
||||
not connected to a terminal. This will avoid the warning and
|
||||
the two second delay that would happen.
|
||||
the two second delay that would happen. {not in Vi}
|
||||
|
||||
*-d*
|
||||
-d Start in diff mode, like |vimdiff|.
|
||||
@@ -1153,7 +1154,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 avoide by using `:silent!`.
|
||||
code 1. Errors can be avoided by using `:silent!`.
|
||||
|
||||
==============================================================================
|
||||
8. Saving settings *save-settings*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 7.4. Last change: 2016 Feb 24
|
||||
*syntax.txt* For Vim version 7.4. Last change: 2016 Feb 25
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -2890,7 +2890,7 @@ You may wish to embed languages into sh. I'll give an example courtesy of
|
||||
Lorance Stinson on how to do this with awk as an example. Put the following
|
||||
file into $HOME/.vim/after/syntax/sh/awkembed.vim: >
|
||||
|
||||
" AWK Embedding: {{{1
|
||||
" AWK Embedding:
|
||||
" ==============
|
||||
" Shamelessly ripped from aspperl.vim by Aaron Hope.
|
||||
if exists("b:current_syntax")
|
||||
|
||||
+5
-33
@@ -1290,7 +1290,6 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
+scrollbind various.txt /*+scrollbind*
|
||||
+signs various.txt /*+signs*
|
||||
+smartindent various.txt /*+smartindent*
|
||||
+sniff various.txt /*+sniff*
|
||||
+startuptime various.txt /*+startuptime*
|
||||
+statusline various.txt /*+statusline*
|
||||
+sun_workshop various.txt /*+sun_workshop*
|
||||
@@ -1342,6 +1341,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
--literal starting.txt /*--literal*
|
||||
--nofork starting.txt /*--nofork*
|
||||
--noplugin starting.txt /*--noplugin*
|
||||
--not-a-term starting.txt /*--not-a-term*
|
||||
--remote remote.txt /*--remote*
|
||||
--remote-expr remote.txt /*--remote-expr*
|
||||
--remote-send remote.txt /*--remote-send*
|
||||
@@ -2883,8 +2883,6 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:smile index.txt /*:smile*
|
||||
:sn windows.txt /*:sn*
|
||||
:snext windows.txt /*:snext*
|
||||
:sni if_sniff.txt /*:sni*
|
||||
:sniff if_sniff.txt /*:sniff*
|
||||
:sno change.txt /*:sno*
|
||||
:snomagic change.txt /*:snomagic*
|
||||
:snor map.txt /*:snor*
|
||||
@@ -3617,7 +3615,6 @@ D change.txt /*D*
|
||||
DOS os_dos.txt /*DOS*
|
||||
DOS-format editing.txt /*DOS-format*
|
||||
DOS-format-write editing.txt /*DOS-format-write*
|
||||
DPMI os_msdos.txt /*DPMI*
|
||||
Dictionaries eval.txt /*Dictionaries*
|
||||
Dictionary eval.txt /*Dictionary*
|
||||
Dictionary-function eval.txt /*Dictionary-function*
|
||||
@@ -3810,12 +3807,7 @@ E270 if_ruby.txt /*E270*
|
||||
E271 if_ruby.txt /*E271*
|
||||
E272 if_ruby.txt /*E272*
|
||||
E273 if_ruby.txt /*E273*
|
||||
E274 if_sniff.txt /*E274*
|
||||
E275 if_sniff.txt /*E275*
|
||||
E276 if_sniff.txt /*E276*
|
||||
E277 remote.txt /*E277*
|
||||
E278 if_sniff.txt /*E278*
|
||||
E279 if_sniff.txt /*E279*
|
||||
E28 syntax.txt /*E28*
|
||||
E280 if_tcl.txt /*E280*
|
||||
E281 if_tcl.txt /*E281*
|
||||
@@ -3998,11 +3990,6 @@ E447 editing.txt /*E447*
|
||||
E448 various.txt /*E448*
|
||||
E449 eval.txt /*E449*
|
||||
E45 message.txt /*E45*
|
||||
E450 os_msdos.txt /*E450*
|
||||
E451 os_msdos.txt /*E451*
|
||||
E452 os_msdos.txt /*E452*
|
||||
E453 os_msdos.txt /*E453*
|
||||
E454 os_msdos.txt /*E454*
|
||||
E455 print.txt /*E455*
|
||||
E456 print.txt /*E456*
|
||||
E457 print.txt /*E457*
|
||||
@@ -4500,8 +4487,8 @@ E911 eval.txt /*E911*
|
||||
E912 eval.txt /*E912*
|
||||
E913 eval.txt /*E913*
|
||||
E914 eval.txt /*E914*
|
||||
E915 channel.txt /*E915*
|
||||
E916 eval.txt /*E916*
|
||||
E917 eval.txt /*E917*
|
||||
E92 message.txt /*E92*
|
||||
E93 windows.txt /*E93*
|
||||
E94 windows.txt /*E94*
|
||||
@@ -5228,6 +5215,9 @@ cc change.txt /*cc*
|
||||
ceil() eval.txt /*ceil()*
|
||||
ch.vim syntax.txt /*ch.vim*
|
||||
ch_close() eval.txt /*ch_close()*
|
||||
ch_evalexpr() eval.txt /*ch_evalexpr()*
|
||||
ch_evalraw() eval.txt /*ch_evalraw()*
|
||||
ch_getbufnr() eval.txt /*ch_getbufnr()*
|
||||
ch_getjob() eval.txt /*ch_getjob()*
|
||||
ch_log() eval.txt /*ch_log()*
|
||||
ch_logfile() eval.txt /*ch_logfile()*
|
||||
@@ -5666,8 +5656,6 @@ dos-locations os_dos.txt /*dos-locations*
|
||||
dos-shell os_dos.txt /*dos-shell*
|
||||
dos-standard-mappings os_dos.txt /*dos-standard-mappings*
|
||||
dos-temp-files os_dos.txt /*dos-temp-files*
|
||||
dos16 os_msdos.txt /*dos16*
|
||||
dos32 os_msdos.txt /*dos32*
|
||||
dosbatch.vim syntax.txt /*dosbatch.vim*
|
||||
double-click term.txt /*double-click*
|
||||
download intro.txt /*download*
|
||||
@@ -7206,7 +7194,6 @@ message.txt message.txt /*message.txt*
|
||||
messages message.txt /*messages*
|
||||
meta intro.txt /*meta*
|
||||
min() eval.txt /*min()*
|
||||
minimal-features os_msdos.txt /*minimal-features*
|
||||
missing-options vi_diff.txt /*missing-options*
|
||||
mkdir() eval.txt /*mkdir()*
|
||||
mlang.txt mlang.txt /*mlang.txt*
|
||||
@@ -7237,18 +7224,7 @@ mouse_win-variable eval.txt /*mouse_win-variable*
|
||||
movement intro.txt /*movement*
|
||||
ms-dos os_msdos.txt /*ms-dos*
|
||||
msdos os_msdos.txt /*msdos*
|
||||
msdos-arrows os_msdos.txt /*msdos-arrows*
|
||||
msdos-clipboard-limits os_msdos.txt /*msdos-clipboard-limits*
|
||||
msdos-compiling os_msdos.txt /*msdos-compiling*
|
||||
msdos-copy-paste os_msdos.txt /*msdos-copy-paste*
|
||||
msdos-fname-extensions os_msdos.txt /*msdos-fname-extensions*
|
||||
msdos-limitations os_msdos.txt /*msdos-limitations*
|
||||
msdos-linked-files os_msdos.txt /*msdos-linked-files*
|
||||
msdos-longfname os_msdos.txt /*msdos-longfname*
|
||||
msdos-mode gui_w32.txt /*msdos-mode*
|
||||
msdos-problems os_msdos.txt /*msdos-problems*
|
||||
msdos-termcap os_msdos.txt /*msdos-termcap*
|
||||
msdos-versions os_msdos.txt /*msdos-versions*
|
||||
msql.vim syntax.txt /*msql.vim*
|
||||
mswin.vim gui_w32.txt /*mswin.vim*
|
||||
multi-byte mbyte.txt /*multi-byte*
|
||||
@@ -8138,10 +8114,6 @@ slice eval.txt /*slice*
|
||||
slow-fast-terminal term.txt /*slow-fast-terminal*
|
||||
slow-start starting.txt /*slow-start*
|
||||
slow-terminal term.txt /*slow-terminal*
|
||||
sniff if_sniff.txt /*sniff*
|
||||
sniff-commands if_sniff.txt /*sniff-commands*
|
||||
sniff-compiling if_sniff.txt /*sniff-compiling*
|
||||
sniff-intro if_sniff.txt /*sniff-intro*
|
||||
socket-interface channel.txt /*socket-interface*
|
||||
sort() eval.txt /*sort()*
|
||||
sorting change.txt /*sorting*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 7.4. Last change: 2016 Feb 24
|
||||
*todo.txt* For Vim version 7.4. Last change: 2016 Feb 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -35,10 +35,6 @@ not be repeated below, unless there is extra information.
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
+channel:
|
||||
- don't free channel if there are callbacks.
|
||||
netbeans channel leaks?
|
||||
- job_stop() on MS-Windows: "term" should probably do the same as "kill".
|
||||
- Make JSON encode and decode NaN and Infinity.
|
||||
- A callback on ch_sendraw() should be put at the end of the list of callback
|
||||
handlers. When a message arrives invoke the first one and remove it.
|
||||
- implement TODO items in ":help channel":
|
||||
@@ -72,11 +68,14 @@ not be repeated below, unless there is extra information.
|
||||
- Add a test where ["eval","getline(123)"] gets a line with special
|
||||
characters (NUL, 0x80, etc.). Check that it isn't garbled.
|
||||
- make sure errors lead to a useful error msg. ["ex","foobar"]
|
||||
- json: implement UTF-16 surrogate pair.
|
||||
- For connection to server, a "keep open" flag would be useful. Retry
|
||||
connecting in the main loop with zero timeout.
|
||||
|
||||
Remove the sniff interface? Looks like it's dead.
|
||||
For Win32 isinf() should be inline. (ZyX)
|
||||
|
||||
Add ":packadd"? Like :loadplugin but only adds the dir to 'runtimepath'.
|
||||
|
||||
emoji patch from Yasuhiro Matsumoto.
|
||||
|
||||
More plugin support:
|
||||
- Have a way to install a callback from the main loop. Called every second or
|
||||
@@ -169,6 +168,9 @@ Feb 9)
|
||||
Patch to put undo options together in undo window.
|
||||
(Gary Johnson, 2016 Jan 28)
|
||||
|
||||
Patch to have better check for {action} argument of setqflist().
|
||||
Nikolai Pavlov, Feb 25, #661. Can be even more strict.
|
||||
|
||||
Patch for clearing history. (Yegappan Lakshmanan, 2016 Jan 31, second message
|
||||
has tests)
|
||||
|
||||
@@ -1563,8 +1565,6 @@ still delete them. Also convert all buffer file names?
|
||||
|
||||
Update src/testdir/main.aap.
|
||||
|
||||
"vim -c 'sniff connect'" hangs Vim. (Dominique Pelle, 2008 Dec 7)
|
||||
|
||||
Something wrong with session that has "cd" commands and "badd", in such a way
|
||||
that Vim doesn't find the edited file in the buffer list, causing the
|
||||
ATTENTION message? (Tony Mechelynck, 2008 Dec 1)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_29.txt* For Vim version 7.4. Last change: 2008 Jun 28
|
||||
*usr_29.txt* For Vim version 7.4. Last change: 2016 Feb 27
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -265,9 +265,6 @@ doesn't work if the tags file isn't sorted.
|
||||
The 'taglength' option can be used to tell Vim the number of significant
|
||||
characters in a tag.
|
||||
|
||||
When you use the SNiFF+ program, you can use the Vim interface to it |sniff|.
|
||||
SNiFF+ is a commercial program.
|
||||
|
||||
Cscope is a free program. It does not only find places where an identifier is
|
||||
declared, but also where it is used. See |cscope|.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 7.4. Last change: 2016 Feb 18
|
||||
*various.txt* For Vim version 7.4. Last change: 2016 Feb 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -413,7 +413,6 @@ m *+ruby/dyn* Ruby interface |ruby-dynamic| |/dyn|
|
||||
N *+scrollbind* |'scrollbind'|
|
||||
B *+signs* |:sign|
|
||||
N *+smartindent* |'smartindent'|
|
||||
m *+sniff* SniFF interface |sniff|
|
||||
N *+startuptime* |--startuptime| argument
|
||||
N *+statusline* Options 'statusline', 'rulerformat' and special
|
||||
formats of 'titlestring' and 'iconstring'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*version5.txt* For Vim version 7.4. Last change: 2016 Jan 03
|
||||
*version5.txt* For Vim version 7.4. Last change: 2016 Feb 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -934,7 +934,7 @@ Don't add "-L/usr/lib" to the link line, causes problems on a few systems.
|
||||
When compiling, allow a choice for minimal, normal or maximal features in an
|
||||
easy way, by changing a single line in src/feature.h.
|
||||
The DOS16 version has been compiled with minimal features to avoid running
|
||||
out of memory too quickly. |dos16|
|
||||
out of memory too quickly.
|
||||
The Win32, DJGPP, and OS/2 versions use maximal features, because they have
|
||||
enough memory.
|
||||
The Amiga version is available with normal and maximal features.
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
" Vim syntax file
|
||||
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77)
|
||||
" Version: 0.96
|
||||
" Last Change: 2015 Nov. 30
|
||||
" Version: 0.97
|
||||
" Last Change: 2016 Feb. 26
|
||||
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
|
||||
" Usage: For instructions, do :help fortran-syntax from Vim
|
||||
" Credits:
|
||||
" Version 0.1 was based on the fortran 77 syntax file by Mario Eusebio and
|
||||
" Preben Guldberg. Useful suggestions and contributions were made by: Andrej Panjkov,
|
||||
" Bram Moolenaar, Thomas Olsen, Michael Sternberg, Christian Reile,
|
||||
" Version 0.1 (April 2000) was based on the fortran 77 syntax file by Mario Eusebio and
|
||||
" Preben Guldberg. Since then, useful suggestions and contributions have been made,
|
||||
" in chronological order, by:
|
||||
" Andrej Panjkov, Bram Moolenaar, Thomas Olsen, Michael Sternberg, Christian Reile,
|
||||
" Walter Dieudonné, Alexander Wagner, Roman Bertle, Charles Rendleman,
|
||||
" Andrew Griffiths, Joe Krahn, Hendrik Merx, and Matt Thompson.
|
||||
" Andrew Griffiths, Joe Krahn, Hendrik Merx, Matt Thompson, and Jan Hermann.
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -407,7 +408,7 @@ if exists("fortran_fold")
|
||||
else
|
||||
syn region fortran77Loop transparent fold keepend start="\<do\s\+\z(\d\+\)" end="^\s*\z1\>" contains=ALLBUT,fortranUnitHeader,fortranStructure,fortranStorageClass,fortranType,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortranBlockData
|
||||
syn region fortran90Loop transparent fold keepend extend start="\(\<end\s\+\)\@<!\<do\(\s\+\a\|\s*$\)" skip="^\s*[!#].*$" excludenl end="\<end\s*do\>" contains=ALLBUT,fortranUnitHeader,fortranStructure,fortranStorageClass,fortranType,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortranBlockData
|
||||
syn region fortranIfBlock transparent fold keepend extend start="\(\<e\(nd\|lse\)\s\+\)\@<!\<if\s*(.\+)\s*then\>" skip="^\s*[!#].*$" end="\<end\s*if\>" contains=ALLBUT,fortranUnitHeader,fortranStructure,fortranStorageClass,fortranType,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortranBlockData
|
||||
syn region fortranIfBlock transparent fold keepend extend start="\(\<e\(nd\|lse\)\s\+\)\@<!\<if\s*(\(.\|&\s*\n\)\+)\(\s\|&\s*\n\)*then\>" skip="^\s*[!#].*$" end="\<end\s*if\>" contains=ALLBUT,fortranUnitHeader,fortranStructure,fortranStorageClass,fortranType,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortranBlockData
|
||||
syn region fortranCase transparent fold keepend extend start="\<select\s*case\>" skip="^\s*[!#].*$" end="\<end\s*select\>" contains=ALLBUT,fortranUnitHeader,fortranStructure,fortranStorageClass,fortranType,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortranBlockData
|
||||
endif
|
||||
endif
|
||||
|
||||
+5
-20
@@ -82,8 +82,6 @@
|
||||
# TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.3)
|
||||
# You must set TCL_VER_LONG when you set TCL_VER.
|
||||
#
|
||||
# SNiFF+ interface: SNIFF=yes
|
||||
#
|
||||
# Cscope support: CSCOPE=yes
|
||||
#
|
||||
# Iconv library support (always dynamically loaded):
|
||||
@@ -269,16 +267,6 @@ WP64CHECK = /Wp64
|
||||
CTAGS = ctags
|
||||
!endif
|
||||
|
||||
!if "$(SNIFF)" == "yes"
|
||||
# SNIFF - Include support for SNiFF+.
|
||||
SNIFF_INCL = if_sniff.h
|
||||
SNIFF_OBJ = $(OBJDIR)/if_sniff.obj
|
||||
SNIFF_LIB = shell32.lib
|
||||
SNIFF_DEFS = -DFEAT_SNIFF
|
||||
# The SNiFF integration needs multithreaded libraries!
|
||||
MULTITHREADED = yes
|
||||
!endif
|
||||
|
||||
!ifndef CSCOPE
|
||||
CSCOPE = yes
|
||||
!endif
|
||||
@@ -380,7 +368,7 @@ WINVER = 0x0501
|
||||
#VIMRUNTIMEDIR = somewhere
|
||||
|
||||
CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
|
||||
$(SNIFF_DEFS) $(CSCOPE_DEFS) $(NETBEANS_DEFS) $(CHANNEL_DEFS) \
|
||||
$(CSCOPE_DEFS) $(NETBEANS_DEFS) $(CHANNEL_DEFS) \
|
||||
$(NBDEBUG_DEFS) $(XPM_DEFS) \
|
||||
$(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
|
||||
/Fo$(OUTDIR)/
|
||||
@@ -528,7 +516,7 @@ CFLAGS = $(CFLAGS) /Zl /MTd
|
||||
!endif # DEBUG
|
||||
|
||||
INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
|
||||
proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \
|
||||
proto.h option.h structs.h term.h $(CSCOPE_INCL) \
|
||||
$(NBDEBUG_INCL)
|
||||
|
||||
OBJ = \
|
||||
@@ -997,7 +985,7 @@ conflags = $(conflags) /map /mapinfo:lines
|
||||
!ENDIF
|
||||
|
||||
LINKARGS1 = $(linkdebug) $(conflags)
|
||||
LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(NODEFAULTLIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
|
||||
LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(NODEFAULTLIB) $(LIBC) $(OLE_LIB) user32.lib \
|
||||
$(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \
|
||||
$(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
|
||||
|
||||
@@ -1020,12 +1008,12 @@ all: $(VIM).exe \
|
||||
|
||||
$(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
|
||||
$(LUA_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) $(TCL_OBJ) \
|
||||
$(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) $(XPM_OBJ) \
|
||||
$(CSCOPE_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) $(XPM_OBJ) \
|
||||
version.c version.h
|
||||
$(CC) $(CFLAGS) version.c
|
||||
$(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
|
||||
$(LUA_OBJ) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) \
|
||||
$(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) \
|
||||
$(TCL_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) \
|
||||
$(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
|
||||
if exist $(VIM).exe.manifest mt.exe -nologo -manifest $(VIM).exe.manifest -updateresource:$(VIM).exe;1
|
||||
|
||||
@@ -1212,9 +1200,6 @@ $(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
|
||||
$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
|
||||
$(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c
|
||||
|
||||
$(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
|
||||
$(CC) $(CFLAGS) if_sniff.c
|
||||
|
||||
$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
|
||||
$(CC) $(CFLAGS) $(TCL_INC) if_tcl.c
|
||||
|
||||
|
||||
+6
-20
@@ -2,7 +2,7 @@
|
||||
# Makefile for Vim on OpenVMS
|
||||
#
|
||||
# Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com>
|
||||
# Last change: 2016 Jan 22
|
||||
# Last change: 2016 Feb 27
|
||||
#
|
||||
# This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64
|
||||
# with MMS and MMK
|
||||
@@ -66,7 +66,6 @@ CCVER = YES
|
||||
# VIM_PERL = YES
|
||||
# VIM_PYTHON = YES
|
||||
# VIM_RUBY = YES
|
||||
# VIM_SNIFF = YES
|
||||
|
||||
# X Input Method. For entering special languages like chinese and
|
||||
# Japanese. Please define just one: VIM_XIM or VIM_HANGULIN
|
||||
@@ -228,15 +227,6 @@ TCL_LIB = ,OS_VMS_TCL.OPT/OPT
|
||||
TCL_INC = ,dka0:[tcl80.generic]
|
||||
.ENDIF
|
||||
|
||||
.IFDEF VIM_SNIFF
|
||||
# SNIFF related setup.
|
||||
SNIFF_DEF = ,"FEAT_SNIFF"
|
||||
SNIFF_SRC = if_sniff.c
|
||||
SNIFF_OBJ = if_sniff.obj
|
||||
SNIFF_LIB =
|
||||
SNIFF_INC =
|
||||
.ENDIF
|
||||
|
||||
.IFDEF VIM_RUBY
|
||||
# RUBY related setup.
|
||||
RUBY_DEF = ,"FEAT_RUBY"
|
||||
@@ -293,7 +283,7 @@ VIMHOST = "''F$TRNLNM("SYS$NODE")'''F$TRNLNM("UCX$INET_HOST")'.''F$TRNLNM("UCX$I
|
||||
.SUFFIXES : .obj .c
|
||||
|
||||
ALL_CFLAGS = /def=($(MODEL_DEF)$(DEFS)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) -
|
||||
$(TCL_DEF)$(SNIFF_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)$(MZSCH_DEF)$(ICONV_DEF)) -
|
||||
$(TCL_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)$(MZSCH_DEF)$(ICONV_DEF)) -
|
||||
$(CFLAGS)$(GUI_FLAG) -
|
||||
/include=($(C_INC)$(GUI_INC_DIR)$(GUI_INC)$(PERL_INC)$(PYTHON_INC)$(TCL_INC))
|
||||
|
||||
@@ -302,12 +292,12 @@ ALL_CFLAGS = /def=($(MODEL_DEF)$(DEFS)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) -
|
||||
# as $(GUI_INC) - replaced with $(GUI_INC_VER)
|
||||
# Otherwise should not be any other difference.
|
||||
ALL_CFLAGS_VER = /def=($(MODEL_DEF)$(DEFS)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) -
|
||||
$(TCL_DEF)$(SNIFF_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)$(MZSCH_DEF)$(ICONV_DEF)) -
|
||||
$(TCL_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)$(MZSCH_DEF)$(ICONV_DEF)) -
|
||||
$(CFLAGS)$(GUI_FLAG) -
|
||||
/include=($(C_INC)$(GUI_INC_DIR)$(GUI_INC_VER)$(PERL_INC)$(PYTHON_INC)$(TCL_INC))
|
||||
|
||||
ALL_LIBS = $(LIBS) $(GUI_LIB_DIR) $(GUI_LIB) \
|
||||
$(PERL_LIB) $(PYTHON_LIB) $(TCL_LIB) $(SNIFF_LIB) $(RUBY_LIB)
|
||||
$(PERL_LIB) $(PYTHON_LIB) $(TCL_LIB) $(RUBY_LIB)
|
||||
|
||||
SRC = blowfish.c buffer.c charset.c crypt.c, crypt_zip.c diff.c digraph.c edit.c eval.c ex_cmds.c ex_cmds2.c \
|
||||
ex_docmd.c ex_eval.c ex_getln.c if_xcmdsrv.c fileio.c fold.c getchar.c \
|
||||
@@ -315,7 +305,7 @@ SRC = blowfish.c buffer.c charset.c crypt.c, crypt_zip.c diff.c digraph.c edit.c
|
||||
misc2.c move.c normal.c ops.c option.c popupmnu.c quickfix.c regexp.c search.c sha256.c\
|
||||
spell.c syntax.c tag.c term.c termlib.c ui.c undo.c version.c screen.c \
|
||||
window.c os_unix.c os_vms.c pathdef.c \
|
||||
$(GUI_SRC) $(PERL_SRC) $(PYTHON_SRC) $(TCL_SRC) $(SNIFF_SRC) \
|
||||
$(GUI_SRC) $(PERL_SRC) $(PYTHON_SRC) $(TCL_SRC) \
|
||||
$(RUBY_SRC) $(HANGULIN_SRC) $(MZSCH_SRC)
|
||||
|
||||
OBJ = blowfish.obj buffer.obj charset.obj crypt.obj, crypt_zip.obj diff.obj digraph.obj edit.obj eval.obj \
|
||||
@@ -326,7 +316,7 @@ OBJ = blowfish.obj buffer.obj charset.obj crypt.obj, crypt_zip.obj diff.obj digr
|
||||
regexp.obj search.obj sha256.obj spell.obj syntax.obj tag.obj term.obj termlib.obj \
|
||||
ui.obj undo.obj screen.obj version.obj window.obj os_unix.obj \
|
||||
os_vms.obj pathdef.obj if_mzsch.obj\
|
||||
$(GUI_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) \
|
||||
$(GUI_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(TCL_OBJ) \
|
||||
$(RUBY_OBJ) $(HANGULIN_OBJ) $(MZSCH_OBJ)
|
||||
|
||||
# Default target is making the executable
|
||||
@@ -778,10 +768,6 @@ if_ruby.obj : if_ruby.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h term.h macros.h structs.h regexp.h \
|
||||
gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
globals.h farsi.h arabic.h version.h
|
||||
if_sniff.obj : if_sniff.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h term.h macros.h structs.h regexp.h \
|
||||
gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
globals.h farsi.h arabic.h os_unixx.h
|
||||
gui_beval.obj : gui_beval.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h term.h macros.h structs.h regexp.h \
|
||||
gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
|
||||
+4
-16
@@ -466,9 +466,6 @@ CClink = $(CC)
|
||||
# Uncomment this when you do not want inter process communication.
|
||||
#CONF_OPT_CHANNEL = --disable-channel
|
||||
|
||||
# SNIFF - Include support for SNiFF+.
|
||||
#CONF_OPT_SNIFF = --enable-sniff
|
||||
|
||||
# MULTIBYTE - To edit multi-byte characters.
|
||||
# Uncomment this when you want to edit a multibyte language.
|
||||
# It's automatically enabled with normal features, GTK or IME support.
|
||||
@@ -1408,7 +1405,7 @@ OSDEF_CFLAGS = $(PRE_DEFS) $(POST_DEFS)
|
||||
|
||||
LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) $(RUBY_CFLAGS) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(TCL_CFLAGS) -Dinline= -D__extension__= -Dalloca=alloca
|
||||
|
||||
LINT_EXTRA = -DUSE_SNIFF -DHANGUL_INPUT -D"__attribute__(x)="
|
||||
LINT_EXTRA = -DHANGUL_INPUT -D"__attribute__(x)="
|
||||
|
||||
DEPEND_CFLAGS = -DPROTO -DDEPEND -DFEAT_GUI $(LINT_CFLAGS)
|
||||
|
||||
@@ -1549,14 +1546,13 @@ SRC = $(BASIC_SRC) \
|
||||
$(PYTHON_SRC) $(PYTHON3_SRC) \
|
||||
$(TCL_SRC) \
|
||||
$(RUBY_SRC) \
|
||||
$(SNIFF_SRC) \
|
||||
$(WORKSHOP_SRC) \
|
||||
$(WSDEBUG_SRC)
|
||||
|
||||
TAGS_SRC = *.c *.cpp if_perl.xs
|
||||
|
||||
EXTRA_SRC = hangulin.c if_lua.c if_mzsch.c auto/if_perl.c if_perlsfio.c \
|
||||
if_python.c if_python3.c if_tcl.c if_ruby.c if_sniff.c \
|
||||
if_python.c if_python3.c if_tcl.c if_ruby.c \
|
||||
gui_beval.c workshop.c wsdebug.c integration.c \
|
||||
netbeans.c channel.c \
|
||||
$(GRESOURCE_SRC)
|
||||
@@ -1578,7 +1574,7 @@ ALL_SRC = $(BASIC_SRC) $(ALL_GUI_SRC) $(UNITTEST_SRC) $(EXTRA_SRC)
|
||||
# The perl sources also don't work well with lint.
|
||||
LINT_SRC = $(BASIC_SRC) $(GUI_SRC) $(HANGULIN_SRC) \
|
||||
$(PYTHON_SRC) $(PYTHON3_SRC) $(TCL_SRC) \
|
||||
$(SNIFF_SRC) $(WORKSHOP_SRC) $(WSDEBUG_SRC) \
|
||||
$(WORKSHOP_SRC) $(WSDEBUG_SRC) \
|
||||
$(NETBEANS_SRC) $(CHANNEL_SRC)
|
||||
#LINT_SRC = $(SRC)
|
||||
#LINT_SRC = $(ALL_SRC)
|
||||
@@ -1628,7 +1624,6 @@ OBJ_COMMON = \
|
||||
objects/sha256.o \
|
||||
objects/spell.o \
|
||||
objects/syntax.o \
|
||||
$(SNIFF_OBJ) \
|
||||
objects/tag.o \
|
||||
objects/term.o \
|
||||
objects/ui.o \
|
||||
@@ -1767,7 +1762,7 @@ config auto/config.mk: auto/configure config.mk.in config.h.in
|
||||
$(CONF_OPT_TCL) $(CONF_OPT_RUBY) $(CONF_OPT_NLS) \
|
||||
$(CONF_OPT_CSCOPE) $(CONF_OPT_MULTIBYTE) $(CONF_OPT_INPUT) \
|
||||
$(CONF_OPT_OUTPUT) $(CONF_OPT_GPM) $(CONF_OPT_WORKSHOP) \
|
||||
$(CONF_OPT_SNIFF) $(CONF_OPT_FEAT) $(CONF_TERM_LIB) \
|
||||
$(CONF_OPT_FEAT) $(CONF_TERM_LIB) \
|
||||
$(CONF_OPT_COMPBY) $(CONF_OPT_ACL) $(CONF_OPT_NETBEANS) \
|
||||
$(CONF_OPT_CHANNEL) \
|
||||
$(CONF_ARGS) $(CONF_OPT_MZSCHEME) $(CONF_OPT_PLTHOME) \
|
||||
@@ -2841,9 +2836,6 @@ objects/if_python3.o: if_python3.c if_py_both.h
|
||||
objects/if_ruby.o: if_ruby.c
|
||||
$(CCC) $(RUBY_CFLAGS) -o $@ if_ruby.c
|
||||
|
||||
objects/if_sniff.o: if_sniff.c
|
||||
$(CCC) -o $@ if_sniff.c
|
||||
|
||||
objects/if_tcl.o: if_tcl.c
|
||||
$(CCC) $(TCL_CFLAGS) -o $@ if_tcl.c
|
||||
|
||||
@@ -3423,10 +3415,6 @@ objects/if_ruby.o: if_ruby.c auto/config.h vim.h feature.h os_unix.h auto/osdef.
|
||||
ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
|
||||
gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h \
|
||||
farsi.h arabic.h version.h
|
||||
objects/if_sniff.o: if_sniff.c vim.h auto/config.h feature.h os_unix.h \
|
||||
auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
|
||||
regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \
|
||||
globals.h farsi.h arabic.h os_unixx.h
|
||||
objects/gui_beval.o: gui_beval.c vim.h auto/config.h feature.h os_unix.h \
|
||||
auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
|
||||
regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \
|
||||
|
||||
+1
-1
@@ -17,5 +17,5 @@ typedef enum {
|
||||
aid_qf_namebuf,
|
||||
aid_qf_errmsg,
|
||||
aid_qf_pattern,
|
||||
aid_last,
|
||||
aid_last
|
||||
} alloc_id_T;
|
||||
|
||||
Vendored
+43
-25
@@ -654,8 +654,6 @@ X_PRE_LIBS
|
||||
X_CFLAGS
|
||||
XMKMF
|
||||
xmkmfpath
|
||||
SNIFF_OBJ
|
||||
SNIFF_SRC
|
||||
CHANNEL_OBJ
|
||||
CHANNEL_SRC
|
||||
NETBEANS_OBJ
|
||||
@@ -816,7 +814,6 @@ enable_cscope
|
||||
enable_workshop
|
||||
enable_netbeans
|
||||
enable_channel
|
||||
enable_sniff
|
||||
enable_multibyte
|
||||
enable_hangulinput
|
||||
enable_xim
|
||||
@@ -1483,7 +1480,6 @@ Optional Features:
|
||||
--enable-workshop Include Sun Visual Workshop support.
|
||||
--disable-netbeans Disable NetBeans integration support.
|
||||
--disable-channel Disable process communication support.
|
||||
--enable-sniff Include Sniff interface.
|
||||
--enable-multibyte Include multibyte editing support.
|
||||
--enable-hangulinput Include Hangul input support.
|
||||
--enable-xim Include XIM input support.
|
||||
@@ -7523,26 +7519,6 @@ if test "$enable_channel" = "yes"; then
|
||||
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-sniff argument" >&5
|
||||
$as_echo_n "checking --enable-sniff argument... " >&6; }
|
||||
# Check whether --enable-sniff was given.
|
||||
if test "${enable_sniff+set}" = set; then :
|
||||
enableval=$enable_sniff;
|
||||
else
|
||||
enable_sniff="no"
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_sniff" >&5
|
||||
$as_echo "$enable_sniff" >&6; }
|
||||
if test "$enable_sniff" = "yes"; then
|
||||
$as_echo "#define FEAT_SNIFF 1" >>confdefs.h
|
||||
|
||||
SNIFF_SRC="if_sniff.c"
|
||||
|
||||
SNIFF_OBJ="objects/if_sniff.o"
|
||||
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-multibyte argument" >&5
|
||||
$as_echo_n "checking --enable-multibyte argument... " >&6; }
|
||||
# Check whether --enable-multibyte was given.
|
||||
@@ -11113,6 +11089,48 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
|
||||
presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
|
||||
esac
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
|
||||
$as_echo_n "checking for inline... " >&6; }
|
||||
if ${ac_cv_c_inline+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_cv_c_inline=no
|
||||
for ac_kw in inline __inline__ __inline; do
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#ifndef __cplusplus
|
||||
typedef int foo_t;
|
||||
static $ac_kw foo_t static_foo () {return 0; }
|
||||
$ac_kw foo_t foo () {return 0; }
|
||||
#endif
|
||||
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
ac_cv_c_inline=$ac_kw
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
test "$ac_cv_c_inline" != no && break
|
||||
done
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
|
||||
$as_echo "$ac_cv_c_inline" >&6; }
|
||||
|
||||
case $ac_cv_c_inline in
|
||||
inline | yes) ;;
|
||||
*)
|
||||
case $ac_cv_c_inline in
|
||||
no) ac_val=;;
|
||||
*) ac_val=$ac_cv_c_inline;;
|
||||
esac
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#ifndef __cplusplus
|
||||
#define inline $ac_val
|
||||
#endif
|
||||
_ACEOF
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rlim_t" >&5
|
||||
$as_echo_n "checking for rlim_t... " >&6; }
|
||||
@@ -11951,7 +11969,7 @@ for ac_func in bcmp fchdir fchown fsync getcwd getpseudotty \
|
||||
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
|
||||
sigvec strcasecmp strerror strftime stricmp strncasecmp \
|
||||
strnicmp strpbrk strtol tgetent towlower towupper iswupper \
|
||||
usleep utime utimes
|
||||
usleep utime utimes isnan isinf
|
||||
do :
|
||||
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
|
||||
|
||||
+141
-9
@@ -52,6 +52,10 @@
|
||||
# define fd_close(sd) close(sd)
|
||||
#endif
|
||||
|
||||
/* Whether a redraw is needed for appending a line to a buffer. */
|
||||
static int channel_need_redraw = FALSE;
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
static int
|
||||
fd_read(sock_T fd, char *buf, size_t len)
|
||||
@@ -345,6 +349,7 @@ channel_may_free(channel_T *channel)
|
||||
channel_free(channel_T *channel)
|
||||
{
|
||||
channel_close(channel, TRUE);
|
||||
channel_clear(channel);
|
||||
if (channel->ch_next != NULL)
|
||||
channel->ch_next->ch_prev = channel->ch_prev;
|
||||
if (channel->ch_prev == NULL)
|
||||
@@ -795,6 +800,38 @@ channel_set_job(channel_T *channel, job_T *job)
|
||||
channel->ch_job = job;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find a buffer matching "name" or create a new one.
|
||||
*/
|
||||
static buf_T *
|
||||
find_buffer(char_u *name)
|
||||
{
|
||||
buf_T *buf = NULL;
|
||||
buf_T *save_curbuf = curbuf;
|
||||
|
||||
if (name != NULL && *name != NUL)
|
||||
buf = buflist_findname(name);
|
||||
if (buf == NULL)
|
||||
{
|
||||
buf = buflist_new(name == NULL || *name == NUL ? NULL : name,
|
||||
NULL, (linenr_T)0, BLN_LISTED);
|
||||
buf_copy_options(buf, BCO_ENTER);
|
||||
#ifdef FEAT_QUICKFIX
|
||||
clear_string_option(&buf->b_p_bt);
|
||||
buf->b_p_bt = vim_strsave((char_u *)"nofile");
|
||||
clear_string_option(&buf->b_p_bh);
|
||||
buf->b_p_bh = vim_strsave((char_u *)"hide");
|
||||
#endif
|
||||
curbuf = buf;
|
||||
ml_open(curbuf);
|
||||
ml_replace(1, (char_u *)"Reading from channel output...", TRUE);
|
||||
changed_bytes(1, 0);
|
||||
curbuf = save_curbuf;
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set various properties from an "opt" argument.
|
||||
*/
|
||||
@@ -858,6 +895,16 @@ channel_set_options(channel_T *channel, jobopt_T *opt)
|
||||
else
|
||||
*cbp = NULL;
|
||||
}
|
||||
|
||||
if ((opt->jo_set & JO_OUT_IO) && opt->jo_io[PART_OUT] == JIO_BUFFER)
|
||||
{
|
||||
/* writing output to a buffer. Force mode to NL. */
|
||||
channel->ch_part[PART_OUT].ch_mode = MODE_NL;
|
||||
channel->ch_part[PART_OUT].ch_buffer =
|
||||
find_buffer(opt->jo_io_name[PART_OUT]);
|
||||
ch_logs(channel, "writing to buffer '%s'",
|
||||
(char *)channel->ch_part[PART_OUT].ch_buffer->b_ffname);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1322,6 +1369,7 @@ may_invoke_callback(channel_T *channel, int part)
|
||||
int seq_nr = -1;
|
||||
ch_mode_T ch_mode = channel->ch_part[part].ch_mode;
|
||||
char_u *callback = NULL;
|
||||
buf_T *buffer = NULL;
|
||||
|
||||
if (channel->ch_nb_close_cb != NULL)
|
||||
/* this channel is handled elsewhere (netbeans) */
|
||||
@@ -1332,6 +1380,14 @@ may_invoke_callback(channel_T *channel, int part)
|
||||
else
|
||||
callback = channel->ch_callback;
|
||||
|
||||
buffer = channel->ch_part[part].ch_buffer;
|
||||
if (buffer != NULL && !buf_valid(buffer))
|
||||
{
|
||||
/* buffer was wiped out */
|
||||
channel->ch_part[part].ch_buffer = NULL;
|
||||
buffer = NULL;
|
||||
}
|
||||
|
||||
if (ch_mode == MODE_JSON || ch_mode == MODE_JS)
|
||||
{
|
||||
listitem_T *item;
|
||||
@@ -1380,8 +1436,8 @@ may_invoke_callback(channel_T *channel, int part)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If there is no callback drop the message. */
|
||||
if (callback == NULL)
|
||||
/* If there is no callback or buffer drop the message. */
|
||||
if (callback == NULL && buffer == NULL)
|
||||
{
|
||||
while ((msg = channel_get(channel, part)) != NULL)
|
||||
vim_free(msg);
|
||||
@@ -1405,8 +1461,11 @@ may_invoke_callback(channel_T *channel, int part)
|
||||
return FALSE; /* incomplete message */
|
||||
}
|
||||
if (nl[1] == NUL)
|
||||
/* get the whole buffer */
|
||||
{
|
||||
/* get the whole buffer, drop the NL */
|
||||
msg = channel_get(channel, part);
|
||||
*nl = NUL;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Copy the message into allocated memory and remove it from
|
||||
@@ -1450,11 +1509,54 @@ may_invoke_callback(channel_T *channel, int part)
|
||||
if (!done)
|
||||
ch_log(channel, "Dropping message without callback");
|
||||
}
|
||||
else if (callback != NULL)
|
||||
else if (callback != NULL || buffer != NULL)
|
||||
{
|
||||
/* invoke the channel callback */
|
||||
ch_log(channel, "Invoking channel callback");
|
||||
invoke_callback(channel, callback, argv);
|
||||
if (buffer != NULL)
|
||||
{
|
||||
buf_T *save_curbuf = curbuf;
|
||||
linenr_T lnum = buffer->b_ml.ml_line_count;
|
||||
|
||||
/* Append to the buffer */
|
||||
ch_logn(channel, "appending line %d to buffer", (int)lnum + 1);
|
||||
|
||||
curbuf = buffer;
|
||||
u_sync(TRUE);
|
||||
u_save(lnum, lnum + 1);
|
||||
|
||||
ml_append(lnum, msg, 0, FALSE);
|
||||
appended_lines_mark(lnum, 1L);
|
||||
curbuf = save_curbuf;
|
||||
|
||||
if (buffer->b_nwindows > 0)
|
||||
{
|
||||
win_T *wp;
|
||||
win_T *save_curwin;
|
||||
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
{
|
||||
if (wp->w_buffer == buffer
|
||||
&& wp->w_cursor.lnum == lnum
|
||||
&& wp->w_cursor.col == 0)
|
||||
{
|
||||
++wp->w_cursor.lnum;
|
||||
save_curwin = curwin;
|
||||
curwin = wp;
|
||||
curbuf = curwin->w_buffer;
|
||||
scroll_cursor_bot(0, FALSE);
|
||||
curwin = save_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
}
|
||||
}
|
||||
redraw_buf_later(buffer, VALID);
|
||||
channel_need_redraw = TRUE;
|
||||
}
|
||||
}
|
||||
if (callback != NULL)
|
||||
{
|
||||
/* invoke the channel callback */
|
||||
ch_log(channel, "Invoking channel callback");
|
||||
invoke_callback(channel, callback, argv);
|
||||
}
|
||||
}
|
||||
else
|
||||
ch_log(channel, "Dropping message");
|
||||
@@ -1512,6 +1614,7 @@ channel_status(channel_T *channel)
|
||||
/*
|
||||
* Close channel "channel".
|
||||
* Trigger the close callback if "invoke_close_cb" is TRUE.
|
||||
* Does not clear the buffers.
|
||||
*/
|
||||
void
|
||||
channel_close(channel_T *channel, int invoke_close_cb)
|
||||
@@ -1567,7 +1670,6 @@ channel_close(channel_T *channel, int invoke_close_cb)
|
||||
}
|
||||
|
||||
channel->ch_nb_close_cb = NULL;
|
||||
channel_clear(channel);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2178,6 +2280,24 @@ channel_select_check(int ret_in, void *rfds_in)
|
||||
}
|
||||
# endif /* !WIN32 && HAVE_SELECT */
|
||||
|
||||
/*
|
||||
* Return TRUE if "channel" has JSON or other typeahead.
|
||||
*/
|
||||
static int
|
||||
channel_has_readahead(channel_T *channel, int part)
|
||||
{
|
||||
ch_mode_T ch_mode = channel->ch_part[part].ch_mode;
|
||||
|
||||
if (ch_mode == MODE_JSON || ch_mode == MODE_JS)
|
||||
{
|
||||
jsonq_T *head = &channel->ch_part[part].ch_json_head;
|
||||
jsonq_T *item = head->jq_next;
|
||||
|
||||
return item != NULL;
|
||||
}
|
||||
return channel_peek(channel, part) != NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Execute queued up commands.
|
||||
* Invoked from the main loop when it's safe to execute received commands.
|
||||
@@ -2191,6 +2311,7 @@ channel_parse_messages(void)
|
||||
int r;
|
||||
int part = PART_SOCK;
|
||||
|
||||
ch_log(NULL, "looking for messages on channels");
|
||||
while (channel != NULL)
|
||||
{
|
||||
if (channel->ch_refcount == 0 && !channel_still_useful(channel))
|
||||
@@ -2201,7 +2322,8 @@ channel_parse_messages(void)
|
||||
part = PART_SOCK;
|
||||
continue;
|
||||
}
|
||||
if (channel->ch_part[part].ch_fd != INVALID_FD)
|
||||
if (channel->ch_part[part].ch_fd != INVALID_FD
|
||||
|| channel_has_readahead(channel, part))
|
||||
{
|
||||
/* Increase the refcount, in case the handler causes the channel
|
||||
* to be unreferenced or closed. */
|
||||
@@ -2227,6 +2349,16 @@ channel_parse_messages(void)
|
||||
part = PART_SOCK;
|
||||
}
|
||||
}
|
||||
|
||||
if (channel_need_redraw && must_redraw)
|
||||
{
|
||||
channel_need_redraw = FALSE;
|
||||
update_screen(0);
|
||||
setcursor();
|
||||
cursor_on();
|
||||
out_flush();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -1761,8 +1761,7 @@ skiptowhite(char_u *p)
|
||||
return p;
|
||||
}
|
||||
|
||||
#if defined(FEAT_LISTCMDS) || defined(FEAT_SIGNS) || defined(FEAT_SNIFF) \
|
||||
|| defined(PROTO)
|
||||
#if defined(FEAT_LISTCMDS) || defined(FEAT_SIGNS) || defined(PROTO)
|
||||
/*
|
||||
* skiptowhite_esc: Like skiptowhite(), but also skip escaped chars
|
||||
*/
|
||||
|
||||
+9
-3
@@ -362,9 +362,6 @@
|
||||
/* Define for linking via dlopen() or LoadLibrary() */
|
||||
#undef DYNAMIC_TCL
|
||||
|
||||
/* Define if you want to include the Sniff interface. */
|
||||
#undef FEAT_SNIFF
|
||||
|
||||
/* Define if you want to add support for ACL */
|
||||
#undef HAVE_POSIX_ACL
|
||||
#undef HAVE_SOLARIS_ZFS_ACL
|
||||
@@ -463,3 +460,12 @@
|
||||
|
||||
/* Define if GTK+ GUI is to be linked against GTK+ 3 */
|
||||
#undef USE_GTK3
|
||||
|
||||
/* Define if we have isinf() */
|
||||
#undef HAVE_ISINF
|
||||
|
||||
/* Define if we have isnan() */
|
||||
#undef HAVE_ISNAN
|
||||
|
||||
/* Define to inline symbol or empty */
|
||||
#undef inline
|
||||
|
||||
@@ -101,9 +101,6 @@ RUBY_PRO = @RUBY_PRO@
|
||||
RUBY_CFLAGS = @RUBY_CFLAGS@
|
||||
RUBY_LIBS = @RUBY_LIBS@
|
||||
|
||||
SNIFF_SRC = @SNIFF_SRC@
|
||||
SNIFF_OBJ = @SNIFF_OBJ@
|
||||
|
||||
AWK = @AWK@
|
||||
|
||||
STRIP = @STRIP@
|
||||
|
||||
+2
-14
@@ -2074,19 +2074,6 @@ if test "$enable_channel" = "yes"; then
|
||||
AC_SUBST(CHANNEL_OBJ)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(--enable-sniff argument)
|
||||
AC_ARG_ENABLE(sniff,
|
||||
[ --enable-sniff Include Sniff interface.], ,
|
||||
[enable_sniff="no"])
|
||||
AC_MSG_RESULT($enable_sniff)
|
||||
if test "$enable_sniff" = "yes"; then
|
||||
AC_DEFINE(FEAT_SNIFF)
|
||||
SNIFF_SRC="if_sniff.c"
|
||||
AC_SUBST(SNIFF_SRC)
|
||||
SNIFF_OBJ="objects/if_sniff.o"
|
||||
AC_SUBST(SNIFF_OBJ)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(--enable-multibyte argument)
|
||||
AC_ARG_ENABLE(multibyte,
|
||||
[ --enable-multibyte Include multibyte editing support.], ,
|
||||
@@ -3233,6 +3220,7 @@ AC_HEADER_TIME
|
||||
AC_CHECK_TYPE(ino_t, long)
|
||||
AC_CHECK_TYPE(dev_t, unsigned)
|
||||
AC_C_BIGENDIAN(,,,)
|
||||
AC_C_INLINE
|
||||
|
||||
AC_MSG_CHECKING(for rlim_t)
|
||||
if eval "test \"`echo '$''{'ac_cv_type_rlim_t'+set}'`\" = set"; then
|
||||
@@ -3651,7 +3639,7 @@ AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \
|
||||
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
|
||||
sigvec strcasecmp strerror strftime stricmp strncasecmp \
|
||||
strnicmp strpbrk strtol tgetent towlower towupper iswupper \
|
||||
usleep utime utimes)
|
||||
usleep utime utimes isnan isinf)
|
||||
AC_FUNC_FSEEKO
|
||||
|
||||
dnl define _LARGE_FILES, _FILE_OFFSET_BITS and _LARGEFILE_SOURCE when
|
||||
|
||||
@@ -1052,12 +1052,6 @@ doESCkey:
|
||||
case K_SELECT: /* end of Select mode mapping - ignore */
|
||||
break;
|
||||
|
||||
#ifdef FEAT_SNIFF
|
||||
case K_SNIFF: /* Sniff command received */
|
||||
stuffcharReadbuff(K_SNIFF);
|
||||
goto doESCkey;
|
||||
#endif
|
||||
|
||||
case K_HELP: /* Help key works like <ESC> <Help> */
|
||||
case K_F1:
|
||||
case K_XF1:
|
||||
|
||||
+156
-25
@@ -10,6 +10,7 @@
|
||||
/*
|
||||
* eval.c: Expression evaluation.
|
||||
*/
|
||||
#define USING_FLOAT_STUFF
|
||||
|
||||
#include "vim.h"
|
||||
|
||||
@@ -27,16 +28,6 @@
|
||||
# include <time.h> /* for time_t */
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_FLOAT)
|
||||
# include <float.h>
|
||||
# if defined(HAVE_MATH_H)
|
||||
# include <math.h>
|
||||
# endif
|
||||
# if defined(WIN32) && !defined(isnan)
|
||||
# define isnan(x) _isnan(x)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define DICT_MAXNEST 100 /* maximum nesting of lists and dicts */
|
||||
|
||||
#define DO_NOT_FREE_CNT 99999 /* refcount for dict or list that should not
|
||||
@@ -507,6 +498,9 @@ static void f_ceil(typval_T *argvars, typval_T *rettv);
|
||||
#endif
|
||||
#ifdef FEAT_CHANNEL
|
||||
static void f_ch_close(typval_T *argvars, typval_T *rettv);
|
||||
static void f_ch_evalexpr(typval_T *argvars, typval_T *rettv);
|
||||
static void f_ch_evalraw(typval_T *argvars, typval_T *rettv);
|
||||
static void f_ch_getbufnr(typval_T *argvars, typval_T *rettv);
|
||||
# ifdef FEAT_JOB
|
||||
static void f_ch_getjob(typval_T *argvars, typval_T *rettv);
|
||||
# endif
|
||||
@@ -8201,6 +8195,9 @@ static struct fst
|
||||
#endif
|
||||
#ifdef FEAT_CHANNEL
|
||||
{"ch_close", 1, 1, f_ch_close},
|
||||
{"ch_evalexpr", 2, 3, f_ch_evalexpr},
|
||||
{"ch_evalraw", 2, 3, f_ch_evalraw},
|
||||
{"ch_getbufnr", 2, 2, f_ch_getbufnr},
|
||||
# ifdef FEAT_JOB
|
||||
{"ch_getjob", 1, 1, f_ch_getjob},
|
||||
# endif
|
||||
@@ -9976,12 +9973,45 @@ handle_mode(typval_T *item, jobopt_T *opt, ch_mode_T *modep, int jo)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int
|
||||
handle_io(typval_T *item, int part, jobopt_T *opt)
|
||||
{
|
||||
char_u *val = get_tv_string(item);
|
||||
|
||||
opt->jo_set |= JO_OUT_IO << (part - PART_OUT);
|
||||
if (STRCMP(val, "null") == 0)
|
||||
opt->jo_io[part] = JIO_NULL;
|
||||
else if (STRCMP(val, "pipe") == 0)
|
||||
opt->jo_io[part] = JIO_PIPE;
|
||||
else if (STRCMP(val, "file") == 0)
|
||||
opt->jo_io[part] = JIO_FILE;
|
||||
else if (STRCMP(val, "buffer") == 0)
|
||||
opt->jo_io[part] = JIO_BUFFER;
|
||||
else if (STRCMP(val, "out") == 0 && part == PART_ERR)
|
||||
opt->jo_io[part] = JIO_OUT;
|
||||
else
|
||||
{
|
||||
EMSG2(_(e_invarg2), val);
|
||||
return FAIL;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
static void
|
||||
clear_job_options(jobopt_T *opt)
|
||||
{
|
||||
vim_memset(opt, 0, sizeof(jobopt_T));
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the PART_ number from the first character of an option name.
|
||||
*/
|
||||
static int
|
||||
part_from_char(int c)
|
||||
{
|
||||
return c == 'i' ? PART_IN : c == 'o' ? PART_OUT: PART_ERR;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the option entries from the dict in "tv", parse them and put the result
|
||||
* in "opt".
|
||||
@@ -9996,6 +10026,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported)
|
||||
dict_T *dict;
|
||||
int todo;
|
||||
hashitem_T *hi;
|
||||
int part;
|
||||
|
||||
opt->jo_set = 0;
|
||||
if (tv->v_type == VAR_UNKNOWN)
|
||||
@@ -10046,6 +10077,27 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported)
|
||||
== FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
else if (STRCMP(hi->hi_key, "in-io") == 0
|
||||
|| STRCMP(hi->hi_key, "out-io") == 0
|
||||
|| STRCMP(hi->hi_key, "err-io") == 0)
|
||||
{
|
||||
if (!(supported & JO_OUT_IO))
|
||||
break;
|
||||
if (handle_io(item, part_from_char(*hi->hi_key), opt) == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
else if (STRCMP(hi->hi_key, "in-name") == 0
|
||||
|| STRCMP(hi->hi_key, "out-name") == 0
|
||||
|| STRCMP(hi->hi_key, "err-name") == 0)
|
||||
{
|
||||
part = part_from_char(*hi->hi_key);
|
||||
|
||||
if (!(supported & JO_OUT_IO))
|
||||
break;
|
||||
opt->jo_set |= JO_OUT_NAME << (part - PART_OUT);
|
||||
opt->jo_io_name[part] =
|
||||
get_tv_string_buf_chk(item, opt->jo_io_name_buf[part]);
|
||||
}
|
||||
else if (STRCMP(hi->hi_key, "callback") == 0)
|
||||
{
|
||||
if (!(supported & JO_CALLBACK))
|
||||
@@ -10216,7 +10268,37 @@ f_ch_close(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
channel_T *channel = get_channel_arg(&argvars[0]);
|
||||
|
||||
if (channel != NULL)
|
||||
{
|
||||
channel_close(channel, FALSE);
|
||||
channel_clear(channel);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* "ch_getbufnr()" function
|
||||
*/
|
||||
static void
|
||||
f_ch_getbufnr(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
channel_T *channel = get_channel_arg(&argvars[0]);
|
||||
|
||||
rettv->vval.v_number = -1;
|
||||
if (channel != NULL)
|
||||
{
|
||||
char_u *what = get_tv_string(&argvars[1]);
|
||||
int part;
|
||||
|
||||
if (STRCMP(what, "err") == 0)
|
||||
part = PART_ERR;
|
||||
else if (STRCMP(what, "out") == 0)
|
||||
part = PART_OUT;
|
||||
else if (STRCMP(what, "in") == 0)
|
||||
part = PART_IN;
|
||||
else
|
||||
part = PART_SOCK;
|
||||
if (channel->ch_part[part].ch_buffer != NULL)
|
||||
rettv->vval.v_number = channel->ch_part[part].ch_buffer->b_fnum;
|
||||
}
|
||||
}
|
||||
|
||||
# ifdef FEAT_JOB
|
||||
@@ -10420,7 +10502,13 @@ f_ch_readraw(typval_T *argvars, typval_T *rettv)
|
||||
* Otherwise returns NULL.
|
||||
*/
|
||||
static channel_T *
|
||||
send_common(typval_T *argvars, char_u *text, int id, char *fun, int *part_read)
|
||||
send_common(
|
||||
typval_T *argvars,
|
||||
char_u *text,
|
||||
int id,
|
||||
int eval,
|
||||
char *fun,
|
||||
int *part_read)
|
||||
{
|
||||
channel_T *channel;
|
||||
jobopt_T opt;
|
||||
@@ -10437,9 +10525,17 @@ send_common(typval_T *argvars, char_u *text, int id, char *fun, int *part_read)
|
||||
return NULL;
|
||||
|
||||
/* Set the callback. An empty callback means no callback and not reading
|
||||
* the response. */
|
||||
* the response. With "ch_evalexpr()" and "ch_evalraw()" a callback is not
|
||||
* allowed. */
|
||||
if (opt.jo_callback != NULL && *opt.jo_callback != NUL)
|
||||
{
|
||||
if (eval)
|
||||
{
|
||||
EMSG2(_("E917: Cannot use a callback with %s()"), fun);
|
||||
return NULL;
|
||||
}
|
||||
channel_set_req_callback(channel, part_send, opt.jo_callback, id);
|
||||
}
|
||||
|
||||
if (channel_send(channel, part_send, text, fun) == OK
|
||||
&& opt.jo_callback == NULL)
|
||||
@@ -10448,10 +10544,10 @@ send_common(typval_T *argvars, char_u *text, int id, char *fun, int *part_read)
|
||||
}
|
||||
|
||||
/*
|
||||
* "ch_sendexpr()" function
|
||||
* common for "ch_evalexpr()" and "ch_sendexpr()"
|
||||
*/
|
||||
static void
|
||||
f_ch_sendexpr(typval_T *argvars, typval_T *rettv)
|
||||
ch_expr_common(typval_T *argvars, typval_T *rettv, int eval)
|
||||
{
|
||||
char_u *text;
|
||||
typval_T *listtv;
|
||||
@@ -10474,7 +10570,7 @@ f_ch_sendexpr(typval_T *argvars, typval_T *rettv)
|
||||
ch_mode = channel_get_mode(channel, part_send);
|
||||
if (ch_mode == MODE_RAW || ch_mode == MODE_NL)
|
||||
{
|
||||
EMSG(_("E912: cannot use ch_sendexpr() with a raw or nl channel"));
|
||||
EMSG(_("E912: cannot use ch_evalexpr()/ch_sendexpr() with a raw or nl channel"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10484,9 +10580,10 @@ f_ch_sendexpr(typval_T *argvars, typval_T *rettv)
|
||||
if (text == NULL)
|
||||
return;
|
||||
|
||||
channel = send_common(argvars, text, id, "sendexpr", &part_read);
|
||||
channel = send_common(argvars, text, id, eval,
|
||||
eval ? "ch_evalexpr" : "ch_sendexpr", &part_read);
|
||||
vim_free(text);
|
||||
if (channel != NULL)
|
||||
if (channel != NULL && eval)
|
||||
{
|
||||
/* TODO: timeout from options */
|
||||
timeout = channel_get_timeout(channel, part_read);
|
||||
@@ -10505,10 +10602,28 @@ f_ch_sendexpr(typval_T *argvars, typval_T *rettv)
|
||||
}
|
||||
|
||||
/*
|
||||
* "ch_sendraw()" function
|
||||
* "ch_evalexpr()" function
|
||||
*/
|
||||
static void
|
||||
f_ch_sendraw(typval_T *argvars, typval_T *rettv)
|
||||
f_ch_evalexpr(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
ch_expr_common(argvars, rettv, TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
* "ch_sendexpr()" function
|
||||
*/
|
||||
static void
|
||||
f_ch_sendexpr(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
ch_expr_common(argvars, rettv, FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* common for "ch_evalraw()" and "ch_sendraw()"
|
||||
*/
|
||||
static void
|
||||
ch_raw_common(typval_T *argvars, typval_T *rettv, int eval)
|
||||
{
|
||||
char_u buf[NUMBUFLEN];
|
||||
char_u *text;
|
||||
@@ -10521,8 +10636,9 @@ f_ch_sendraw(typval_T *argvars, typval_T *rettv)
|
||||
rettv->vval.v_string = NULL;
|
||||
|
||||
text = get_tv_string_buf(&argvars[1], buf);
|
||||
channel = send_common(argvars, text, 0, "sendraw", &part_read);
|
||||
if (channel != NULL)
|
||||
channel = send_common(argvars, text, 0, eval,
|
||||
eval ? "ch_evalraw" : "ch_sendraw", &part_read);
|
||||
if (channel != NULL && eval)
|
||||
{
|
||||
/* TODO: timeout from options */
|
||||
timeout = channel_get_timeout(channel, part_read);
|
||||
@@ -10530,6 +10646,24 @@ f_ch_sendraw(typval_T *argvars, typval_T *rettv)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* "ch_evalraw()" function
|
||||
*/
|
||||
static void
|
||||
f_ch_evalraw(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
ch_raw_common(argvars, rettv, TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
* "ch_sendraw()" function
|
||||
*/
|
||||
static void
|
||||
f_ch_sendraw(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
ch_raw_common(argvars, rettv, FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* "ch_setoptions()" function
|
||||
*/
|
||||
@@ -13878,9 +14012,6 @@ f_has(typval_T *argvars, typval_T *rettv)
|
||||
#ifdef FEAT_SMARTINDENT
|
||||
"smartindent",
|
||||
#endif
|
||||
#ifdef FEAT_SNIFF
|
||||
"sniff",
|
||||
#endif
|
||||
#ifdef STARTUPTIME
|
||||
"startuptime",
|
||||
#endif
|
||||
@@ -14967,7 +15098,7 @@ f_job_start(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
opt.jo_mode = MODE_NL;
|
||||
if (get_job_options(&argvars[1], &opt,
|
||||
JO_MODE_ALL + JO_CB_ALL + JO_TIMEOUT_ALL
|
||||
+ JO_STOPONEXIT + JO_EXIT_CB) == FAIL)
|
||||
+ JO_STOPONEXIT + JO_EXIT_CB + JO_OUT_IO) == FAIL)
|
||||
return;
|
||||
job_set_options(job, &opt);
|
||||
|
||||
|
||||
@@ -1287,9 +1287,6 @@ EX(CMD_smenu, "smenu", ex_menu,
|
||||
EX(CMD_snext, "snext", ex_next,
|
||||
RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR,
|
||||
ADDR_LINES),
|
||||
EX(CMD_sniff, "sniff", ex_sniff,
|
||||
EXTRA|TRLBAR,
|
||||
ADDR_LINES),
|
||||
EX(CMD_snomagic, "snomagic", ex_submagic,
|
||||
RANGE|WHOLEFOLD|EXTRA|CMDWIN,
|
||||
ADDR_LINES),
|
||||
|
||||
+1
-6
@@ -131,9 +131,6 @@ do_debug(char_u *cmd)
|
||||
redir_off = TRUE; /* don't redirect debug commands */
|
||||
|
||||
State = NORMAL;
|
||||
#ifdef FEAT_SNIFF
|
||||
want_sniff_request = 0; /* No K_SNIFF wanted */
|
||||
#endif
|
||||
|
||||
if (!debug_did_msg)
|
||||
MSG(_("Entering Debug mode. Type \"cont\" to continue."));
|
||||
@@ -151,9 +148,7 @@ do_debug(char_u *cmd)
|
||||
{
|
||||
msg_scroll = TRUE;
|
||||
need_wait_return = FALSE;
|
||||
#ifdef FEAT_SNIFF
|
||||
ProcessSniffRequests();
|
||||
#endif
|
||||
|
||||
/* Save the current typeahead buffer and replace it with an empty one.
|
||||
* This makes sure we get input from the user here and don't interfere
|
||||
* with the commands being executed. Reset "ex_normal_busy" to avoid
|
||||
|
||||
@@ -298,9 +298,6 @@ static void ex_popup(exarg_T *eap);
|
||||
# define ex_rubydo ex_ni
|
||||
# define ex_rubyfile ex_ni
|
||||
#endif
|
||||
#ifndef FEAT_SNIFF
|
||||
# define ex_sniff ex_ni
|
||||
#endif
|
||||
#ifndef FEAT_KEYMAP
|
||||
# define ex_loadkeymap ex_ni
|
||||
#endif
|
||||
@@ -648,9 +645,6 @@ do_exmode(
|
||||
/* Ignore scrollbar and mouse events in Ex mode */
|
||||
++hold_gui_events;
|
||||
#endif
|
||||
#ifdef FEAT_SNIFF
|
||||
want_sniff_request = 0; /* No K_SNIFF wanted */
|
||||
#endif
|
||||
|
||||
MSG(_("Entering Ex mode. Type \"visual\" to go to Normal mode."));
|
||||
while (exmode_active)
|
||||
@@ -668,9 +662,6 @@ do_exmode(
|
||||
changedtick = curbuf->b_changedtick;
|
||||
prev_msg_row = msg_row;
|
||||
prev_line = curwin->w_cursor.lnum;
|
||||
#ifdef FEAT_SNIFF
|
||||
ProcessSniffRequests();
|
||||
#endif
|
||||
if (improved)
|
||||
{
|
||||
cmdline_row = msg_row;
|
||||
|
||||
@@ -206,9 +206,6 @@ getcmdline(
|
||||
struct cmdline_info save_ccline;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_SNIFF
|
||||
want_sniff_request = 0;
|
||||
#endif
|
||||
#ifdef FEAT_EVAL
|
||||
if (firstc == -1)
|
||||
{
|
||||
|
||||
@@ -1235,7 +1235,6 @@
|
||||
* +perl Perl interface: "--enable-perlinterp"
|
||||
* +python Python interface: "--enable-pythoninterp"
|
||||
* +tcl TCL interface: "--enable-tclinterp"
|
||||
* +sniff Sniff interface: "--enable-sniff"
|
||||
* +sun_workshop Sun Workshop integration
|
||||
* +netbeans_intg Netbeans integration
|
||||
* +channel Inter process communication
|
||||
|
||||
+3
-2
@@ -237,7 +237,8 @@ public:
|
||||
AddRef();
|
||||
}
|
||||
|
||||
~GdiTextRenderer()
|
||||
// add "virtual" to avoid a compiler warning
|
||||
virtual ~GdiTextRenderer()
|
||||
{
|
||||
SafeRelease(&pRenderTarget_);
|
||||
SafeRelease(&pRenderingParams_);
|
||||
@@ -255,7 +256,7 @@ public:
|
||||
__maybenull void* clientDrawingContext,
|
||||
__out DWRITE_MATRIX* transform)
|
||||
{
|
||||
//forward the render target's transform
|
||||
// forward the render target's transform
|
||||
pRenderTarget_->GetCurrentTransform(transform);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1661,7 +1661,7 @@ dialog_add_buttons(GtkDialog *dialog, char_u *button_string)
|
||||
else if (button_equal(label, "Ok")) label = _("OK");
|
||||
else if (button_equal(label, "Yes")) label = _("Yes");
|
||||
else if (button_equal(label, "No")) label = _("No");
|
||||
else if (button_equal(label, "Cancel")) label = _("Canccl");
|
||||
else if (button_equal(label, "Cancel")) label = _("Cancel");
|
||||
# else
|
||||
if (button_equal(label, ok[0])) label = GTK_STOCK_OK;
|
||||
else if (button_equal(label, ync[0])) label = GTK_STOCK_YES;
|
||||
|
||||
+7
-41
@@ -1543,7 +1543,7 @@ selection_get_cb(GtkWidget *widget UNUSED,
|
||||
length += 2;
|
||||
|
||||
#if !GTK_CHECK_VERSION(3,0,0)
|
||||
/* Looks redandunt even for GTK2 because these values are
|
||||
/* Looks redundant even for GTK2 because these values are
|
||||
* overwritten by gtk_selection_data_set() that follows. */
|
||||
selection_data->type = selection_data->target;
|
||||
selection_data->format = 16; /* 16 bits per char */
|
||||
@@ -1597,7 +1597,7 @@ selection_get_cb(GtkWidget *widget UNUSED,
|
||||
if (string != NULL)
|
||||
{
|
||||
#if !GTK_CHECK_VERSION(3,0,0)
|
||||
/* Looks redandunt even for GTK2 because these values are
|
||||
/* Looks redundant even for GTK2 because these values are
|
||||
* overwritten by gtk_selection_data_set() that follows. */
|
||||
selection_data->type = selection_data->target;
|
||||
selection_data->format = 8; /* 8 bits per char */
|
||||
@@ -3921,7 +3921,7 @@ gui_mch_init(void)
|
||||
*/
|
||||
/* some aesthetics on the toolbar */
|
||||
# ifdef USE_GTK3
|
||||
/* TODO: Add GTK+ 3 code here using GtkCssProvider if neccessary. */
|
||||
/* TODO: Add GTK+ 3 code here using GtkCssProvider if necessary. */
|
||||
/* N.B. Since the default value of GtkToolbar::button-relief is
|
||||
* GTK_RELIEF_NONE, there's no need to specify that, probably. */
|
||||
# else
|
||||
@@ -4447,8 +4447,8 @@ mainwin_destroy_cb(GtkObject *object UNUSED, gpointer data UNUSED)
|
||||
* plug's window 'min hints to set *it's* minimum size, but that's also the
|
||||
* only way we have of making ourselves bigger (by set lines/columns).
|
||||
* Thus set hints at start-up to ensure correct init. size, then a
|
||||
* second after the final attempt to reset the real minimum hinst (done by
|
||||
* scrollbar init.), actually do the standard hinst and stop the timer.
|
||||
* second after the final attempt to reset the real minimum hints (done by
|
||||
* scrollbar init.), actually do the standard hints and stop the timer.
|
||||
* We'll not let the default hints be set while this timer's active.
|
||||
*/
|
||||
static gboolean
|
||||
@@ -6460,22 +6460,6 @@ input_timer_cb(gpointer data)
|
||||
return FALSE; /* don't happen again */
|
||||
}
|
||||
|
||||
#ifdef FEAT_SNIFF
|
||||
/*
|
||||
* Callback function, used when data is available on the SNiFF connection.
|
||||
*/
|
||||
static void
|
||||
sniff_request_cb(
|
||||
gpointer data UNUSED,
|
||||
gint source_fd UNUSED,
|
||||
GdkInputCondition condition UNUSED)
|
||||
{
|
||||
static char_u bytes[3] = {CSI, (int)KS_EXTRA, (int)KE_SNIFF};
|
||||
|
||||
add_to_input_buf(bytes, 3);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GUI input routine called by gui_wait_for_chars(). Waits for a character
|
||||
* from the keyboard.
|
||||
@@ -6491,26 +6475,6 @@ gui_mch_wait_for_chars(long wtime)
|
||||
int focus;
|
||||
guint timer;
|
||||
static int timed_out;
|
||||
#ifdef FEAT_SNIFF
|
||||
static int sniff_on = 0;
|
||||
static gint sniff_input_id = 0;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_SNIFF
|
||||
if (sniff_on && !want_sniff_request)
|
||||
{
|
||||
if (sniff_input_id)
|
||||
gdk_input_remove(sniff_input_id);
|
||||
sniff_on = 0;
|
||||
}
|
||||
else if (!sniff_on && want_sniff_request)
|
||||
{
|
||||
/* Add fd_from_sniff to watch for available data in main loop. */
|
||||
sniff_input_id = gdk_input_add(fd_from_sniff,
|
||||
GDK_INPUT_READ, sniff_request_cb, NULL);
|
||||
sniff_on = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
timed_out = FALSE;
|
||||
|
||||
@@ -7114,6 +7078,8 @@ gui_mch_mousehide(int hide)
|
||||
else
|
||||
#ifdef FEAT_MOUSESHAPE
|
||||
mch_set_mouse_shape(last_shape);
|
||||
#elif GTK_CHECK_VERSION(3,0,0)
|
||||
gdk_window_set_cursor(gtk_widget_get_window(gui.drawarea), NULL);
|
||||
#else
|
||||
gdk_window_set_cursor(gui.drawarea->window, NULL);
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -6513,7 +6513,7 @@ im_get_status(void)
|
||||
static MenuRef contextMenu = NULL;
|
||||
enum
|
||||
{
|
||||
kTabContextMenuId = 42,
|
||||
kTabContextMenuId = 42
|
||||
};
|
||||
|
||||
// the caller has to CFRelease() the returned string
|
||||
|
||||
+8
-19
@@ -326,7 +326,7 @@ static int s_findrep_is_find; /* TRUE for find dialog, FALSE
|
||||
#endif
|
||||
|
||||
static HINSTANCE s_hinst = NULL;
|
||||
#if !defined(FEAT_SNIFF) && !defined(FEAT_GUI)
|
||||
#if !defined(FEAT_GUI)
|
||||
static
|
||||
#endif
|
||||
HWND s_hwnd = NULL;
|
||||
@@ -1927,23 +1927,6 @@ process_message(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_SNIFF
|
||||
if (sniff_request_waiting && want_sniff_request)
|
||||
{
|
||||
static char_u bytes[3] = {CSI, (char_u)KS_EXTRA, (char_u)KE_SNIFF};
|
||||
add_to_input_buf(bytes, 3); /* K_SNIFF */
|
||||
sniff_request_waiting = 0;
|
||||
want_sniff_request = 0;
|
||||
/* request is handled in normal.c */
|
||||
}
|
||||
if (msg.message == WM_USER)
|
||||
{
|
||||
MyTranslateMessage(&msg);
|
||||
pDispatchMessage(&msg);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MSWIN_FIND_REPLACE
|
||||
/* Don't process messages used by the dialog */
|
||||
if (s_findrep_hwnd != NULL && pIsDialogMessage(s_findrep_hwnd, &msg))
|
||||
@@ -6658,7 +6641,13 @@ gui_mch_draw_string(
|
||||
/* Use unicodepdy to make characters fit as we expect, even
|
||||
* when the font uses different widths (e.g., bold character
|
||||
* is wider). */
|
||||
unicodepdy[clen] = cw * gui.char_width;
|
||||
if (c >= 0x10000)
|
||||
{
|
||||
unicodepdy[wlen - 2] = cw * gui.char_width;
|
||||
unicodepdy[wlen - 1] = 0;
|
||||
}
|
||||
else
|
||||
unicodepdy[wlen - 1] = cw * gui.char_width;
|
||||
}
|
||||
cells += cw;
|
||||
i += utfc_ptr2len_len(text + i, len - i);
|
||||
|
||||
@@ -145,9 +145,6 @@ static void gui_x11_focus_change_cb(Widget w, XtPointer data, XEvent *event, Boo
|
||||
static void gui_x11_enter_cb(Widget w, XtPointer data, XEvent *event, Boolean *dum);
|
||||
static void gui_x11_leave_cb(Widget w, XtPointer data, XEvent *event, Boolean *dum);
|
||||
static void gui_x11_mouse_cb(Widget w, XtPointer data, XEvent *event, Boolean *dum);
|
||||
#ifdef FEAT_SNIFF
|
||||
static void gui_x11_sniff_request_cb(XtPointer closure, int *source, XtInputId *id);
|
||||
#endif
|
||||
static void gui_x11_check_copy_area(void);
|
||||
#ifdef FEAT_CLIENTSERVER
|
||||
static void gui_x11_send_event_handler(Widget, XtPointer, XEvent *, Boolean *);
|
||||
@@ -1163,20 +1160,6 @@ gui_x11_mouse_cb(
|
||||
gui_send_mouse_event(button, x, y, repeated_click, vim_modifiers);
|
||||
}
|
||||
|
||||
#ifdef FEAT_SNIFF
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
gui_x11_sniff_request_cb(
|
||||
XtPointer closure UNUSED,
|
||||
int *source UNUSED,
|
||||
XtInputId *id UNUSED)
|
||||
{
|
||||
static char_u bytes[3] = {CSI, (int)KS_EXTRA, (int)KE_SNIFF};
|
||||
|
||||
add_to_input_buf(bytes, 3);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* End of call-back routines
|
||||
*/
|
||||
@@ -2818,28 +2801,9 @@ gui_mch_wait_for_chars(long wtime)
|
||||
static int timed_out;
|
||||
XtIntervalId timer = (XtIntervalId)0;
|
||||
XtInputMask desired;
|
||||
#ifdef FEAT_SNIFF
|
||||
static int sniff_on = 0;
|
||||
static XtInputId sniff_input_id = 0;
|
||||
#endif
|
||||
|
||||
timed_out = FALSE;
|
||||
|
||||
#ifdef FEAT_SNIFF
|
||||
if (sniff_on && !want_sniff_request)
|
||||
{
|
||||
if (sniff_input_id)
|
||||
XtRemoveInput(sniff_input_id);
|
||||
sniff_on = 0;
|
||||
}
|
||||
else if (!sniff_on && want_sniff_request)
|
||||
{
|
||||
sniff_input_id = XtAppAddInput(app_context, fd_from_sniff,
|
||||
(XtPointer)XtInputReadMask, gui_x11_sniff_request_cb, 0);
|
||||
sniff_on = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (wtime > 0)
|
||||
timer = XtAppAddTimeOut(app_context, (long_u)wtime, gui_x11_timer_cb,
|
||||
&timed_out);
|
||||
|
||||
+4
-9
@@ -11,16 +11,11 @@
|
||||
|
||||
#if defined(FEAT_CSCOPE) || defined(PROTO)
|
||||
|
||||
#if defined(UNIX)
|
||||
# include <sys/types.h> /* pid_t */
|
||||
# include <sys/stat.h> /* dev_t, ino_t */
|
||||
#else
|
||||
# if defined (WIN32)
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
#if defined (WIN32)
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#define CSCOPE_SUCCESS 0
|
||||
|
||||
+2
-1
@@ -96,7 +96,7 @@ static CVim *app = 0;
|
||||
class CVim : public IVim
|
||||
{
|
||||
public:
|
||||
~CVim();
|
||||
virtual ~CVim();
|
||||
static CVim *Create(int *pbDoRestart);
|
||||
|
||||
// IUnknown members
|
||||
@@ -432,6 +432,7 @@ class CVimCF : public IClassFactory
|
||||
{
|
||||
public:
|
||||
static CVimCF *Create();
|
||||
virtual ~CVimCF() {};
|
||||
|
||||
STDMETHOD(QueryInterface)(REFIID riid, void ** ppv);
|
||||
STDMETHOD_(unsigned long, AddRef)(void);
|
||||
|
||||
-1201
File diff suppressed because it is too large
Load Diff
@@ -1,16 +0,0 @@
|
||||
/*
|
||||
* if_sniff.h Interface between Vim and SNiFF+
|
||||
*/
|
||||
|
||||
#ifndef __if_sniff_h__
|
||||
#define __if_sniff_h__
|
||||
|
||||
extern int want_sniff_request;
|
||||
extern int sniff_request_waiting;
|
||||
extern int sniff_connected;
|
||||
extern int fd_from_sniff;
|
||||
extern void sniff_disconnect(int immediately);
|
||||
extern void ProcessSniffRequests(void);
|
||||
extern void ex_sniff(exarg_T *eap);
|
||||
|
||||
#endif
|
||||
+77
-25
@@ -12,27 +12,12 @@
|
||||
*
|
||||
* Follows this standard: https://tools.ietf.org/html/rfc7159.html
|
||||
*/
|
||||
#define USING_FLOAT_STUFF
|
||||
|
||||
#include "vim.h"
|
||||
|
||||
#if defined(FEAT_EVAL) || defined(PROTO)
|
||||
|
||||
#if defined(FEAT_FLOAT)
|
||||
# include <float.h>
|
||||
# if defined(HAVE_MATH_H)
|
||||
/* for isnan() and isinf() */
|
||||
# include <math.h>
|
||||
# endif
|
||||
# if defined(WIN32) && !defined(isnan)
|
||||
# define isnan(x) _isnan(x)
|
||||
# define isinf(x) (!_finite(x) && !_isnan(x))
|
||||
# endif
|
||||
# if defined(_MSC_VER) && !defined(INFINITY)
|
||||
# define INFINITY (DBL_MAX+DBL_MAX)
|
||||
# define NAN (INFINITY-INFINITY)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static int json_encode_item(garray_T *gap, typval_T *val, int copyID, int options);
|
||||
static int json_decode_item(js_read_T *reader, typval_T *res, int options);
|
||||
|
||||
@@ -95,10 +80,29 @@ write_string(garray_T *gap, char_u *str)
|
||||
ga_concat(gap, (char_u *)"null");
|
||||
else
|
||||
{
|
||||
#if defined(FEAT_MBYTE) && defined(USE_ICONV)
|
||||
vimconv_T conv;
|
||||
char_u *converted = NULL;
|
||||
|
||||
if (!enc_utf8)
|
||||
{
|
||||
conv.vc_type = CONV_NONE;
|
||||
convert_setup(&conv, p_enc, (char_u*)"utf-8");
|
||||
if (conv.vc_type != CONV_NONE)
|
||||
converted = res = string_convert(&conv, res, NULL);
|
||||
convert_setup(&conv, NULL, NULL);
|
||||
}
|
||||
#endif
|
||||
ga_append(gap, '"');
|
||||
while (*res != NUL)
|
||||
{
|
||||
int c = PTR2CHAR(res);
|
||||
int c;
|
||||
#ifdef FEAT_MBYTE
|
||||
/* always use utf-8 encoding, ignore 'encoding' */
|
||||
c = utf_ptr2char(res);
|
||||
#else
|
||||
c = *res;
|
||||
#endif
|
||||
|
||||
switch (c)
|
||||
{
|
||||
@@ -121,7 +125,7 @@ write_string(garray_T *gap, char_u *str)
|
||||
if (c >= 0x20)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
numbuf[mb_char2bytes(c, numbuf)] = NUL;
|
||||
numbuf[utf_char2bytes(c, numbuf)] = NUL;
|
||||
#else
|
||||
numbuf[0] = c;
|
||||
numbuf[1] = NUL;
|
||||
@@ -135,9 +139,16 @@ write_string(garray_T *gap, char_u *str)
|
||||
ga_concat(gap, numbuf);
|
||||
}
|
||||
}
|
||||
mb_cptr_adv(res);
|
||||
#ifdef FEAT_MBYTE
|
||||
res += utf_ptr2len(res);
|
||||
#else
|
||||
++res;
|
||||
#endif
|
||||
}
|
||||
ga_append(gap, '"');
|
||||
#if defined(FEAT_MBYTE) && defined(USE_ICONV)
|
||||
vim_free(converted);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,12 +296,10 @@ json_encode_item(garray_T *gap, typval_T *val, int copyID, int options)
|
||||
case VAR_FLOAT:
|
||||
#ifdef FEAT_FLOAT
|
||||
# if defined(HAVE_MATH_H)
|
||||
if ((options & JSON_JS) && isnan(val->vval.v_float))
|
||||
if (isnan(val->vval.v_float))
|
||||
ga_concat(gap, (char_u *)"NaN");
|
||||
else if ((options & JSON_JS) && isinf(val->vval.v_float))
|
||||
else if (isinf(val->vval.v_float))
|
||||
ga_concat(gap, (char_u *)"Infinity");
|
||||
else if (isnan(val->vval.v_float) || isinf(val->vval.v_float))
|
||||
ga_concat(gap, (char_u *)"null");
|
||||
else
|
||||
# endif
|
||||
{
|
||||
@@ -525,11 +534,25 @@ json_decode_string(js_read_T *reader, typval_T *res)
|
||||
int c;
|
||||
long nr;
|
||||
char_u buf[NUMBUFLEN];
|
||||
#if defined(FEAT_MBYTE) && defined(USE_ICONV)
|
||||
vimconv_T conv;
|
||||
char_u *converted = NULL;
|
||||
#endif
|
||||
|
||||
if (res != NULL)
|
||||
ga_init2(&ga, 1, 200);
|
||||
|
||||
p = reader->js_buf + reader->js_used + 1; /* skip over " */
|
||||
#if defined(FEAT_MBYTE) && defined(USE_ICONV)
|
||||
if (!enc_utf8)
|
||||
{
|
||||
conv.vc_type = CONV_NONE;
|
||||
convert_setup(&conv, (char_u*)"utf-8", p_enc);
|
||||
if (conv.vc_type != CONV_NONE)
|
||||
converted = p = string_convert(&conv, p, NULL);
|
||||
convert_setup(&conv, NULL, NULL);
|
||||
}
|
||||
#endif
|
||||
while (*p != '"')
|
||||
{
|
||||
if (*p == NUL || p[1] == NUL
|
||||
@@ -573,13 +596,32 @@ json_decode_string(js_read_T *reader, typval_T *res)
|
||||
+ STRLEN(reader->js_buf);
|
||||
}
|
||||
}
|
||||
nr = 0;
|
||||
len = 0;
|
||||
vim_str2nr(p + 2, NULL, &len,
|
||||
STR2NR_HEX + STR2NR_FORCE, &nr, NULL, 4);
|
||||
p += len + 2;
|
||||
if (0xd800 <= nr && nr <= 0xdfff
|
||||
&& (int)(reader->js_end - p) >= 6
|
||||
&& *p == '\\' && *(p+1) == 'u')
|
||||
{
|
||||
long nr2 = 0;
|
||||
|
||||
/* decode surrogate pair: \ud812\u3456 */
|
||||
len = 0;
|
||||
vim_str2nr(p + 2, NULL, &len,
|
||||
STR2NR_HEX + STR2NR_FORCE, &nr2, NULL, 4);
|
||||
if (0xdc00 <= nr2 && nr2 <= 0xdfff)
|
||||
{
|
||||
p += len + 2;
|
||||
nr = (((nr - 0xd800) << 10) |
|
||||
((nr2 - 0xdc00) & 0x3ff)) + 0x10000;
|
||||
}
|
||||
}
|
||||
if (res != NULL)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
buf[(*mb_char2bytes)((int)nr, buf)] = NUL;
|
||||
buf[utf_char2bytes((int)nr, buf)] = NUL;
|
||||
ga_concat(&ga, buf);
|
||||
#else
|
||||
ga_append(&ga, nr);
|
||||
@@ -600,12 +642,19 @@ json_decode_string(js_read_T *reader, typval_T *res)
|
||||
}
|
||||
else
|
||||
{
|
||||
len = MB_PTR2LEN(p);
|
||||
#ifdef FEAT_MBYTE
|
||||
len = utf_ptr2len(p);
|
||||
#else
|
||||
len = 1;
|
||||
#endif
|
||||
if (res != NULL)
|
||||
{
|
||||
if (ga_grow(&ga, len) == FAIL)
|
||||
{
|
||||
ga_clear(&ga);
|
||||
#if defined(FEAT_MBYTE) && defined(USE_ICONV)
|
||||
vim_free(converted);
|
||||
#endif
|
||||
return FAIL;
|
||||
}
|
||||
mch_memmove((char *)ga.ga_data + ga.ga_len, p, (size_t)len);
|
||||
@@ -614,6 +663,9 @@ json_decode_string(js_read_T *reader, typval_T *res)
|
||||
p += len;
|
||||
}
|
||||
}
|
||||
#if defined(FEAT_MBYTE) && defined(USE_ICONV)
|
||||
vim_free(converted);
|
||||
#endif
|
||||
|
||||
reader->js_used = (int)(p - reader->js_buf);
|
||||
if (*p == '"')
|
||||
|
||||
@@ -211,8 +211,6 @@ enum key_extra
|
||||
, KE_TAB /* unshifted TAB key */
|
||||
, KE_S_TAB_OLD /* shifted TAB key (no longer used) */
|
||||
|
||||
, KE_SNIFF /* SNiFF+ input waiting */
|
||||
|
||||
, KE_XF1 /* extra vt100 function keys for xterm */
|
||||
, KE_XF2
|
||||
, KE_XF3
|
||||
@@ -456,8 +454,6 @@ enum key_extra
|
||||
#define K_IGNORE TERMCAP2KEY(KS_EXTRA, KE_IGNORE)
|
||||
#define K_NOP TERMCAP2KEY(KS_EXTRA, KE_NOP)
|
||||
|
||||
#define K_SNIFF TERMCAP2KEY(KS_EXTRA, KE_SNIFF)
|
||||
|
||||
#define K_MOUSEDOWN TERMCAP2KEY(KS_EXTRA, KE_MOUSEDOWN)
|
||||
#define K_MOUSEUP TERMCAP2KEY(KS_EXTRA, KE_MOUSEUP)
|
||||
#define K_MOUSELEFT TERMCAP2KEY(KS_EXTRA, KE_MOUSELEFT)
|
||||
|
||||
@@ -320,3 +320,36 @@
|
||||
#if defined(FEAT_CHANNEL) || defined(FEAT_JOB) || defined(FEAT_CLIENTSERVER)
|
||||
# define MESSAGE_QUEUE
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_EVAL) && defined(FEAT_FLOAT)
|
||||
# include <float.h>
|
||||
# if defined(HAVE_MATH_H)
|
||||
/* for isnan() and isinf() */
|
||||
# include <math.h>
|
||||
# endif
|
||||
# ifdef USING_FLOAT_STUFF
|
||||
# if defined(WIN32)
|
||||
# ifndef isnan
|
||||
# define isnan(x) _isnan(x)
|
||||
# define isinf(x) (!_finite(x) && !_isnan(x))
|
||||
# endif
|
||||
# else
|
||||
# ifndef HAVE_ISNAN
|
||||
static inline int isnan(double x) { return x != x; }
|
||||
# endif
|
||||
# ifndef HAVE_ISINF
|
||||
static inline int isinf(double x) { return !isnan(x) && isnan(x - x); }
|
||||
# endif
|
||||
# endif
|
||||
# if !defined(INFINITY)
|
||||
# if defined(DBL_MAX)
|
||||
# define INFINITY (DBL_MAX+DBL_MAX)
|
||||
# else
|
||||
# define INFINITY (1.0 / 0.0)
|
||||
# endif
|
||||
# endif
|
||||
# if !defined(NAN)
|
||||
# define NAN (INFINITY-INFINITY)
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -15,10 +15,6 @@
|
||||
|
||||
#include "vim.h"
|
||||
|
||||
#if defined(FEAT_FLOAT) && defined(HAVE_MATH_H)
|
||||
# include <math.h>
|
||||
#endif
|
||||
|
||||
static int other_sourcing_name(void);
|
||||
static char_u *get_emsg_source(void);
|
||||
static char_u *get_emsg_lnum(void);
|
||||
|
||||
@@ -99,8 +99,11 @@ netbeans_close(void)
|
||||
{
|
||||
netbeans_send_disconnect();
|
||||
if (nb_channel != NULL)
|
||||
{
|
||||
/* Close the socket and remove the input handlers. */
|
||||
channel_close(nb_channel, TRUE);
|
||||
channel_clear(nb_channel);
|
||||
}
|
||||
nb_channel = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -163,9 +163,6 @@ static void nv_halfpage(cmdarg_T *cap);
|
||||
static void nv_join(cmdarg_T *cap);
|
||||
static void nv_put(cmdarg_T *cap);
|
||||
static void nv_open(cmdarg_T *cap);
|
||||
#ifdef FEAT_SNIFF
|
||||
static void nv_sniff(cmdarg_T *cap);
|
||||
#endif
|
||||
#ifdef FEAT_NETBEANS_INTG
|
||||
static void nv_nbcmd(cmdarg_T *cap);
|
||||
#endif
|
||||
@@ -420,9 +417,6 @@ static const struct nv_cmd
|
||||
{K_F8, farsi_fkey, 0, 0},
|
||||
{K_F9, farsi_fkey, 0, 0},
|
||||
#endif
|
||||
#ifdef FEAT_SNIFF
|
||||
{K_SNIFF, nv_sniff, 0, 0},
|
||||
#endif
|
||||
#ifdef FEAT_NETBEANS_INTG
|
||||
{K_F21, nv_nbcmd, NV_NCH_ALW, 0},
|
||||
#endif
|
||||
@@ -570,10 +564,6 @@ normal_cmd(
|
||||
* remembered in "opcount". */
|
||||
ca.opcount = opcount;
|
||||
|
||||
#ifdef FEAT_SNIFF
|
||||
want_sniff_request = sniff_connected;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If there is an operator pending, then the command we take this time
|
||||
* will terminate it. Finish_op tells us to finish the operation before
|
||||
@@ -9422,14 +9412,6 @@ nv_open(cmdarg_T *cap)
|
||||
n_opencmd(cap);
|
||||
}
|
||||
|
||||
#ifdef FEAT_SNIFF
|
||||
static void
|
||||
nv_sniff(cmdarg_T *cap UNUSED)
|
||||
{
|
||||
ProcessSniffRequests();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_NETBEANS_INTG
|
||||
static void
|
||||
nv_nbcmd(cmdarg_T *cap)
|
||||
|
||||
@@ -5362,7 +5362,6 @@ WaitForChar(long msec)
|
||||
* "msec" == 0 will check for characters once.
|
||||
* "msec" == -1 will block until a character is available.
|
||||
* When a GUI is being used, this will not be used for input -- webb
|
||||
* Returns also, when a request from Sniff is waiting -- toni.
|
||||
* Or when a Linux GPM mouse event is waiting.
|
||||
* Or when a clientserver message is on the queue.
|
||||
*/
|
||||
@@ -5449,15 +5448,6 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED)
|
||||
fds[0].events = POLLIN;
|
||||
nfd = 1;
|
||||
|
||||
# ifdef FEAT_SNIFF
|
||||
# define SNIFF_IDX 1
|
||||
if (want_sniff_request)
|
||||
{
|
||||
fds[SNIFF_IDX].fd = fd_from_sniff;
|
||||
fds[SNIFF_IDX].events = POLLIN;
|
||||
nfd++;
|
||||
}
|
||||
# endif
|
||||
# ifdef FEAT_XCLIPBOARD
|
||||
may_restore_clipboard();
|
||||
if (xterm_Shell != (Widget)0)
|
||||
@@ -5500,17 +5490,6 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED)
|
||||
finished = FALSE;
|
||||
# endif
|
||||
|
||||
# ifdef FEAT_SNIFF
|
||||
if (ret < 0)
|
||||
sniff_disconnect(1);
|
||||
else if (want_sniff_request)
|
||||
{
|
||||
if (fds[SNIFF_IDX].revents & POLLHUP)
|
||||
sniff_disconnect(1);
|
||||
if (fds[SNIFF_IDX].revents & POLLIN)
|
||||
sniff_request_waiting = 1;
|
||||
}
|
||||
# endif
|
||||
# ifdef FEAT_XCLIPBOARD
|
||||
if (xterm_Shell != (Widget)0 && (fds[xterm_idx].revents & POLLIN))
|
||||
{
|
||||
@@ -5596,15 +5575,6 @@ select_eintr:
|
||||
# endif
|
||||
maxfd = fd;
|
||||
|
||||
# ifdef FEAT_SNIFF
|
||||
if (want_sniff_request)
|
||||
{
|
||||
FD_SET(fd_from_sniff, &rfds);
|
||||
FD_SET(fd_from_sniff, &efds);
|
||||
if (maxfd < fd_from_sniff)
|
||||
maxfd = fd_from_sniff;
|
||||
}
|
||||
# endif
|
||||
# ifdef FEAT_XCLIPBOARD
|
||||
may_restore_clipboard();
|
||||
if (xterm_Shell != (Widget)0)
|
||||
@@ -5674,17 +5644,6 @@ select_eintr:
|
||||
finished = FALSE;
|
||||
# endif
|
||||
|
||||
# ifdef FEAT_SNIFF
|
||||
if (ret < 0 )
|
||||
sniff_disconnect(1);
|
||||
else if (ret > 0 && want_sniff_request)
|
||||
{
|
||||
if (FD_ISSET(fd_from_sniff, &efds))
|
||||
sniff_disconnect(1);
|
||||
if (FD_ISSET(fd_from_sniff, &rfds))
|
||||
sniff_request_waiting = 1;
|
||||
}
|
||||
# endif
|
||||
# ifdef FEAT_XCLIPBOARD
|
||||
if (ret > 0 && xterm_Shell != (Widget)0
|
||||
&& FD_ISSET(ConnectionNumber(xterm_dpy), &rfds))
|
||||
|
||||
@@ -1683,27 +1683,6 @@ mch_inchar(
|
||||
if (typeaheadlen > 0)
|
||||
goto theend;
|
||||
|
||||
#ifdef FEAT_SNIFF
|
||||
if (want_sniff_request)
|
||||
{
|
||||
if (sniff_request_waiting)
|
||||
{
|
||||
/* return K_SNIFF */
|
||||
typeahead[typeaheadlen++] = CSI;
|
||||
typeahead[typeaheadlen++] = (char_u)KS_EXTRA;
|
||||
typeahead[typeaheadlen++] = (char_u)KE_SNIFF;
|
||||
sniff_request_waiting = 0;
|
||||
want_sniff_request = 0;
|
||||
goto theend;
|
||||
}
|
||||
else if (time < 0 || time > 250)
|
||||
{
|
||||
/* don't wait too long, a request might be pending */
|
||||
time = 250;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (time >= 0)
|
||||
{
|
||||
if (!WaitForChar(time)) /* no character available */
|
||||
|
||||
+20
-4
@@ -1350,6 +1350,7 @@ typedef struct {
|
||||
|
||||
cbq_T ch_cb_head; /* dummy node for per-request callbacks */
|
||||
char_u *ch_callback; /* call when a msg is not handled */
|
||||
buf_T *ch_buffer; /* buffer to read from or write to */
|
||||
} chanpart_T;
|
||||
|
||||
struct channel_S {
|
||||
@@ -1398,6 +1399,12 @@ struct channel_S {
|
||||
#define JO_ID 0x2000 /* "id" */
|
||||
#define JO_STOPONEXIT 0x4000 /* "stoponexit" */
|
||||
#define JO_EXIT_CB 0x8000 /* "exit-cb" */
|
||||
#define JO_OUT_IO 0x10000 /* "out-io" */
|
||||
#define JO_ERR_IO 0x20000 /* "err-io" (JO_OUT_IO << 1) */
|
||||
#define JO_IN_IO 0x40000 /* "in-io" (JO_OUT_IO << 2) */
|
||||
#define JO_OUT_NAME 0x80000 /* "out-name" */
|
||||
#define JO_ERR_NAME 0x100000 /* "err-name" (JO_OUT_NAME << 1) */
|
||||
#define JO_IN_NAME 0x200000 /* "in-name" (JO_OUT_NAME << 2) */
|
||||
#define JO_ALL 0xffffff
|
||||
|
||||
#define JO_MODE_ALL (JO_MODE + JO_IN_MODE + JO_OUT_MODE + JO_ERR_MODE)
|
||||
@@ -1405,6 +1412,14 @@ struct channel_S {
|
||||
(JO_CALLBACK + JO_OUT_CALLBACK + JO_ERR_CALLBACK + JO_CLOSE_CALLBACK)
|
||||
#define JO_TIMEOUT_ALL (JO_TIMEOUT + JO_OUT_TIMEOUT + JO_ERR_TIMEOUT)
|
||||
|
||||
typedef enum {
|
||||
JIO_NULL,
|
||||
JIO_PIPE,
|
||||
JIO_FILE,
|
||||
JIO_BUFFER,
|
||||
JIO_OUT
|
||||
} job_io_T;
|
||||
|
||||
/*
|
||||
* Options for job and channel commands.
|
||||
*/
|
||||
@@ -1416,6 +1431,11 @@ typedef struct
|
||||
ch_mode_T jo_in_mode;
|
||||
ch_mode_T jo_out_mode;
|
||||
ch_mode_T jo_err_mode;
|
||||
|
||||
job_io_T jo_io[4]; /* PART_OUT, PART_ERR, PART_IN */
|
||||
char_u jo_io_name_buf[4][NUMBUFLEN];
|
||||
char_u *jo_io_name[4]; /* not allocated! */
|
||||
|
||||
char_u *jo_callback; /* not allocated! */
|
||||
char_u *jo_out_cb; /* not allocated! */
|
||||
char_u *jo_err_cb; /* not allocated! */
|
||||
@@ -1622,10 +1642,6 @@ struct file_buffer
|
||||
char b_fab_rat; /* Record attribute */
|
||||
unsigned int b_fab_mrs; /* Max record size */
|
||||
#endif
|
||||
#ifdef FEAT_SNIFF
|
||||
int b_sniff; /* file was loaded through Sniff */
|
||||
#endif
|
||||
|
||||
int b_fnum; /* buffer number for this file. */
|
||||
|
||||
int b_changed; /* 'modified': Set to TRUE if something in the
|
||||
|
||||
-10
@@ -1796,16 +1796,6 @@ set_termname(char_u *term)
|
||||
# endif
|
||||
#endif /* FEAT_MOUSE */
|
||||
|
||||
#ifdef FEAT_SNIFF
|
||||
{
|
||||
char_u name[2];
|
||||
|
||||
name[0] = (int)KS_EXTRA;
|
||||
name[1] = (int)KE_SNIFF;
|
||||
add_termcode(name, (char_u *)"\233sniff", FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_TERM_CONSOLE
|
||||
/* DEFAULT_TERM indicates that it is the machine console. */
|
||||
if (STRCMP(term, DEFAULT_TERM) != 0)
|
||||
|
||||
@@ -110,17 +110,17 @@ func s:communicate(port)
|
||||
endif
|
||||
|
||||
" Simple string request and reply.
|
||||
call assert_equal('got it', ch_sendexpr(handle, 'hello!'))
|
||||
call assert_equal('got it', ch_evalexpr(handle, 'hello!'))
|
||||
|
||||
" Request that triggers sending two ex commands. These will usually be
|
||||
" handled before getting the response, but it's not guaranteed, thus wait a
|
||||
" tiny bit for the commands to get executed.
|
||||
call assert_equal('ok', ch_sendexpr(handle, 'make change'))
|
||||
call assert_equal('ok', ch_evalexpr(handle, 'make change'))
|
||||
sleep 10m
|
||||
call assert_equal('added1', getline(line('$') - 1))
|
||||
call assert_equal('added2', getline('$'))
|
||||
|
||||
call assert_equal('ok', ch_sendexpr(handle, 'do normal'))
|
||||
call assert_equal('ok', ch_evalexpr(handle, 'do normal'))
|
||||
sleep 10m
|
||||
call assert_equal('added more', getline('$'))
|
||||
|
||||
@@ -154,37 +154,37 @@ func s:communicate(port)
|
||||
call ch_setoptions(handle, {'callback': ''})
|
||||
|
||||
" Send an eval request that works.
|
||||
call assert_equal('ok', ch_sendexpr(handle, 'eval-works'))
|
||||
call assert_equal('ok', ch_evalexpr(handle, 'eval-works'))
|
||||
sleep 10m
|
||||
call assert_equal([-1, 'foo123'], ch_sendexpr(handle, 'eval-result'))
|
||||
call assert_equal([-1, 'foo123'], ch_evalexpr(handle, 'eval-result'))
|
||||
|
||||
" Send an eval request that fails.
|
||||
call assert_equal('ok', ch_sendexpr(handle, 'eval-fails'))
|
||||
call assert_equal('ok', ch_evalexpr(handle, 'eval-fails'))
|
||||
sleep 10m
|
||||
call assert_equal([-2, 'ERROR'], ch_sendexpr(handle, 'eval-result'))
|
||||
call assert_equal([-2, 'ERROR'], ch_evalexpr(handle, 'eval-result'))
|
||||
|
||||
" Send an eval request that works but can't be encoded.
|
||||
call assert_equal('ok', ch_sendexpr(handle, 'eval-error'))
|
||||
call assert_equal('ok', ch_evalexpr(handle, 'eval-error'))
|
||||
sleep 10m
|
||||
call assert_equal([-3, 'ERROR'], ch_sendexpr(handle, 'eval-result'))
|
||||
call assert_equal([-3, 'ERROR'], ch_evalexpr(handle, 'eval-result'))
|
||||
|
||||
" Send a bad eval request. There will be no response.
|
||||
call assert_equal('ok', ch_sendexpr(handle, 'eval-bad'))
|
||||
call assert_equal('ok', ch_evalexpr(handle, 'eval-bad'))
|
||||
sleep 10m
|
||||
call assert_equal([-3, 'ERROR'], ch_sendexpr(handle, 'eval-result'))
|
||||
call assert_equal([-3, 'ERROR'], ch_evalexpr(handle, 'eval-result'))
|
||||
|
||||
" Send an expr request
|
||||
call assert_equal('ok', ch_sendexpr(handle, 'an expr'))
|
||||
call assert_equal('ok', ch_evalexpr(handle, 'an expr'))
|
||||
sleep 10m
|
||||
call assert_equal('one', getline(line('$') - 2))
|
||||
call assert_equal('two', getline(line('$') - 1))
|
||||
call assert_equal('three', getline('$'))
|
||||
|
||||
" Request a redraw, we don't check for the effect.
|
||||
call assert_equal('ok', ch_sendexpr(handle, 'redraw'))
|
||||
call assert_equal('ok', ch_sendexpr(handle, 'redraw!'))
|
||||
call assert_equal('ok', ch_evalexpr(handle, 'redraw'))
|
||||
call assert_equal('ok', ch_evalexpr(handle, 'redraw!'))
|
||||
|
||||
call assert_equal('ok', ch_sendexpr(handle, 'empty-request'))
|
||||
call assert_equal('ok', ch_evalexpr(handle, 'empty-request'))
|
||||
|
||||
" Reading while there is nothing available.
|
||||
call assert_equal(v:none, ch_read(handle, {'timeout': 0}))
|
||||
@@ -195,14 +195,14 @@ func s:communicate(port)
|
||||
call assert_true(reltimefloat(elapsed) < 0.6)
|
||||
|
||||
" Send without waiting for a response, then wait for a response.
|
||||
call ch_sendexpr(handle, 'wait a bit', {'callback': 0})
|
||||
call ch_sendexpr(handle, 'wait a bit')
|
||||
let resp = ch_read(handle)
|
||||
call assert_equal(type([]), type(resp))
|
||||
call assert_equal(type(11), type(resp[0]))
|
||||
call assert_equal('waited', resp[1])
|
||||
|
||||
" make the server quit, can't check if this works, should not hang.
|
||||
call ch_sendexpr(handle, '!quit!', {'callback': 0})
|
||||
call ch_sendexpr(handle, '!quit!')
|
||||
endfunc
|
||||
|
||||
func Test_communicate()
|
||||
@@ -218,18 +218,18 @@ func s:two_channels(port)
|
||||
return
|
||||
endif
|
||||
|
||||
call assert_equal('got it', ch_sendexpr(handle, 'hello!'))
|
||||
call assert_equal('got it', ch_evalexpr(handle, 'hello!'))
|
||||
|
||||
let newhandle = ch_open('localhost:' . a:port, s:chopt)
|
||||
if ch_status(newhandle) == "fail"
|
||||
call assert_false(1, "Can't open second channel")
|
||||
return
|
||||
endif
|
||||
call assert_equal('got it', ch_sendexpr(newhandle, 'hello!'))
|
||||
call assert_equal('got it', ch_sendexpr(handle, 'hello!'))
|
||||
call assert_equal('got it', ch_evalexpr(newhandle, 'hello!'))
|
||||
call assert_equal('got it', ch_evalexpr(handle, 'hello!'))
|
||||
|
||||
call ch_close(handle)
|
||||
call assert_equal('got it', ch_sendexpr(newhandle, 'hello!'))
|
||||
call assert_equal('got it', ch_evalexpr(newhandle, 'hello!'))
|
||||
|
||||
call ch_close(newhandle)
|
||||
endfunc
|
||||
@@ -247,7 +247,7 @@ func s:server_crash(port)
|
||||
return
|
||||
endif
|
||||
|
||||
call ch_sendexpr(handle, '!crash!')
|
||||
call ch_evalexpr(handle, '!crash!')
|
||||
|
||||
sleep 10m
|
||||
endfunc
|
||||
@@ -271,12 +271,12 @@ func s:channel_handler(port)
|
||||
endif
|
||||
|
||||
" Test that it works while waiting on a numbered message.
|
||||
call assert_equal('ok', ch_sendexpr(handle, 'call me'))
|
||||
call assert_equal('ok', ch_evalexpr(handle, 'call me'))
|
||||
sleep 10m
|
||||
call assert_equal('we called you', s:reply)
|
||||
|
||||
" Test that it works while not waiting on a numbered message.
|
||||
call ch_sendexpr(handle, 'call me again', {'callback': 0})
|
||||
call ch_sendexpr(handle, 'call me again')
|
||||
sleep 10m
|
||||
call assert_equal('we did call you', s:reply)
|
||||
endfunc
|
||||
@@ -334,15 +334,15 @@ func Test_raw_pipe()
|
||||
call assert_equal("run", job_status(job))
|
||||
try
|
||||
let handle = job_getchannel(job)
|
||||
call ch_sendraw(handle, "echo something\n", {'callback': 0})
|
||||
call ch_sendraw(handle, "echo something\n")
|
||||
let msg = ch_readraw(handle)
|
||||
call assert_equal("something\n", substitute(msg, "\r", "", 'g'))
|
||||
|
||||
call ch_sendraw(handle, "double this\n", {'callback': 0})
|
||||
call ch_sendraw(handle, "double this\n")
|
||||
let msg = ch_readraw(handle)
|
||||
call assert_equal("this\nAND this\n", substitute(msg, "\r", "", 'g'))
|
||||
|
||||
let reply = ch_sendraw(handle, "quit\n")
|
||||
let reply = ch_evalraw(handle, "quit\n")
|
||||
call assert_equal("Goodbye!\n", substitute(reply, "\r", "", 'g'))
|
||||
finally
|
||||
call job_stop(job)
|
||||
@@ -358,20 +358,74 @@ func Test_nl_pipe()
|
||||
call assert_equal("run", job_status(job))
|
||||
try
|
||||
let handle = job_getchannel(job)
|
||||
call ch_sendraw(handle, "echo something\n", {'callback': 0})
|
||||
call ch_sendraw(handle, "echo something\n")
|
||||
call assert_equal("something", ch_readraw(handle))
|
||||
|
||||
call ch_sendraw(handle, "double this\n", {'callback': 0})
|
||||
call ch_sendraw(handle, "double this\n")
|
||||
call assert_equal("this", ch_readraw(handle))
|
||||
call assert_equal("AND this", ch_readraw(handle))
|
||||
|
||||
let reply = ch_sendraw(handle, "quit\n")
|
||||
let reply = ch_evalraw(handle, "quit\n")
|
||||
call assert_equal("Goodbye!", reply)
|
||||
finally
|
||||
call job_stop(job)
|
||||
endtry
|
||||
endfunc
|
||||
|
||||
func Test_pipe_to_buffer()
|
||||
if !has('job')
|
||||
return
|
||||
endif
|
||||
call ch_log('Test_pipe_to_buffer()')
|
||||
let job = job_start(s:python . " test_channel_pipe.py",
|
||||
\ {'out-io': 'buffer', 'out-name': 'pipe-output'})
|
||||
call assert_equal("run", job_status(job))
|
||||
try
|
||||
let handle = job_getchannel(job)
|
||||
call ch_sendraw(handle, "echo line one\n")
|
||||
call ch_sendraw(handle, "echo line two\n")
|
||||
call ch_sendraw(handle, "double this\n")
|
||||
call ch_sendraw(handle, "quit\n")
|
||||
sp pipe-output
|
||||
for i in range(100)
|
||||
sleep 10m
|
||||
if line('$') >= 6
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
call assert_equal(['Reading from channel output...', 'line one', 'line two', 'this', 'AND this', 'Goodbye!'], getline(1, '$'))
|
||||
bwipe!
|
||||
finally
|
||||
call job_stop(job)
|
||||
endtry
|
||||
endfunc
|
||||
|
||||
func Test_pipe_to_nameless_buffer()
|
||||
if !has('job')
|
||||
return
|
||||
endif
|
||||
call ch_log('Test_pipe_to_nameless_buffer()')
|
||||
let job = job_start(s:python . " test_channel_pipe.py",
|
||||
\ {'out-io': 'buffer'})
|
||||
call assert_equal("run", job_status(job))
|
||||
try
|
||||
let handle = job_getchannel(job)
|
||||
call ch_sendraw(handle, "echo line one\n")
|
||||
call ch_sendraw(handle, "echo line two\n")
|
||||
exe ch_getbufnr(handle, "out") . 'sbuf'
|
||||
for i in range(100)
|
||||
sleep 10m
|
||||
if line('$') >= 3
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
call assert_equal(['Reading from channel output...', 'line one', 'line two'], getline(1, '$'))
|
||||
bwipe!
|
||||
finally
|
||||
call job_stop(job)
|
||||
endtry
|
||||
endfunc
|
||||
|
||||
""""""""""
|
||||
|
||||
let s:unletResponse = ''
|
||||
@@ -434,7 +488,7 @@ func s:open_delay(port)
|
||||
call assert_false(1, "Can't open channel")
|
||||
return
|
||||
endif
|
||||
call assert_equal('got it', ch_sendexpr(channel, 'hello!'))
|
||||
call assert_equal('got it', ch_evalexpr(channel, 'hello!'))
|
||||
call ch_close(channel)
|
||||
endfunc
|
||||
|
||||
@@ -457,7 +511,7 @@ function s:test_call(port)
|
||||
return
|
||||
endif
|
||||
|
||||
call assert_equal('ok', ch_sendexpr(handle, 'call-func'))
|
||||
call assert_equal('ok', ch_evalexpr(handle, 'call-func'))
|
||||
sleep 20m
|
||||
call assert_equal([1, 2, 3], s:call_ret)
|
||||
endfunc
|
||||
@@ -507,7 +561,7 @@ function s:test_close_callback(port)
|
||||
endif
|
||||
call ch_setoptions(handle, {'close-cb': 'MyCloseCb'})
|
||||
|
||||
call assert_equal('', ch_sendexpr(handle, 'close me'))
|
||||
call assert_equal('', ch_evalexpr(handle, 'close me'))
|
||||
sleep 20m
|
||||
call assert_equal('closed', s:ch_close_ret)
|
||||
endfunc
|
||||
|
||||
@@ -12,6 +12,12 @@ let s:var4 = "\x10\x11\x12\x13\x14\x15\x16\x17"
|
||||
let s:json5 = '"\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f"'
|
||||
let s:var5 = "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
|
||||
|
||||
" surrogate pair
|
||||
let s:jsonsp1 = '"\ud83c\udf63"'
|
||||
let s:varsp1 = "\xf0\x9f\x8d\xa3"
|
||||
let s:jsonsp2 = '"\ud83c\u00a0"'
|
||||
let s:varsp2 = "\ud83c\u00a0"
|
||||
|
||||
let s:jsonmb = '"s¢cĴgё"'
|
||||
let s:varmb = "s¢cĴgё"
|
||||
let s:jsonnr = '1234'
|
||||
@@ -19,11 +25,9 @@ let s:varnr = 1234
|
||||
if has('float')
|
||||
let s:jsonfl = '12.34'
|
||||
let s:varfl = 12.34
|
||||
let s:jsoninf = 'null'
|
||||
let s:jsinf = 'Infinity'
|
||||
let s:jsoninf = 'Infinity'
|
||||
let s:varinf = 1.0 / 0.0
|
||||
let s:jsonnan = 'null'
|
||||
let s:jsnan = 'NaN'
|
||||
let s:jsonnan = 'NaN'
|
||||
let s:varnan = 0.0 / 0.0
|
||||
endif
|
||||
|
||||
@@ -71,6 +75,8 @@ func Test_json_encode()
|
||||
|
||||
if has('multi_byte')
|
||||
call assert_equal(s:jsonmb, json_encode(s:varmb))
|
||||
call assert_equal(s:varsp1, json_decode(s:jsonsp1))
|
||||
call assert_equal(s:varsp2, json_decode(s:jsonsp2))
|
||||
endif
|
||||
|
||||
call assert_equal(s:jsonnr, json_encode(s:varnr))
|
||||
@@ -107,6 +113,8 @@ func Test_json_decode()
|
||||
|
||||
if has('multi_byte')
|
||||
call assert_equal(s:varmb, json_decode(s:jsonmb))
|
||||
call assert_equal(s:varsp1, js_decode(s:jsonsp1))
|
||||
call assert_equal(s:varsp2, js_decode(s:jsonsp2))
|
||||
endif
|
||||
|
||||
call assert_equal(s:varnr, json_decode(s:jsonnr))
|
||||
@@ -175,8 +183,8 @@ func Test_js_encode()
|
||||
call assert_equal(s:jsonnr, js_encode(s:varnr))
|
||||
if has('float')
|
||||
call assert_equal(s:jsonfl, js_encode(s:varfl))
|
||||
call assert_equal(s:jsinf, js_encode(s:varinf))
|
||||
call assert_equal(s:jsnan, js_encode(s:varnan))
|
||||
call assert_equal(s:jsoninf, js_encode(s:varinf))
|
||||
call assert_equal(s:jsonnan, js_encode(s:varnan))
|
||||
endif
|
||||
|
||||
call assert_equal(s:jsonl1, js_encode(s:varl1))
|
||||
@@ -213,8 +221,8 @@ func Test_js_decode()
|
||||
call assert_equal(s:varnr, js_decode(s:jsonnr))
|
||||
if has('float')
|
||||
call assert_equal(s:varfl, js_decode(s:jsonfl))
|
||||
call assert_equal(s:varinf, js_decode(s:jsinf))
|
||||
call assert_true(isnan(js_decode(s:jsnan)))
|
||||
call assert_equal(s:varinf, js_decode(s:jsoninf))
|
||||
call assert_true(isnan(js_decode(s:jsonnan)))
|
||||
endif
|
||||
|
||||
call assert_equal(s:varl1, js_decode(s:jsonl1))
|
||||
|
||||
@@ -1647,7 +1647,7 @@ set_input_buf(char_u *p)
|
||||
#if defined(FEAT_GUI) \
|
||||
|| defined(FEAT_MOUSE_GPM) || defined(FEAT_SYSMOUSE) \
|
||||
|| defined(FEAT_XCLIPBOARD) || defined(VMS) \
|
||||
|| defined(FEAT_SNIFF) || defined(FEAT_CLIENTSERVER) \
|
||||
|| defined(FEAT_CLIENTSERVER) \
|
||||
|| defined(PROTO)
|
||||
/*
|
||||
* Add the given bytes to the input buffer
|
||||
@@ -1792,17 +1792,7 @@ fill_input_buf(int exit_on_error UNUSED)
|
||||
inbufcount = 0;
|
||||
# else
|
||||
|
||||
# ifdef FEAT_SNIFF
|
||||
if (sniff_request_waiting)
|
||||
{
|
||||
add_to_input_buf((char_u *)"\233sniff",6); /* results in K_SNIFF */
|
||||
sniff_request_waiting = 0;
|
||||
want_sniff_request = 0;
|
||||
return;
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef FEAT_MBYTE
|
||||
# ifdef FEAT_MBYTE
|
||||
if (rest != NULL)
|
||||
{
|
||||
/* Use remainder of previous call, starts with an invalid character
|
||||
@@ -1826,7 +1816,7 @@ fill_input_buf(int exit_on_error UNUSED)
|
||||
}
|
||||
else
|
||||
unconverted = 0;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
len = 0; /* to avoid gcc warning */
|
||||
for (try = 0; try < 100; ++try)
|
||||
|
||||
+38
-5
@@ -564,11 +564,6 @@ static char *(features[]) =
|
||||
#else
|
||||
"-smartindent",
|
||||
#endif
|
||||
#ifdef FEAT_SNIFF
|
||||
"+sniff",
|
||||
#else
|
||||
"-sniff",
|
||||
#endif
|
||||
#ifdef STARTUPTIME
|
||||
"+startuptime",
|
||||
#else
|
||||
@@ -763,6 +758,44 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1444,
|
||||
/**/
|
||||
1443,
|
||||
/**/
|
||||
1442,
|
||||
/**/
|
||||
1441,
|
||||
/**/
|
||||
1440,
|
||||
/**/
|
||||
1439,
|
||||
/**/
|
||||
1438,
|
||||
/**/
|
||||
1437,
|
||||
/**/
|
||||
1436,
|
||||
/**/
|
||||
1435,
|
||||
/**/
|
||||
1434,
|
||||
/**/
|
||||
1433,
|
||||
/**/
|
||||
1432,
|
||||
/**/
|
||||
1431,
|
||||
/**/
|
||||
1430,
|
||||
/**/
|
||||
1429,
|
||||
/**/
|
||||
1428,
|
||||
/**/
|
||||
1427,
|
||||
/**/
|
||||
1426,
|
||||
/**/
|
||||
1425,
|
||||
/**/
|
||||
|
||||
@@ -1975,10 +1975,6 @@ typedef int VimClipboard; /* This is required for the prototypes. */
|
||||
|
||||
#include "globals.h" /* global variables and messages */
|
||||
|
||||
#ifdef FEAT_SNIFF
|
||||
# include "if_sniff.h"
|
||||
#endif
|
||||
|
||||
#ifndef FEAT_VIRTUALEDIT
|
||||
# define getvvcol(w, p, s, c, e) getvcol(w, p, s, c, e)
|
||||
# define virtual_active() FALSE
|
||||
|
||||
Reference in New Issue
Block a user