mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Compare commits
140 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 36913eca21 | |||
| a7579ca1c7 | |||
| 03750a9e59 | |||
| 2a33867b14 | |||
| 7fadbf8325 | |||
| 75373f3808 | |||
| e20b3eba73 | |||
| 116a0f800c | |||
| 6d87e9e1c6 | |||
| f8d57a5049 | |||
| 33a43bee9c | |||
| f3402b1b7f | |||
| 1c864093f9 | |||
| 4535654246 | |||
| e16b00a158 | |||
| 02113ed4df | |||
| bae5a17a73 | |||
| cae92dc3d5 | |||
| 6d8197485d | |||
| 39d21e3c30 | |||
| 0af2d32c21 | |||
| 22aa23fd8c | |||
| aaa8a35fbd | |||
| 98fd66d311 | |||
| 086d535f77 | |||
| b9279e73ae | |||
| a9f028103f | |||
| cfcc022c54 | |||
| 35422f45ba | |||
| d53109886b | |||
| 8456ea8050 | |||
| 78712a7733 | |||
| 69198197fd | |||
| a060c7570b | |||
| 07c043af5f | |||
| 4a137b4586 | |||
| 6b7355a30d | |||
| 8e5eece8c5 | |||
| 321a0c859e | |||
| eb44a68b42 | |||
| 620d064b0b | |||
| 102dc7f891 | |||
| 5be8dd087f | |||
| e9c21aed62 | |||
| b4a6721a28 | |||
| 1b66c00aec | |||
| 69a76feda9 | |||
| 01efafad12 | |||
| 3c3a80dc59 | |||
| 2f3a90a3bd | |||
| 398ee7326b | |||
| 7c9aec4ac8 | |||
| d8dc179937 | |||
| 64a5e97991 | |||
| 90a265cca0 | |||
| e0ab979fa7 | |||
| 66cd19fef1 | |||
| 223896d3e9 | |||
| 5c838a3e71 | |||
| b6843a007d | |||
| 724ee2baf9 | |||
| fae4283542 | |||
| 94053a5125 | |||
| 0792048842 | |||
| f55e4c867f | |||
| 20e6cd07ba | |||
| 65cedb2074 | |||
| 2a4f06f370 | |||
| 9c8448472f | |||
| c2ce52c011 | |||
| 12d853fae1 | |||
| aaef1bae3c | |||
| 7da346035b | |||
| 983b3a5bc4 | |||
| 979e8c5346 | |||
| 912fa38673 | |||
| 662d938666 | |||
| 3633cf5201 | |||
| 392d1bfa5e | |||
| 43a100e446 | |||
| c9456cec0c | |||
| d09be32142 | |||
| b000e328ef | |||
| 12d93ee26d | |||
| 0e23e9c5e7 | |||
| 97870002d3 | |||
| 22aad2f880 | |||
| f144a3fb73 | |||
| 43c007ff22 | |||
| 0e7885e67d | |||
| 423802d1a2 | |||
| 68c4bdd53c | |||
| 5449f7c6fc | |||
| d0b6c6c54e | |||
| 30fe88677d | |||
| d507a685ad | |||
| 6e1ef28057 | |||
| f98246d484 | |||
| d1ee0043c0 | |||
| 91d348abfc | |||
| c6df10e5d3 | |||
| 70229f951f | |||
| 1e8340bbbf | |||
| 696d00f488 | |||
| 7841db9e55 | |||
| dcbfa33fa1 | |||
| 63ecddab6d | |||
| e46fc373cc | |||
| d85f271bf8 | |||
| d973bcb483 | |||
| 607985a95f | |||
| 9966b21a57 | |||
| 93723a4ef1 | |||
| 1a0f200500 | |||
| b41bf8e6b4 | |||
| fa228f716a | |||
| 96ad8c9ac1 | |||
| f86eea9f01 | |||
| 1f28b4c6a3 | |||
| 8bcc99b821 | |||
| 38ed1f5bea | |||
| d243a2a5ef | |||
| bb543088a5 | |||
| 59ee05b2f5 | |||
| 67883b4909 | |||
| a2c45a17c1 | |||
| 0e83f02d80 | |||
| d28cc3f55d | |||
| ab6eec3887 | |||
| cb25d18220 | |||
| 80c77243e2 | |||
| 293424c199 | |||
| 4cc93dc85a | |||
| a1b5b09281 | |||
| f0a521f4f7 | |||
| fc716d7256 | |||
| 8f14bb58cb | |||
| f80451e6fe | |||
| b2a76ec06b | |||
| 50badaddb4 |
@@ -1,4 +1,5 @@
|
||||
language: c
|
||||
dist: trusty
|
||||
|
||||
os:
|
||||
- osx
|
||||
|
||||
@@ -134,6 +134,7 @@ SRC_ALL = \
|
||||
src/testdir/bench*.in \
|
||||
src/testdir/bench*.vim \
|
||||
src/testdir/samples/*.txt \
|
||||
src/testdir/if_ver*.vim \
|
||||
src/proto.h \
|
||||
src/proto/arabic.pro \
|
||||
src/proto/blowfish.pro \
|
||||
@@ -200,7 +201,6 @@ SRC_ALL = \
|
||||
src/libvterm/.gitignore \
|
||||
src/libvterm/LICENSE \
|
||||
src/libvterm/Makefile \
|
||||
src/libvterm/Makefile.msc \
|
||||
src/libvterm/README \
|
||||
src/libvterm/tbl2inc_c.pl \
|
||||
src/libvterm/vterm.pc.in \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*develop.txt* For Vim version 8.0. Last change: 2017 Jan 05
|
||||
*develop.txt* For Vim version 8.0. Last change: 2017 Jul 31
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -143,9 +143,10 @@ and its environment.
|
||||
|
||||
VIM IS... NOT *design-not*
|
||||
|
||||
- Vim is not a shell or an Operating System. You will not be able to run a
|
||||
shell inside Vim or use it to control a debugger. This should work the
|
||||
other way around: Use Vim as a component from a shell or in an IDE.
|
||||
- Vim is not a shell or an Operating System. It does provide a terminal
|
||||
window, in which you can run a shell or debugger. E.g. to be able to do
|
||||
this over an ssh connection. But if you don't need a text editor with that
|
||||
it is out of scope (use something like screen or tmux instead).
|
||||
A satirical way to say this: "Unlike Emacs, Vim does not attempt to include
|
||||
everything but the kitchen sink, but some people say that you can clean one
|
||||
with it. ;-)"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 8.0. Last change: 2017 Jul 16
|
||||
*editing.txt* For Vim version 8.0. Last change: 2017 Aug 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1737,7 +1737,7 @@ There are three different types of searching:
|
||||
This searches the same directories, but in a different order.
|
||||
|
||||
Note that completion for ":find", ":sfind", and ":tabfind" commands do not
|
||||
currently work with 'path' items that contain a url or use the double star
|
||||
currently work with 'path' items that contain a URL or use the double star
|
||||
with depth limiter (/usr/**2) or upward search (;) notations.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
+159
-21
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Jul 22
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Aug 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1815,7 +1815,7 @@ v:scrollstart String describing the script or function that caused the
|
||||
hit-enter prompt.
|
||||
|
||||
*v:servername* *servername-variable*
|
||||
v:servername The resulting registered |x11-clientserver| name if any.
|
||||
v:servername The resulting registered |client-server-name| if any.
|
||||
Read-only.
|
||||
|
||||
|
||||
@@ -2369,12 +2369,19 @@ tagfiles() List tags files used
|
||||
tan({expr}) Float tangent of {expr}
|
||||
tanh({expr}) Float hyperbolic tangent of {expr}
|
||||
tempname() String name for a temporary file
|
||||
term_getsize() Dict get the size of a terminal
|
||||
term_open() Job open a terminal window and run a job
|
||||
term_scrape() List inspect terminal screen
|
||||
term_sendkeys() Number send keystrokes to a terminal
|
||||
term_setsize() Number set the size of a terminal
|
||||
term_wait() Number wait for screen to be updated
|
||||
term_getattr({attr}, {what}) Number get the value of attribute {what}
|
||||
term_getcursor({buf}) List get the cursor position of a terminal
|
||||
term_getjob({buf}) Job get the job associated with a terminal
|
||||
term_getline({buf}, {row}) String get a line of text from a terminal
|
||||
term_getsize({buf}) List get the size of a terminal
|
||||
term_getstatus({buf}) String get the status of a terminal
|
||||
term_gettitle({buf}) String get the title of a terminal
|
||||
term_gettty({buf}) String get the tty name of a terminal
|
||||
term_list() List get the list of terminal buffers
|
||||
term_scrape({buf}, {row}) List get row of a terminal screen
|
||||
term_sendkeys({buf}, {keys}) none send keystrokes to a terminal
|
||||
term_start({cmd}, {options}) Job open a terminal window and run a job
|
||||
term_wait({buf} [, {time}]) Number wait for screen to be updated
|
||||
test_alloc_fail({id}, {countdown}, {repeat})
|
||||
none make memory allocation fail
|
||||
test_autochdir() none enable 'autochdir' during startup
|
||||
@@ -3255,11 +3262,16 @@ cosh({expr}) *cosh()*
|
||||
|
||||
count({comp}, {expr} [, {ic} [, {start}]]) *count()*
|
||||
Return the number of times an item with value {expr} appears
|
||||
in |List| or |Dictionary| {comp}.
|
||||
in |String|, |List| or |Dictionary| {comp}.
|
||||
|
||||
If {start} is given then start with the item with this index.
|
||||
{start} can only be used with a |List|.
|
||||
|
||||
When {ic} is given and it's |TRUE| then case is ignored.
|
||||
|
||||
When {comp} is a string then the number of not overlapping
|
||||
occurences of {expr} is returned.
|
||||
|
||||
|
||||
*cscope_connection()*
|
||||
cscope_connection([{num} , {dbpath} [, {prepend}]])
|
||||
@@ -4356,6 +4368,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
|
||||
highlight highlight groups
|
||||
history :history suboptions
|
||||
locale locale names (as output of locale -a)
|
||||
mapclear buffer argument
|
||||
mapping mapping name
|
||||
menu menus
|
||||
messages |:messages| suboptions
|
||||
@@ -5181,6 +5194,8 @@ job_info({job}) *job_info()*
|
||||
Returns a Dictionary with information about {job}:
|
||||
"status" what |job_status()| returns
|
||||
"channel" what |job_getchannel()| returns
|
||||
"process" process ID
|
||||
"tty" controlling terminal name, empty when none
|
||||
"exitval" only valid when "status" is "dead"
|
||||
"exit_cb" function to be called on exit
|
||||
"stoponexit" |job-stoponexit|
|
||||
@@ -7893,23 +7908,145 @@ tempname() *tempname()* *temp-file-name*
|
||||
For MS-Windows forward slashes are used when the 'shellslash'
|
||||
option is set or when 'shellcmdflag' starts with '-'.
|
||||
|
||||
term_getsize() *term_getsize()*
|
||||
Get the size of a terminal. NOT IMPLEMENTED YET
|
||||
term_getattr({attr}, {what}) *term_getattr()*
|
||||
Given {attr}, a value returned by term_scrape() in the "attr"
|
||||
item, return whether {what} is on. {what} can be one of:
|
||||
bold
|
||||
italic
|
||||
underline
|
||||
strike
|
||||
reverse
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_open() *term_open()*
|
||||
Open a terminal window and run a job. NOT IMPLEMENTED YET
|
||||
term_getcursor({buf}) *term_getcursor()*
|
||||
Get the cursor position of terminal {buf}. Returns a list with
|
||||
three numbers: [rows, cols, visible]. "rows" and "cols" are
|
||||
one based, the first screen cell is row 1, column 1.
|
||||
"visible" is one when the cursor is visible, zero when it is
|
||||
hidden.
|
||||
|
||||
term_scrape() *term_scrape()*
|
||||
Inspect terminal screen. NOT IMPLEMENTED YET
|
||||
This is the cursor position of the terminal itself, not of the
|
||||
Vim window.
|
||||
|
||||
term_sendkeys() *term_sendkeys()*
|
||||
Send keystrokes to a terminal. NOT IMPLEMENTED YET
|
||||
{buf} must be the buffer number of a terminal window. If the
|
||||
buffer does not exist or is not a terminal window, an empty
|
||||
list is returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_setsize() *term_setsize()*
|
||||
Set the size of a terminal. NOT IMPLEMENTED YET
|
||||
term_getjob({buf}) *term_getjob()*
|
||||
Get the Job associated with terminal window {buf}.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
Returns |v:null| when there is no job.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_wait() *term_wait()*
|
||||
Wait for screen to be updated. NOT IMPLEMENTED YET
|
||||
term_getline({buf}, {row}) *term_getline()*
|
||||
Get a line of text from the terminal window of {buf}.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
|
||||
The first line has {row} one. When {row} is "." the cursor
|
||||
line is used. When {row} is invalid an empty string is
|
||||
returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getsize({buf}) *term_getsize()*
|
||||
Get the size of terminal {buf}. Returns a list with two
|
||||
numbers: [rows, cols]. This is the size of the terminal, not
|
||||
the window containing the terminal.
|
||||
|
||||
{buf} must be the buffer number of a terminal window. Use an
|
||||
empty string for the current buffer. If the buffer does not
|
||||
exist or is not a terminal window, an empty list is returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getstatus({buf}) *term_getstatus()*
|
||||
Get the status of terminal {buf}. This returns a comma
|
||||
separated list of these items:
|
||||
running job is running
|
||||
finished job has finished
|
||||
normal in Terminal-Normal mode
|
||||
One of "running" or "finished" is always present.
|
||||
|
||||
{buf} must be the buffer number of a terminal window. If the
|
||||
buffer does not exist or is not a terminal window, an empty
|
||||
string is returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_gettitle({buf}) *term_gettitle()*
|
||||
Get the title of terminal {buf}. This is the title that the
|
||||
job in the terminal has set.
|
||||
|
||||
{buf} must be the buffer number of a terminal window. If the
|
||||
buffer does not exist or is not a terminal window, an empty
|
||||
string is returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_gettty({buf}) *term_gettty()*
|
||||
Get the name of the controlling terminal associated with
|
||||
terminal window {buf}.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_list() *term_list()*
|
||||
Return a list with the buffer numbers of all buffers for
|
||||
terminal windows.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_scrape({buf}, {row}) *term_scrape()*
|
||||
Get the contents of {row} of terminal screen of {buf}.
|
||||
For {buf} see |term_getsize()|.
|
||||
|
||||
The first line has {row} one. When {row} is "." the cursor
|
||||
line is used. When {row} is invalid an empty string is
|
||||
returned.
|
||||
|
||||
Return a List containing a Dict for each screen cell:
|
||||
"chars" character(s) at the cell
|
||||
"fg" foreground color as #rrggbb
|
||||
"bg" background color as #rrggbb
|
||||
"attr" attributes of the cell, use |term_getattr()|
|
||||
to get the individual flags
|
||||
"width" cell width: 1 or 2
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_sendkeys({buf}, {keys}) *term_sendkeys()*
|
||||
Send keystrokes {keys} to terminal {buf}.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
|
||||
{keys} are translated as key sequences. For example, "\<c-x>"
|
||||
means the character CTRL-X.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_start({cmd}, {options}) *term_start()*
|
||||
Open a terminal window and run {cmd} in it.
|
||||
|
||||
Returns the buffer number of the terminal window.
|
||||
When opening the window fails zero is returned.
|
||||
|
||||
{options} are similar to what is used for |job_start()|, see
|
||||
|job-options|. However, not all options can be used. These
|
||||
are supported:
|
||||
all timeout options
|
||||
"stoponexit"
|
||||
"out_cb", "err_cb"
|
||||
"exit_cb", "close_cb"
|
||||
"in_io", "in_top", "in_bot", "in_name", "in_buf"
|
||||
"out_io", "out_name", "out_buf", "out_modifiable", "out_msg"
|
||||
"err_io", "err_name", "err_buf", "err_modifiable", "err_msg"
|
||||
However, at least one of stdin, stdout or stderr must be
|
||||
connected to the terminal. When I/O is connected to the
|
||||
terminal then the callback function for that part is not used.
|
||||
|
||||
There is one extra option:
|
||||
"term_name" name to use for the buffer name, instead of
|
||||
the command name.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_wait({buf} [, {time}]) *term_wait()*
|
||||
Wait for pending updates of {buf} to be handled.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
{time} is how long to wait for updates to arrive in msec. If
|
||||
not set then 10 msec will be used.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
test_alloc_fail({id}, {countdown}, {repeat}) *test_alloc_fail()*
|
||||
This is for testing: If the memory allocation with {id} is
|
||||
@@ -8637,6 +8774,7 @@ tag_any_white Compiled with support for any white characters in tags
|
||||
files |tag-any-white|.
|
||||
tcl Compiled with Tcl interface.
|
||||
termguicolors Compiled with true color in terminal support.
|
||||
terminal Compiled with |terminal| support.
|
||||
terminfo Compiled with terminfo instead of termcap.
|
||||
termresponse Compiled with support for |t_RV| and |v:termresponse|.
|
||||
textobjects Compiled with support for |text-objects|.
|
||||
|
||||
@@ -116,13 +116,13 @@ g:rustfmt_options~
|
||||
|
||||
*g:rust_playpen_url*
|
||||
g:rust_playpen_url~
|
||||
Set this option to override the url for the playpen to use: >
|
||||
Set this option to override the URL for the playpen to use: >
|
||||
let g:rust_playpen_url = 'https://play.rust-lang.org/'
|
||||
<
|
||||
|
||||
*g:rust_shortener_url*
|
||||
g:rust_shortener_url~
|
||||
Set this option to override the url for the url shortener: >
|
||||
Set this option to override the URL for the URL shortener: >
|
||||
let g:rust_shortener_url = 'https://is.gd/'
|
||||
<
|
||||
|
||||
@@ -199,7 +199,7 @@ COMMANDS *rust-commands*
|
||||
|g:rust_playpen_url| is the base URL to the playpen, by default
|
||||
"https://play.rust-lang.org/".
|
||||
|
||||
|g:rust_shortener_url| is the base url for the shorterner, by
|
||||
|g:rust_shortener_url| is the base URL for the shorterner, by
|
||||
default "https://is.gd/"
|
||||
|
||||
:RustFmt *:RustFmt*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*gui_x11.txt* For Vim version 8.0. Last change: 2017 Jun 27
|
||||
*gui_x11.txt* For Vim version 8.0. Last change: 2017 Jul 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -682,7 +682,7 @@ Of these three, Vim uses PRIMARY when reading and writing the "* register
|
||||
register. Vim does not access the SECONDARY selection.
|
||||
|
||||
Examples: (assuming the default option values)
|
||||
- Select an URL in Visual mode in Vim. Go to your browser and click the
|
||||
- Select a URL in Visual mode in Vim. Go to your browser and click the
|
||||
middle mouse button in the URL text field. The selected text will be
|
||||
inserted (hopefully!). Note: in Firefox you can set the
|
||||
middlemouse.contentLoadURL preference to true in about:config, then the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 8.0. Last change: 2017 Jul 16
|
||||
*index.txt* For Vim version 8.0. Last change: 2017 Jul 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -528,8 +528,10 @@ tag command action in Normal mode ~
|
||||
|CTRL-W_CTRL-]| CTRL-W CTRL-] same as "CTRL-W ]"
|
||||
|CTRL-W_CTRL-^| CTRL-W CTRL-^ same as "CTRL-W ^"
|
||||
|CTRL-W_CTRL-_| CTRL-W CTRL-_ same as "CTRL-W _"
|
||||
|CTRL-W_quote| CTRL-W " terminal window: paste register
|
||||
|CTRL-W_+| CTRL-W + increase current window height N lines
|
||||
|CTRL-W_-| CTRL-W - decrease current window height N lines
|
||||
|CTRL-W_.| CTRL-W . terminal window: type CTRL-W
|
||||
|CTRL-W_:| CTRL-W : same as |:|, edit a command line
|
||||
|CTRL-W_<| CTRL-W < decrease current window width N columns
|
||||
|CTRL-W_=| CTRL-W = make all windows the same height & width
|
||||
@@ -538,6 +540,7 @@ tag command action in Normal mode ~
|
||||
|CTRL-W_J| CTRL-W J move current window to the very bottom
|
||||
|CTRL-W_K| CTRL-W K move current window to the very top
|
||||
|CTRL-W_L| CTRL-W L move current window to the far right
|
||||
|CTRL-W_N| CTRL-W N terminal window: go to Terminal mode
|
||||
|CTRL-W_P| CTRL-W P go to preview window
|
||||
|CTRL-W_R| CTRL-W R rotate windows upwards N times
|
||||
|CTRL-W_S| CTRL-W S same as "CTRL-W s"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*intro.txt* For Vim version 8.0. Last change: 2017 Jul 17
|
||||
*intro.txt* For Vim version 8.0. Last change: 2017 Jul 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -566,7 +566,7 @@ Ex mode Like Command-line mode, but after entering a command
|
||||
you remain in Ex mode. Very limited editing of the
|
||||
command line. |Ex-mode|
|
||||
|
||||
There are six ADDITIONAL modes. These are variants of the BASIC modes:
|
||||
There are seven ADDITIONAL modes. These are variants of the BASIC modes:
|
||||
|
||||
*Operator-pending* *Operator-pending-mode*
|
||||
Operator-pending mode This is like Normal mode, but after an operator
|
||||
@@ -592,6 +592,11 @@ Insert Normal mode Entered when CTRL-O given in Insert mode. This is
|
||||
If the 'showmode' option is on "-- (insert) --" is
|
||||
shown at the bottom of the window.
|
||||
|
||||
Terminal Normal mode Using Normal mode in a terminal window. Making
|
||||
changes is impossible. Use a insert command, such as
|
||||
"a" or "i", to return control to the job running in
|
||||
the terminal. Also called |Terminal-mode|.
|
||||
|
||||
Insert Visual mode Entered when starting a Visual selection from Insert
|
||||
mode, e.g., by using CTRL-O and then "v", "V" or
|
||||
CTRL-V. When the Visual selection ends, Vim returns
|
||||
|
||||
@@ -1279,6 +1279,7 @@ completion can be enabled:
|
||||
-complete=highlight highlight groups
|
||||
-complete=history :history suboptions
|
||||
-complete=locale locale names (as output of locale -a)
|
||||
-complete=mapclear buffer argument
|
||||
-complete=mapping mapping name
|
||||
-complete=menu menus
|
||||
-complete=messages |:messages| suboptions
|
||||
|
||||
+11
-7
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Jul 23
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Jul 31
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -4163,7 +4163,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
L:SpellLocal,-:Conceal,+:Pmenu,=:PmenuSel,
|
||||
x:PmenuSbar,X:PmenuThumb,*:TabLine,
|
||||
#:TabLineSel,_:TabLineFill,!:CursorColumn,
|
||||
.:CursorLine,o:ColorColumn,q:QuickFixLine")
|
||||
.:CursorLine,o:ColorColumn,q:QuickFixLine,
|
||||
$:StatusLineTerm")
|
||||
global
|
||||
{not in Vi}
|
||||
This option can be used to set highlighting mode for various
|
||||
@@ -7949,14 +7950,17 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
NOTE: This option is reset when 'compatible' is set.
|
||||
|
||||
*'termkey'* *'tk'*
|
||||
'termkey' 'tk' string (default "CTRL-W")
|
||||
'termkey' 'tk' string (default "")
|
||||
local to window
|
||||
{not in Vi}
|
||||
The key that precedes a Vim command in a terminal window. Other keys
|
||||
The key that starts a CTRL-W command in a terminal window. Other keys
|
||||
are sent to the job running in the window.
|
||||
The string must be one key stroke but can be multiple bytes.
|
||||
NOT IMPLEMENTED YET
|
||||
|
||||
The <> notation can be used, e.g.: >
|
||||
:set termkey=<C-L>
|
||||
< The string must be one key stroke but can be multiple bytes.
|
||||
When not set CTRL-W is used, so that CTRL-W : gets you to the command
|
||||
line. If 'termkey' is set to CTRL-L then CTRL-L : gets you to the
|
||||
command line.
|
||||
|
||||
*'termsize'* *'tms'*
|
||||
'termsize' 'tms' string (default "")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*pi_getscript.txt* For Vim version 7.0. Last change: 2013 Nov 29
|
||||
*pi_getscript.txt* For Vim version 7.0. Last change: 2017 Aug 01
|
||||
>
|
||||
GETSCRIPT REFERENCE MANUAL by Charles E. Campbell
|
||||
<
|
||||
@@ -389,7 +389,7 @@ v36 Apr 22, 2013 : * (glts) suggested use of plugin/**/*.vim instead of
|
||||
plugin/*.vim in globpath() call.
|
||||
* (Andy Wokula) got warning message when setting
|
||||
g:loaded_getscriptPlugin
|
||||
v35 Apr 07, 2012 : * (MengHuan Yu) pointed out that the script url has
|
||||
v35 Apr 07, 2012 : * (MengHuan Yu) pointed out that the script URL has
|
||||
changed (somewhat). However, it doesn't work, and
|
||||
the original one does (under Linux). I'll make it
|
||||
yet-another-option.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickref.txt* For Vim version 8.0. Last change: 2017 Jul 15
|
||||
*quickref.txt* For Vim version 8.0. Last change: 2017 Aug 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -964,6 +964,7 @@ Short explanation of each option: *option-list*
|
||||
'viewdir' 'vdir' directory where to store files with :mkview
|
||||
'viewoptions' 'vop' specifies what to save for :mkview
|
||||
'viminfo' 'vi' use .viminfo file upon startup and exiting
|
||||
'viminfofile' 'vif' file name used for the viminfo file
|
||||
'virtualedit' 've' when to use virtual editing
|
||||
'visualbell' 'vb' use visual bell instead of beeping
|
||||
'warn' warn for shell command when buffer was changed
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*remote.txt* For Vim version 8.0. Last change: 2017 Mar 18
|
||||
*remote.txt* For Vim version 8.0. Last change: 2017 Aug 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -100,7 +100,7 @@ Tell the remote server "BLA" to write all files and exit: >
|
||||
vim --servername BLA --remote-send '<C-\><C-N>:wqa<CR>'
|
||||
|
||||
|
||||
SERVER NAME
|
||||
SERVER NAME *client-server-name*
|
||||
|
||||
By default Vim will try to register the name under which it was invoked (gvim,
|
||||
egvim ...). This can be overridden with the --servername argument. If the
|
||||
|
||||
+14
-2
@@ -3583,6 +3583,7 @@ CTRL-V-alternative gui_w32.txt /*CTRL-V-alternative*
|
||||
CTRL-W index.txt /*CTRL-W*
|
||||
CTRL-W_+ windows.txt /*CTRL-W_+*
|
||||
CTRL-W_- windows.txt /*CTRL-W_-*
|
||||
CTRL-W_. terminal.txt /*CTRL-W_.*
|
||||
CTRL-W_: windows.txt /*CTRL-W_:*
|
||||
CTRL-W_< windows.txt /*CTRL-W_<*
|
||||
CTRL-W_<BS> windows.txt /*CTRL-W_<BS>*
|
||||
@@ -3622,6 +3623,7 @@ CTRL-W_H windows.txt /*CTRL-W_H*
|
||||
CTRL-W_J windows.txt /*CTRL-W_J*
|
||||
CTRL-W_K windows.txt /*CTRL-W_K*
|
||||
CTRL-W_L windows.txt /*CTRL-W_L*
|
||||
CTRL-W_N terminal.txt /*CTRL-W_N*
|
||||
CTRL-W_P windows.txt /*CTRL-W_P*
|
||||
CTRL-W_R windows.txt /*CTRL-W_R*
|
||||
CTRL-W_S windows.txt /*CTRL-W_S*
|
||||
@@ -3649,6 +3651,7 @@ CTRL-W_n windows.txt /*CTRL-W_n*
|
||||
CTRL-W_o windows.txt /*CTRL-W_o*
|
||||
CTRL-W_p windows.txt /*CTRL-W_p*
|
||||
CTRL-W_q windows.txt /*CTRL-W_q*
|
||||
CTRL-W_quote terminal.txt /*CTRL-W_quote*
|
||||
CTRL-W_r windows.txt /*CTRL-W_r*
|
||||
CTRL-W_s windows.txt /*CTRL-W_s*
|
||||
CTRL-W_t windows.txt /*CTRL-W_t*
|
||||
@@ -4586,6 +4589,7 @@ E942 eval.txt /*E942*
|
||||
E943 message.txt /*E943*
|
||||
E944 pattern.txt /*E944*
|
||||
E945 pattern.txt /*E945*
|
||||
E946 terminal.txt /*E946*
|
||||
E95 message.txt /*E95*
|
||||
E96 diff.txt /*E96*
|
||||
E97 diff.txt /*E97*
|
||||
@@ -4829,6 +4833,7 @@ TabNew autocmd.txt /*TabNew*
|
||||
Tcl if_tcl.txt /*Tcl*
|
||||
TermChanged autocmd.txt /*TermChanged*
|
||||
TermResponse autocmd.txt /*TermResponse*
|
||||
Terminal-mode terminal.txt /*Terminal-mode*
|
||||
TextChanged autocmd.txt /*TextChanged*
|
||||
TextChangedI autocmd.txt /*TextChangedI*
|
||||
Transact-SQL ft_sql.txt /*Transact-SQL*
|
||||
@@ -5467,6 +5472,7 @@ cinoptions-values indent.txt /*cinoptions-values*
|
||||
clear-undo undo.txt /*clear-undo*
|
||||
clearmatches() eval.txt /*clearmatches()*
|
||||
client-server remote.txt /*client-server*
|
||||
client-server-name remote.txt /*client-server-name*
|
||||
clientserver remote.txt /*clientserver*
|
||||
clipboard gui.txt /*clipboard*
|
||||
clipboard-autoselect options.txt /*clipboard-autoselect*
|
||||
@@ -8891,11 +8897,17 @@ tempname() eval.txt /*tempname()*
|
||||
term-dependent-settings term.txt /*term-dependent-settings*
|
||||
term-list syntax.txt /*term-list*
|
||||
term.txt term.txt /*term.txt*
|
||||
term_getattr() eval.txt /*term_getattr()*
|
||||
term_getcursor() eval.txt /*term_getcursor()*
|
||||
term_getjob() eval.txt /*term_getjob()*
|
||||
term_getline() eval.txt /*term_getline()*
|
||||
term_getsize() eval.txt /*term_getsize()*
|
||||
term_open() eval.txt /*term_open()*
|
||||
term_getstatus() eval.txt /*term_getstatus()*
|
||||
term_gettitle() eval.txt /*term_gettitle()*
|
||||
term_list() eval.txt /*term_list()*
|
||||
term_scrape() eval.txt /*term_scrape()*
|
||||
term_sendkeys() eval.txt /*term_sendkeys()*
|
||||
term_setsize() eval.txt /*term_setsize()*
|
||||
term_start() eval.txt /*term_start()*
|
||||
term_wait() eval.txt /*term_wait()*
|
||||
termcap term.txt /*termcap*
|
||||
termcap-changed version4.txt /*termcap-changed*
|
||||
|
||||
+95
-20
@@ -1,4 +1,4 @@
|
||||
*terminal.txt* For Vim version 8.0. Last change: 2017 Jul 24
|
||||
*terminal.txt* For Vim version 8.0. Last change: 2017 Aug 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -33,22 +33,50 @@ Or to run a debugger: >
|
||||
The job runs asynchronously from Vim, the window will be updated to show
|
||||
output from the job, also while editing in any other window.
|
||||
|
||||
|
||||
Typing ~
|
||||
|
||||
When the keyboard focus is in the terminal window, typed keys will be send to
|
||||
the job. This uses a pty when possible.
|
||||
the job. This uses a pty when possible. You can click outside of the
|
||||
terminal window to move keyboard focus elsewhere.
|
||||
|
||||
Navigate between windows with CTRL-W commands (and mouse).
|
||||
E.g. CTRL-W CTRL-W moves focus to the next window.
|
||||
Use "CTRL-W :" to edit an Ex command.
|
||||
CTRL-W can be used to navigate between windows and other CTRL-W commands, e.g.:
|
||||
CTRL-W CTRL-W move focus to the next window
|
||||
CTRL-W : enter an Ex command
|
||||
See |CTRL-W| for more commands.
|
||||
|
||||
See option 'termkey' for specifying the key that precedes a Vim command.
|
||||
Default is CTRL-W.
|
||||
Special in the terminal window: *CTRL-W_.* *CTRL-W_N*
|
||||
CTRL-W . send a CTRL-W to the job in the terminal
|
||||
CTRL-W N go to Terminal Normal mode, see |Terminal-mode|
|
||||
CTRL-W " {reg} paste register {reg} *CTRL-W_quote*
|
||||
Also works with the = register to insert the result of
|
||||
evaluating an expression.
|
||||
|
||||
See option 'termkey' for specifying another key instead of CTRL-W that
|
||||
will work like CTRL-W. However, typing 'termkey' twice sends 'termkey' to
|
||||
the job. For example:
|
||||
'termkey' CTRL-W move focus to the next window
|
||||
'termkey' : enter an Ex command
|
||||
'termkey' 'termkey' send 'termkey' to the job in the terminal
|
||||
'termkey' . send a CTRL-W to the job in the terminal
|
||||
'termkey' N go to terminal Normal mode, see below
|
||||
'termkey' CTRL-N same as CTRL-W N
|
||||
*t_CTRL-\_CTRL-N*
|
||||
The special key combination CTRL-\ CTRL-N can be used to prefix one Normal
|
||||
mode command. This is especially useful for remote commands, when you don't
|
||||
know whether Vim currently has focus in a terminal window. Note that only one
|
||||
Normal mode command can be used.
|
||||
|
||||
|
||||
Size ~
|
||||
|
||||
See option 'termsize' for controlling the size of the terminal window.
|
||||
(TODO: scrolling when the terminal is larger than the window)
|
||||
|
||||
|
||||
Syntax ~
|
||||
|
||||
:ter[minal][!] [command] *:ter* *:terminal*
|
||||
:ter[minal] [command] *:ter* *:terminal*
|
||||
Open a new terminal window.
|
||||
|
||||
If [command] is provided run it as a job and connect
|
||||
@@ -56,21 +84,32 @@ Syntax ~
|
||||
If [command] is not given the 'shell' option is used.
|
||||
|
||||
A new buffer will be created, using [command] or
|
||||
'shell' as the name. If a buffer by this name already
|
||||
exists a number is added in parenthesis.
|
||||
E.g. if "gdb" exists the second terminal buffer will
|
||||
use "gdb (1)".
|
||||
|
||||
The window can be closed, in which case the buffer
|
||||
becomes hidden. The command will not be stopped. The
|
||||
`:buffer` command can be used to turn the current
|
||||
window into a terminal window, using the existing
|
||||
buffer. If there are unsaved changes this fails, use
|
||||
! to force, as usual.
|
||||
'shell' as the name, prefixed with a "!". If a buffer
|
||||
by this name already exists a number is added in
|
||||
parenthesis. E.g. if "gdb" exists the second terminal
|
||||
buffer will use "!gdb (1)".
|
||||
|
||||
When the buffer associated with the terminal is wiped out the job is killed,
|
||||
similar to calling `job_stop(job, "kill")`
|
||||
|
||||
By default the 'bufhidden' option of the buffer will be set to "hide".
|
||||
So long as the job is running: If the window is closed the buffer becomes
|
||||
hidden. The command will not be stopped. The `:buffer` command can be used
|
||||
to turn the current window into a terminal window. If there are unsaved
|
||||
changes this fails, use ! to force, as usual.
|
||||
*E947*
|
||||
So long as the job is running, the buffer is considered modified and Vim
|
||||
cannot be quit easily, see |abandon|.
|
||||
|
||||
When the job has finished and no changes were made to the buffer: closing the
|
||||
window will wipe out the buffer.
|
||||
|
||||
Before changes can be made to a terminal buffer, the 'modifiable' option must
|
||||
be set. This is only possible when the job has finished. At the first change
|
||||
the buffer will become a normal buffer and the highlighting is removed.
|
||||
You may want to change the buffer name with |:file| to be able to write, since
|
||||
the buffer name will still be set to the command.
|
||||
|
||||
|
||||
Resizing ~
|
||||
|
||||
@@ -94,11 +133,47 @@ terminal. |term_setsize()| can be used only when in the first or second mode,
|
||||
not when 'termsize' is "rowsXcols".
|
||||
|
||||
|
||||
Terminal Normal mode ~
|
||||
*Terminal-mode*
|
||||
When the job is running the contents of the terminal is under control of the
|
||||
job. That includes the cursor position. The terminal contents can change at
|
||||
any time.
|
||||
|
||||
Use CTRL-W N (or 'termkey' N) to go to Terminal Normal mode. Now the contents
|
||||
of the terminal window is under control of Vim, the job output is suspended.
|
||||
*E946*
|
||||
In this mode you can move the cursor around with the usual Vim commands,
|
||||
Visually mark text, yank text, etc. But you cannot change the contents of the
|
||||
buffer. The commands that would start insert mode, such as 'i' and 'a',
|
||||
return control of the window to the job. Any pending output will now be
|
||||
displayed.
|
||||
|
||||
In Terminal mode the statusline and window title show "(Terminal)". If the
|
||||
job ends while in Terminal mode this changes to "(Terminal-finished)".
|
||||
|
||||
|
||||
Unix ~
|
||||
|
||||
On Unix a pty is used to make it possible to run all kinds of commands. You
|
||||
can even run Vim in the terminal! That's used for debugging, see below.
|
||||
|
||||
Environment variables are used to pass information to the running job:
|
||||
TERM name of the terminal, 'term'
|
||||
ROWS number of rows in the terminal initially
|
||||
LINES same as ROWS
|
||||
COLUMNS number of columns in the terminal initially
|
||||
COLORS number of colors, 't_Co' (256*256*256 in the GUI)
|
||||
VIM_SERVERNAME v:servername
|
||||
|
||||
The |client-server| feature can be used to communicate with the Vim instance
|
||||
where the job was started. This only works when v:servername is not empty.
|
||||
If needed you can set it with: >
|
||||
call remote_startserver('vim-server')
|
||||
|
||||
In the job you can then do something like: >
|
||||
vim --servername $VIM_SERVERNAME --remote +123 some_file.c
|
||||
This will open the file "some_file.c" and put the cursor on line 123.
|
||||
|
||||
|
||||
MS-Windows ~
|
||||
|
||||
@@ -152,7 +227,7 @@ This opens three windows:
|
||||
|
||||
This uses two terminal windows. To open the gdb window: >
|
||||
:term gdb [arguments]
|
||||
To open the terminal to run the tested program |term_open()| is used.
|
||||
To open the terminal to run the tested program |term_start()| is used.
|
||||
|
||||
TODO
|
||||
|
||||
|
||||
+35
-10
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Jul 22
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Aug 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -35,6 +35,8 @@ entered there will not be repeated below, unless there is extra information.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Check out coverity reports.
|
||||
|
||||
No maintainer for Vietnamese translations.
|
||||
No maintainer for Simplified Chinese translations.
|
||||
|
||||
@@ -43,7 +45,8 @@ Terminal emulator window:
|
||||
- Lots of stuff to implement, see src/terminal.c
|
||||
- Running a shell command from the GUI still has limitations. Look into how
|
||||
the terminal emulator of the Vim shell project can help:
|
||||
http://vimshell.wana.at
|
||||
http://code.hootsuite.com/vimshell/
|
||||
- Add winpty.dll and winpty-agent.exe in the NSIS build.
|
||||
- Add debugger interface. Implementation for gdb by Xavier de Gaye. Should
|
||||
work like an IDE. Try to keep it generic. Now found here:
|
||||
http://clewn.sf.net.
|
||||
@@ -52,9 +55,6 @@ Terminal emulator window:
|
||||
- make it possible to have 'defineAnnoType' also handle terminal colors.
|
||||
- send 'balloonText' events for the cursor position (using CursorHold ?)
|
||||
in terminal mode.
|
||||
- Feature: switch between "running job" and a normal buffer (possibly
|
||||
read-only) to allow for searching, copy/paste, etc. (Domnique). Having a
|
||||
(large) scrollback would be useful.
|
||||
|
||||
+channel:
|
||||
- Try out background make plugin:
|
||||
@@ -125,6 +125,9 @@ Regexp problems:
|
||||
Another one: echom matchstr(" sdfsfsf\n sfdsdfsdf",'[^\n]*')
|
||||
(2017 May 15, #1252)
|
||||
|
||||
test_gui fails with gnome2: cannot create .gnome2 dir
|
||||
use testdir/Xfakehome instead of does/not/exist?
|
||||
|
||||
Patch for quickfix: parse lines for any quickfix list. (Yegappan Lakshmanan,
|
||||
2017 Jul 20)
|
||||
|
||||
@@ -138,6 +141,8 @@ ml_get errors with buggy script. (Dominique, 2017 Apr 30)
|
||||
|
||||
Error in emsg with buggy script. (Dominique, 2017 Apr 30)
|
||||
|
||||
Patch for Murphi syntax. (Matthew Fernandez, 2017 Jul 24)
|
||||
|
||||
Better detection of strace file. (Steven Fernandez, 2017 Jul 12, #1837)
|
||||
|
||||
Bug with conceal mode: 3rd element returned by synconcealed() differs for
|
||||
@@ -147,6 +152,11 @@ Add options_default() / options_restore() to set several options to Vim
|
||||
defaults for a plugin. Comments from Zyx, 2017 May 10.
|
||||
Perhaps use a vimcontext / endvimcontext command block.
|
||||
|
||||
Signs drawn on top of messages. (worp, #1907)
|
||||
|
||||
Folds open when job writes to another buffer. (Jonathan Fudger, 2017 Jul 31)
|
||||
Already fixed?
|
||||
|
||||
Illegal memory access, requires ASAN to see. (Dominique Pelle, 2015 Jul 28)
|
||||
Still happens (2017 Jul 9)
|
||||
|
||||
@@ -154,12 +164,15 @@ Memory leak in test_arabic.
|
||||
|
||||
Include Haiku port? (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
|
||||
It can replace the BeOS code, which is likely not used anymore.
|
||||
Now on github: #1856. Is not up-to-date.
|
||||
Now on github: #1856. Is now up-to-date?
|
||||
|
||||
Refactored HTML indent file. (Michael Lee, #1821)
|
||||
|
||||
Using uninitialzed value in test_crypt.
|
||||
|
||||
Test_writefile_fails_conversion failure on Solaris because if different iconv
|
||||
behavior. Skip when "uname" returns "SunOS"? (Pavel Heimlich, #1872)
|
||||
|
||||
All functions are global, which makes functions like get() and len() awkward.
|
||||
For the future use the ~get() and ~len() syntax, e.g.:
|
||||
mylist~get(idx)
|
||||
@@ -178,10 +191,19 @@ clip_x11_request_selection_cb() is called with zero value and length.
|
||||
Also: Get an error message from free() in the process that owns the selection.
|
||||
Seems to happen when the selection is requested the second time, but before
|
||||
clip_x11_convert_selection_cb() is invoked, thus in X library code.
|
||||
Patch to fix this by Kiichi, 2017 Jul 11, #1822)
|
||||
Kazunobu Kuriyama is working on a proper fix. (2017 Jul 25)
|
||||
|
||||
Problem with three-piece comment. (Michael Lee, 2017 May 11, #1696)
|
||||
|
||||
Completion mixes results from the current buffer with tags and other files.
|
||||
Happens when typing CTRL-N while still search for results. E.g., type "b_" in
|
||||
terminal.c and then CTRL-N twice.
|
||||
Should do current file first and not split it up when more results are found.
|
||||
(Also #1890)
|
||||
|
||||
Python: After "import vim" error messages only show the first line of the
|
||||
stack trace. (Yggdroot, 2017 Jul 28, #1887)
|
||||
|
||||
When checking if a bufref is valid, also check the buffer number, to catch the
|
||||
case of :bwipe followed by :new.
|
||||
|
||||
@@ -189,7 +211,7 @@ Patch to skip writing a temp file for diffing if the buffer is equal to the
|
||||
existing file. (Akria Sheng, 2017 Jul 22)
|
||||
Could also skip writing lines that are the same.
|
||||
|
||||
Files for Latvian language. (Vitolins, 2017 May 3, #1675)
|
||||
Patch with Files for Latvian language. (Vitolins, 2017 May 3, #1675)
|
||||
|
||||
MS-Windows: Opening same file in a second gvim hangs. (Sven Bruggemann, 2017
|
||||
Jul 4)
|
||||
@@ -237,6 +259,9 @@ Is it possible to keep the complete menu open when calling complete()?
|
||||
|
||||
Memory leak in test97? The string is actually freed. Weird.
|
||||
|
||||
Patch to add configure flags to skip rtl, farsi and arabic support.
|
||||
(Diego Carrión, #1867)
|
||||
|
||||
assert_fails() can only check for the first error. Make it possible to have
|
||||
it catch multiple errors and check all of them.
|
||||
|
||||
@@ -5620,11 +5645,11 @@ Various improvements:
|
||||
- Support %name% expansion for "gf" on Windows.
|
||||
- Make "gf" work on "file://c:/path/name". "file:/c:/" and "file:///c:/"
|
||||
should also work?
|
||||
- Add 'urlpath', used like 'path' for when "gf" used on an URL?
|
||||
- Add 'urlpath', used like 'path' for when "gf" used on a URL?
|
||||
8 When using "gf" on an absolute file name, while editing a remote file
|
||||
(starts with scp:// or http://) should prepend the method and machine
|
||||
name.
|
||||
- When finding an URL or file name, and it doesn't exist, try removing a
|
||||
- When finding a URL or file name, and it doesn't exist, try removing a
|
||||
trailing '.'.
|
||||
- Add ":path" command modifier. Should work for every command that takes a
|
||||
file name argument, to search for the file name in 'path'. Use
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Zsh shell script
|
||||
" Maintainer: Christian Brabandt <cb@256bit.org>
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2015-05-29
|
||||
" License: Vim (see :h license)
|
||||
" Repository: https://github.com/chrisbra/vim-zsh
|
||||
" Language: Zsh shell script
|
||||
" Maintainer: Christian Brabandt <cb@256bit.org>
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2015-05-29
|
||||
" License: Vim (see :h license)
|
||||
" Repository: https://github.com/chrisbra/vim-zsh
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Menu translations for Catalan
|
||||
"
|
||||
" Maintainer: Ernest Adrogué <eadrogue@gmx.net>
|
||||
" Last Change: 6 Jun 2008
|
||||
" Last Change: 26 Jul 2017
|
||||
"
|
||||
|
||||
" Quit when menu translations have already been done.
|
||||
@@ -70,9 +70,9 @@ menutrans Settings\ &Window Fin&estra\ d'opcions
|
||||
menutrans Startup\ &Settings Opcions\ i&nicials
|
||||
menutrans &Global\ Settings Opcions\ &globals
|
||||
" submenú Edita/Opcions Globals
|
||||
menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Ressalt\ de\ &patrons<Tab>:set\ hls!
|
||||
menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Ressaltat\ de\ &patrons<Tab>:set\ hls!
|
||||
menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Sensibilitat\ a\ les\ ma&júscules<Tab>:set\ ic!
|
||||
menutrans Toggle\ &Showmatch<Tab>:set\ sm! &Ressalt\ de\ coincidències<Tab>:set\ sm!
|
||||
menutrans Toggle\ &Showmatch<Tab>:set\ sm! &Ressaltat\ de\ coincidències<Tab>:set\ sm!
|
||||
menutrans &Context\ lines Línies\ de\ co&ntext
|
||||
menutrans &Virtual\ Edit Edició\ &virtual
|
||||
" submenú Edita/Opcions Globals/Edició virtual
|
||||
@@ -191,7 +191,7 @@ menutrans &Diff &Difer
|
||||
menutrans &Update &Actualitza
|
||||
menutrans &Get\ Block &Obtingues\ un\ bloc
|
||||
menutrans &Put\ Block &Posa\ un\ bloc
|
||||
menutrans &Make<Tab>:make Crida\ a\ &make<Tab>:make
|
||||
menutrans &Make<Tab>:make Crida\ &make<Tab>:make
|
||||
menutrans &List\ Errors<Tab>:cl Llista\ d'&errors<Tab>:cl
|
||||
menutrans L&ist\ Messages<Tab>:cl! &Llista\ de\ missatges<Tab>:cl!
|
||||
menutrans &Next\ Error<Tab>:cn Error\ se&güent<Tab>:cn
|
||||
@@ -203,8 +203,7 @@ menutrans Error\ &Window F&inestra\ d'errors
|
||||
menutrans &Update<Tab>:cwin &Actualitza<Tab>:cwin
|
||||
menutrans &Open<Tab>:copen &Obre<Tab>:copen
|
||||
menutrans &Close<Tab>:cclose &Tanca<Tab>:cclose
|
||||
menutrans &Set\ Compiler &Compilador
|
||||
menutrans &SeT\ Compiler &Compilador
|
||||
menutrans Se&t\ Compiler &Compilador
|
||||
menutrans &Convert\ to\ HEX<Tab>:%!xxd Converteix\ a\ &HEX<Tab>:%!xxd
|
||||
menutrans Conve&rt\ back<Tab>:%!xxd\ -r Torna\ al\ format\ &original<Tab>:%!xxd\ -r
|
||||
|
||||
@@ -303,14 +302,14 @@ menutrans &Syntax &Sintaxi
|
||||
menutrans &Manual &Manual
|
||||
menutrans A&utomatic A&utomàtica
|
||||
menutrans on/off\ for\ &This\ file Activa/Desactiva\ en\ &aquest\ fitxer
|
||||
menutrans &Show\ filetypes\ in\ menu Mostra\ tots\ els\ &tipus\ al\ menú
|
||||
menutrans &Show\ File\ Types\ in\ Menu Mostra\ tots\ els\ &tipus\ al\ menú
|
||||
menutrans &Off &Desactiva
|
||||
menutrans Co&lor\ test Prova\ dels\ &colors
|
||||
menutrans &Highlight\ test Prova\ del\ &ressalt
|
||||
menutrans &Highlight\ test Prova\ del\ &ressaltat
|
||||
menutrans &Convert\ to\ HTML Converteix\ a\ &HTML
|
||||
menutrans Assembly Ensamblador
|
||||
menutrans Config Configuració
|
||||
menutrans Set\ '&syntax'\ only Només\ el\ ressalt\ de\ sintaxi
|
||||
menutrans Set\ '&syntax'\ only Només\ el\ ressaltat\ de\ sintaxi
|
||||
menutrans Set\ '&filetype'\ too Carrega\ també\ els\ plugins
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
|
||||
+3
-1
@@ -1,7 +1,7 @@
|
||||
" These commands create the option window.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2017 Jul 15
|
||||
" Last Change: 2017 Aug 01
|
||||
|
||||
" If there already is an option window, jump to that one.
|
||||
if bufwinnr("option-window") > 0
|
||||
@@ -1323,6 +1323,8 @@ endif
|
||||
if has("viminfo")
|
||||
call append("$", "viminfo\tlist that specifies what to write in the viminfo file")
|
||||
call <SID>OptionG("vi", &vi)
|
||||
call append("$", "viminfofile\tfile name used for the viminfo file")
|
||||
call <SID>OptionG("vif", &vif)
|
||||
endif
|
||||
if has("quickfix")
|
||||
call append("$", "bufhidden\twhat happens with a buffer when it's no longer in a window")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: none; used to see highlighting
|
||||
" Maintainer: Ronald Schild <rs@scutum.de>
|
||||
" Last Change: 2001 Sep 02
|
||||
" Last Change: 2017 Jul 28
|
||||
" Version: 5.4n.1
|
||||
|
||||
" To see your current highlight settings, do
|
||||
@@ -111,17 +111,6 @@ endif
|
||||
nohlsearch
|
||||
normal 0
|
||||
|
||||
" add autocommands to remove temporary file from buffer list
|
||||
aug highlighttest
|
||||
au!
|
||||
au BufUnload Highlight\ test if expand("<afile>") == "Highlight test"
|
||||
au BufUnload Highlight\ test bdelete! Highlight\ test
|
||||
au BufUnload Highlight\ test endif
|
||||
au VimLeavePre * if bufexists("Highlight test")
|
||||
au VimLeavePre * bdelete! Highlight\ test
|
||||
au VimLeavePre * endif
|
||||
aug END
|
||||
|
||||
" we don't want to save this temporary file
|
||||
set nomodified
|
||||
|
||||
|
||||
+192
-2
File diff suppressed because one or more lines are too long
+281
-279
File diff suppressed because it is too large
Load Diff
@@ -36,8 +36,16 @@ CPU = i386
|
||||
|
||||
!ifdef SDK_INCLUDE_DIR
|
||||
!include $(SDK_INCLUDE_DIR)\Win32.mak
|
||||
!else
|
||||
!elseif "$(USE_WIN32MAK)"=="yes"
|
||||
!include <Win32.mak>
|
||||
!else
|
||||
cc = cl
|
||||
link = link
|
||||
rc = rc
|
||||
cflags = -nologo -c
|
||||
lflags = -incremental:no -nologo
|
||||
rcflags = /r
|
||||
olelibsdll = ole32.lib uuid.lib oleaut32.lib user32.lib gdi32.lib advapi32.lib
|
||||
!endif
|
||||
|
||||
# include CPUARG
|
||||
|
||||
+4
-1
@@ -481,7 +481,10 @@ You need to set the following variables:
|
||||
MZSCHEME: Where Racket is installed.
|
||||
E.g. C:\Program Files (x86)\Racket
|
||||
DYNAMIC_MZSCHEME: Whether dynamic linking is used. Usually, set to yes.
|
||||
MZSCHEME_VER: Racket DLL version. E.g. 3m_9z0ds0 for Racket 6.3.
|
||||
MZSCHEME_VER: Racket DLL version which is used for the file name.
|
||||
E.g. 3m_9z0ds0 for Racket 6.3.
|
||||
The DLL can be found under the lib directory. E.g.
|
||||
C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
|
||||
MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at
|
||||
runtime. Default: $(MZSCHEME)\collects
|
||||
User can override this with the PLTCOLLECTS environment
|
||||
|
||||
@@ -1255,7 +1255,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>135</string>
|
||||
<string>136</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
|
||||
@@ -36,7 +36,7 @@ static void loadSymbols()
|
||||
void *ptr;
|
||||
if ((ptr = dlsym(RTLD_DEFAULT, "NSImageNamePreferencesGeneral")) != NULL)
|
||||
nsImageNamePreferencesGeneral = *(NSString**)ptr;
|
||||
if ((ptr = dlsym(RTLD_DEFAULT, "NSImageNamePreferencesAdvanced")) != NULL)
|
||||
if ((ptr = dlsym(RTLD_DEFAULT, "NSImageNameAdvanced")) != NULL)
|
||||
nsImageNamePreferencesAdvanced = *(NSString**)ptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ typedef struct {
|
||||
|
||||
|
||||
@interface MMTextStorage : NSTextStorage {
|
||||
NSMutableAttributedString *attribString;
|
||||
NSTextStorage *backingStore;
|
||||
int maxRows, maxColumns;
|
||||
int actualRows, actualColumns;
|
||||
NSAttributedString *emptyRowString;
|
||||
|
||||
+39
-39
@@ -72,7 +72,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
attribString = [[NSMutableAttributedString alloc] initWithString:@""];
|
||||
backingStore = [[NSTextStorage alloc] init];
|
||||
// NOTE! It does not matter which font is set here, Vim will set its
|
||||
// own font on startup anyway. Just set some bogus values.
|
||||
font = [[NSFont userFixedPitchFontOfSize:0] retain];
|
||||
@@ -104,19 +104,19 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
[font release]; font = nil;
|
||||
[defaultBackgroundColor release]; defaultBackgroundColor = nil;
|
||||
[defaultForegroundColor release]; defaultForegroundColor = nil;
|
||||
[attribString release]; attribString = nil;
|
||||
[backingStore release]; backingStore = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString *)string
|
||||
{
|
||||
return [attribString string];
|
||||
return [backingStore string];
|
||||
}
|
||||
|
||||
- (NSDictionary *)attributesAtIndex:(NSUInteger)index
|
||||
effectiveRange:(NSRangePointer)range
|
||||
{
|
||||
return [attribString attributesAtIndex:index effectiveRange:range];
|
||||
return [backingStore attributesAtIndex:index effectiveRange:range];
|
||||
}
|
||||
|
||||
- (void)replaceCharactersInRange:(NSRange)range
|
||||
@@ -126,7 +126,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
ASLogWarn(@"Calling %@ on MMTextStorage is unsupported",
|
||||
NSStringFromSelector(_cmd));
|
||||
#endif
|
||||
//[attribString replaceCharactersInRange:range withString:string];
|
||||
//[backingStore replaceCharactersInRange:range withString:string];
|
||||
}
|
||||
|
||||
- (void)setAttributes:(NSDictionary *)attributes range:(NSRange)range
|
||||
@@ -134,7 +134,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
// NOTE! This method must be implemented since the text system calls it
|
||||
// constantly to 'fix attributes', apply font substitution, etc.
|
||||
#if 0
|
||||
[attribString setAttributes:attributes range:range];
|
||||
[backingStore setAttributes:attributes range:range];
|
||||
#elif 1
|
||||
// HACK! If the font attribute is being modified, then ensure that the new
|
||||
// font has a fixed advancement which is either the same as the current
|
||||
@@ -153,7 +153,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
return;
|
||||
|
||||
float adv = cellSize.width;
|
||||
if ([attribString attribute:MMWideCharacterAttributeName
|
||||
if ([backingStore attribute:MMWideCharacterAttributeName
|
||||
atIndex:range.location
|
||||
effectiveRange:NULL])
|
||||
adv += adv;
|
||||
@@ -170,9 +170,9 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
dictionaryWithDictionary:attributes];
|
||||
[newAttr setObject:newFont forKey:NSFontAttributeName];
|
||||
|
||||
[attribString setAttributes:newAttr range:range];
|
||||
[backingStore setAttributes:newAttr range:range];
|
||||
} else {
|
||||
[attribString setAttributes:attributes range:range];
|
||||
[backingStore setAttributes:attributes range:range];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -329,15 +329,15 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
}
|
||||
|
||||
// Mark these characters as wide. This attribute is subsequently checked
|
||||
// when translating (row,col) pairs to offsets within 'attribString'.
|
||||
// when translating (row,col) pairs to offsets within 'backingStore'.
|
||||
if (flags & DRAW_WIDE)
|
||||
[attributes setObject:[NSNull null]
|
||||
forKey:MMWideCharacterAttributeName];
|
||||
|
||||
// Replace characters in text storage and apply new attributes.
|
||||
NSRange r = NSMakeRange(range.location, [string length]);
|
||||
[attribString replaceCharactersInRange:range withString:string];
|
||||
[attribString setAttributes:attributes range:r];
|
||||
[backingStore replaceCharactersInRange:range withString:string];
|
||||
[backingStore setAttributes:attributes range:r];
|
||||
|
||||
NSInteger changeInLength = [string length] - range.length;
|
||||
if (acells != cells || acol != col) {
|
||||
@@ -345,18 +345,18 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
// NOTE: A normal width character replaced a double width
|
||||
// character. To maintain the invariant that each row covers the
|
||||
// same amount of cells, we compensate by adding an empty column.
|
||||
[attribString replaceCharactersInRange:NSMakeRange(NSMaxRange(r),0)
|
||||
[backingStore replaceCharactersInRange:NSMakeRange(NSMaxRange(r),0)
|
||||
withAttributedString:[emptyRowString
|
||||
attributedSubstringFromRange:NSMakeRange(0,1)]];
|
||||
++changeInLength;
|
||||
#if 0
|
||||
} else if (acol == col - 1) {
|
||||
[attribString replaceCharactersInRange:NSMakeRange(r.location,0)
|
||||
[backingStore replaceCharactersInRange:NSMakeRange(r.location,0)
|
||||
withAttributedString:[emptyRowString
|
||||
attributedSubstringFromRange:NSMakeRange(0,1)]];
|
||||
++changeInLength;
|
||||
} else if (acol == col + 1) {
|
||||
[attribString replaceCharactersInRange:NSMakeRange(r.location-1,1)
|
||||
[backingStore replaceCharactersInRange:NSMakeRange(r.location-1,1)
|
||||
withAttributedString:[emptyRowString
|
||||
attributedSubstringFromRange:NSMakeRange(0,2)]];
|
||||
++changeInLength;
|
||||
@@ -435,10 +435,10 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
return;
|
||||
}
|
||||
|
||||
NSAttributedString *srcString = [attribString
|
||||
NSAttributedString *srcString = [backingStore
|
||||
attributedSubstringFromRange:srcRange];
|
||||
|
||||
[attribString replaceCharactersInRange:destRange
|
||||
[backingStore replaceCharactersInRange:destRange
|
||||
withAttributedString:srcString];
|
||||
[self edited:(NSTextStorageEditedCharacters
|
||||
| NSTextStorageEditedAttributes) range:destRange
|
||||
@@ -471,9 +471,9 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
return;
|
||||
}
|
||||
|
||||
[attribString replaceCharactersInRange:destRange
|
||||
[backingStore replaceCharactersInRange:destRange
|
||||
withAttributedString:emptyString];
|
||||
[attribString setAttributes:attribs
|
||||
[backingStore setAttributes:attribs
|
||||
range:NSMakeRange(destRange.location, width)];
|
||||
|
||||
[self edited:(NSTextStorageEditedAttributes
|
||||
@@ -531,9 +531,9 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
return;
|
||||
}
|
||||
|
||||
NSAttributedString *srcString = [attribString
|
||||
NSAttributedString *srcString = [backingStore
|
||||
attributedSubstringFromRange:srcRange];
|
||||
[attribString replaceCharactersInRange:destRange
|
||||
[backingStore replaceCharactersInRange:destRange
|
||||
withAttributedString:srcString];
|
||||
[self edited:(NSTextStorageEditedCharacters
|
||||
| NSTextStorageEditedAttributes) range:destRange
|
||||
@@ -566,9 +566,9 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
return;
|
||||
}
|
||||
|
||||
[attribString replaceCharactersInRange:destRange
|
||||
[backingStore replaceCharactersInRange:destRange
|
||||
withAttributedString:emptyString];
|
||||
[attribString setAttributes:attribs
|
||||
[backingStore setAttributes:attribs
|
||||
range:NSMakeRange(destRange.location, width)];
|
||||
|
||||
[self edited:(NSTextStorageEditedAttributes
|
||||
@@ -613,9 +613,9 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
return;
|
||||
}
|
||||
|
||||
[attribString replaceCharactersInRange:range
|
||||
[backingStore replaceCharactersInRange:range
|
||||
withAttributedString:emptyString];
|
||||
[attribString setAttributes:attribs
|
||||
[backingStore setAttributes:attribs
|
||||
range:NSMakeRange(range.location, cells)];
|
||||
|
||||
[self edited:(NSTextStorageEditedAttributes
|
||||
@@ -917,7 +917,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
int cells = 1;
|
||||
NSRange r = [self charRangeForRow:row column:&col cells:&cells];
|
||||
if (NSNotFound != r.location
|
||||
&& [attribString attribute:MMWideCharacterAttributeName
|
||||
&& [backingStore attribute:MMWideCharacterAttributeName
|
||||
atIndex:r.location
|
||||
effectiveRange:nil])
|
||||
rect.size.width += rect.size.width;
|
||||
@@ -958,7 +958,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
if (!force && actualRows == maxRows && actualColumns == maxColumns)
|
||||
return;
|
||||
|
||||
NSRange oldRange = NSMakeRange(0, [attribString length]);
|
||||
NSRange oldRange = NSMakeRange(0, [backingStore length]);
|
||||
|
||||
actualRows = maxRows;
|
||||
actualColumns = maxColumns;
|
||||
@@ -990,16 +990,16 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
emptyRowString = [[NSAttributedString alloc] initWithString:rowString
|
||||
attributes:dict];
|
||||
|
||||
[attribString release];
|
||||
attribString = [[NSMutableAttributedString alloc] init];
|
||||
[backingStore release];
|
||||
backingStore = [[NSMutableAttributedString alloc] init];
|
||||
for (i=0; i<maxRows; ++i) {
|
||||
#if MM_USE_ROW_CACHE
|
||||
rowCache[i].length = actualColumns + 1;
|
||||
#endif
|
||||
[attribString appendAttributedString:emptyRowString];
|
||||
[backingStore appendAttributedString:emptyRowString];
|
||||
}
|
||||
|
||||
NSRange fullRange = NSMakeRange(0, [attribString length]);
|
||||
NSRange fullRange = NSMakeRange(0, [backingStore length]);
|
||||
[self edited:(NSTextStorageEditedCharacters|NSTextStorageEditedAttributes)
|
||||
range:oldRange changeInLength:fullRange.length-oldRange.length];
|
||||
}
|
||||
@@ -1014,7 +1014,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
if (characterEqualsColumn)
|
||||
return NSMakeRange(row*(actualColumns+1) + col, cells);
|
||||
|
||||
NSString *string = [attribString string];
|
||||
NSString *string = [backingStore string];
|
||||
unsigned stringLen = [string length];
|
||||
NSRange r, range = { NSNotFound, 0 };
|
||||
unsigned idx;
|
||||
@@ -1082,7 +1082,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
r = [string rangeOfComposedCharacterSequenceAtIndex:idx];
|
||||
|
||||
// Wide chars take up two display cells.
|
||||
if ([attribString attribute:MMWideCharacterAttributeName
|
||||
if ([backingStore attribute:MMWideCharacterAttributeName
|
||||
atIndex:idx
|
||||
effectiveRange:nil])
|
||||
++i;
|
||||
@@ -1100,7 +1100,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
--i;
|
||||
|
||||
// Wide chars take up two display cells.
|
||||
if ([attribString attribute:MMWideCharacterAttributeName
|
||||
if ([backingStore attribute:MMWideCharacterAttributeName
|
||||
atIndex:idx
|
||||
effectiveRange:nil])
|
||||
--i;
|
||||
@@ -1127,7 +1127,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
r = [string rangeOfComposedCharacterSequenceAtIndex:idx];
|
||||
|
||||
// Wide chars take up two display cells.
|
||||
if ([attribString attribute:MMWideCharacterAttributeName
|
||||
if ([backingStore attribute:MMWideCharacterAttributeName
|
||||
atIndex:idx
|
||||
effectiveRange:nil])
|
||||
++i;
|
||||
@@ -1149,7 +1149,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
r = [string rangeOfComposedCharacterSequenceAtIndex:idx];
|
||||
|
||||
// Wide chars take up two display cells.
|
||||
if ([attribString attribute:MMWideCharacterAttributeName
|
||||
if ([backingStore attribute:MMWideCharacterAttributeName
|
||||
atIndex:idx
|
||||
effectiveRange:nil])
|
||||
++i;
|
||||
@@ -1166,7 +1166,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
r = [string rangeOfComposedCharacterSequenceAtIndex:idx];
|
||||
|
||||
// Wide chars take up two display cells.
|
||||
if ([attribString attribute:MMWideCharacterAttributeName
|
||||
if ([backingStore attribute:MMWideCharacterAttributeName
|
||||
atIndex:idx
|
||||
effectiveRange:nil])
|
||||
++i;
|
||||
@@ -1218,14 +1218,14 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
// TODO: Treat these separately inside of Vim so we don't have to bother
|
||||
// here.
|
||||
while (range.length > 0) {
|
||||
invalidRange = [[attribString string]
|
||||
invalidRange = [[backingStore string]
|
||||
rangeOfCharacterFromSet:invalidCharacterSet
|
||||
options:NSLiteralSearch
|
||||
range:range];
|
||||
if (NSNotFound == invalidRange.location)
|
||||
break;
|
||||
|
||||
[attribString replaceCharactersInRange:invalidRange withString:@" "];
|
||||
[backingStore replaceCharactersInRange:invalidRange withString:@" "];
|
||||
|
||||
end = NSMaxRange(invalidRange);
|
||||
range.length -= end - range.location;
|
||||
|
||||
+64
-20
@@ -561,6 +561,12 @@ endif
|
||||
|
||||
ifeq ($(TERMINAL),yes)
|
||||
DEFINES += -DFEAT_TERMINAL
|
||||
TERM_DEPS = \
|
||||
libvterm/include/vterm.h \
|
||||
libvterm/include/vterm_keycodes.h \
|
||||
libvterm/src/rect.h \
|
||||
libvterm/src/utf8.h \
|
||||
libvterm/src/vterm_internal.h
|
||||
endif
|
||||
|
||||
# DirectWrite (DirectX)
|
||||
@@ -750,8 +756,16 @@ endif
|
||||
endif
|
||||
|
||||
ifeq ($(TERMINAL),yes)
|
||||
OBJ += $(OUTDIR)/terminal.o
|
||||
VTERM_LIB = libvterm/.libs/libvterm.a
|
||||
OBJ += $(OUTDIR)/terminal.o \
|
||||
$(OUTDIR)/term_encoding.o \
|
||||
$(OUTDIR)/term_keyboard.o \
|
||||
$(OUTDIR)/term_mouse.o \
|
||||
$(OUTDIR)/term_parser.o \
|
||||
$(OUTDIR)/term_pen.o \
|
||||
$(OUTDIR)/term_screen.o \
|
||||
$(OUTDIR)/term_state.o \
|
||||
$(OUTDIR)/term_unicode.o \
|
||||
$(OUTDIR)/term_vterm.o
|
||||
endif
|
||||
|
||||
|
||||
@@ -851,7 +865,7 @@ uninstal.exe: uninstal.c
|
||||
$(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIB)
|
||||
|
||||
$(TARGET): $(OUTDIR) $(OBJ)
|
||||
$(CC) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB) $(VTERM_LIB)
|
||||
$(CC) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
|
||||
|
||||
upx: exes
|
||||
upx gvim.exe
|
||||
@@ -867,9 +881,6 @@ xxd/xxd.exe: xxd/xxd.c
|
||||
GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
|
||||
$(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE) CXX='$(CXX)' STATIC_STDCPLUS=$(STATIC_STDCPLUS)
|
||||
|
||||
libvterm/.libs/libvterm.a :
|
||||
cd libvterm && $(MAKE) libvterm.la
|
||||
|
||||
clean:
|
||||
-$(DEL) $(OUTDIR)$(DIRSLASH)*.o
|
||||
-$(DEL) $(OUTDIR)$(DIRSLASH)*.res
|
||||
@@ -907,34 +918,43 @@ $(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h
|
||||
$(OUTDIR):
|
||||
$(MKDIR) $(OUTDIR)
|
||||
|
||||
$(OUTDIR)/channel.o: channel.c $(INCL)
|
||||
$(CC) -c $(CFLAGS) channel.c -o $(OUTDIR)/channel.o
|
||||
|
||||
$(OUTDIR)/ex_docmd.o: ex_docmd.c $(INCL) ex_cmds.h
|
||||
$(CC) -c $(CFLAGS) ex_docmd.c -o $(OUTDIR)/ex_docmd.o
|
||||
|
||||
$(OUTDIR)/ex_eval.o: ex_eval.c $(INCL) ex_cmds.h
|
||||
$(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
|
||||
|
||||
$(OUTDIR)/gui_w32.o: gui_w32.c $(INCL)
|
||||
$(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o
|
||||
|
||||
$(OUTDIR)/gui_dwrite.o: gui_dwrite.cpp $(INCL) gui_dwrite.h
|
||||
$(CC) -c $(CFLAGS) $(CXXFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o
|
||||
|
||||
$(OUTDIR)/gui_w32.o: gui_w32.c $(INCL)
|
||||
$(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o
|
||||
|
||||
$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
|
||||
$(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
|
||||
|
||||
$(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP)
|
||||
$(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o
|
||||
|
||||
mzscheme_base.c:
|
||||
$(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base
|
||||
|
||||
# Remove -D__IID_DEFINED__ for newer versions of the w32api
|
||||
$(OUTDIR)/if_ole.o: if_ole.cpp $(INCL)
|
||||
$(CC) $(CFLAGS) $(CXXFLAGS) -c -o $(OUTDIR)/if_ole.o if_ole.cpp
|
||||
|
||||
if_perl.c: if_perl.xs typemap
|
||||
$(XSUBPP) -prototypes -typemap \
|
||||
$(PERLTYPEMAP) if_perl.xs -output $@
|
||||
|
||||
$(OUTDIR)/if_ruby.o: if_ruby.c $(INCL)
|
||||
ifeq (16, $(RUBY))
|
||||
$(CC) $(CFLAGS) -U_WIN32 -c -o $(OUTDIR)/if_ruby.o if_ruby.c
|
||||
endif
|
||||
|
||||
if_perl.c: if_perl.xs typemap
|
||||
$(XSUBPP) -prototypes -typemap \
|
||||
$(PERLTYPEMAP) if_perl.xs > $@
|
||||
|
||||
$(OUTDIR)/iscygpty.o: iscygpty.c $(CUI_INCL)
|
||||
$(CC) -c $(CFLAGS) iscygpty.c -o $(OUTDIR)/iscygpty.o -U_WIN32_WINNT -D_WIN32_WINNT=0x0600 -DUSE_DYNFILEID -DENABLE_STUB_IMPL
|
||||
|
||||
@@ -944,17 +964,41 @@ $(OUTDIR)/main.o: main.c $(INCL) $(CUI_INCL)
|
||||
$(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC)
|
||||
$(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
|
||||
|
||||
$(OUTDIR)/channel.o: channel.c $(INCL)
|
||||
$(CC) -c $(CFLAGS) channel.c -o $(OUTDIR)/channel.o
|
||||
|
||||
$(OUTDIR)/regexp.o: regexp.c regexp_nfa.c $(INCL)
|
||||
$(CC) -c $(CFLAGS) regexp.c -o $(OUTDIR)/regexp.o
|
||||
|
||||
$(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP)
|
||||
$(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o
|
||||
$(OUTDIR)/terminal.o: terminal.c $(INCL) $(TERM_DEPS)
|
||||
$(CC) -c $(CFLAGS) terminal.c -o $(OUTDIR)/terminal.o
|
||||
|
||||
|
||||
CCCTERM = $(CC) -c $(CFLAGS) -Ilibvterm/include -DINLINE="" -DVSNPRINTF=vim_vsnprintf
|
||||
$(OUTDIR)/term_encoding.o: libvterm/src/encoding.c $(TERM_DEPS)
|
||||
$(CCCTERM) libvterm/src/encoding.c -o $@
|
||||
|
||||
$(OUTDIR)/term_keyboard.o: libvterm/src/keyboard.c $(TERM_DEPS)
|
||||
$(CCCTERM) libvterm/src/keyboard.c -o $@
|
||||
|
||||
$(OUTDIR)/term_mouse.o: libvterm/src/mouse.c $(TERM_DEPS)
|
||||
$(CCCTERM) libvterm/src/mouse.c -o $@
|
||||
|
||||
$(OUTDIR)/term_parser.o: libvterm/src/parser.c $(TERM_DEPS)
|
||||
$(CCCTERM) libvterm/src/parser.c -o $@
|
||||
|
||||
$(OUTDIR)/term_pen.o: libvterm/src/pen.c $(TERM_DEPS)
|
||||
$(CCCTERM) libvterm/src/pen.c -o $@
|
||||
|
||||
$(OUTDIR)/term_screen.o: libvterm/src/screen.c $(TERM_DEPS)
|
||||
$(CCCTERM) libvterm/src/screen.c -o $@
|
||||
|
||||
$(OUTDIR)/term_state.o: libvterm/src/state.c $(TERM_DEPS)
|
||||
$(CCCTERM) libvterm/src/state.c -o $@
|
||||
|
||||
$(OUTDIR)/term_unicode.o: libvterm/src/unicode.c $(TERM_DEPS)
|
||||
$(CCCTERM) libvterm/src/unicode.c -o $@
|
||||
|
||||
$(OUTDIR)/term_vterm.o: libvterm/src/vterm.c $(TERM_DEPS)
|
||||
$(CCCTERM) libvterm/src/vterm.c -o $@
|
||||
|
||||
mzscheme_base.c:
|
||||
$(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base
|
||||
|
||||
pathdef.c: $(INCL)
|
||||
ifneq (sh.exe, $(SHELL))
|
||||
|
||||
+80
-38
@@ -15,7 +15,8 @@
|
||||
# This will build the console version of Vim with no additional interfaces.
|
||||
# To add features, define any of the following:
|
||||
#
|
||||
# For MSVC 11 you need to specify where the Win32.mak file is, e.g.:
|
||||
# For MSVC 11, if you want to include Win32.mak, you need to specify
|
||||
# where the file is, e.g.:
|
||||
# SDK_INCLUDE_DIR="C:\Program Files\Microsoft SDKs\Windows\v7.1\Include"
|
||||
#
|
||||
# !!!! After changing features do "nmake clean" first !!!!
|
||||
@@ -212,7 +213,7 @@ OBJDIR = $(OBJDIR)Z
|
||||
OBJDIR = $(OBJDIR)d
|
||||
!endif
|
||||
|
||||
# Win32.mak requires that CPU be set appropriately.
|
||||
# If you include Win32.mak, it requires that CPU be set appropriately.
|
||||
# To cross-compile for Win64, set CPU=AMD64 or CPU=IA64.
|
||||
|
||||
!ifdef PROCESSOR_ARCHITECTURE
|
||||
@@ -253,12 +254,15 @@ MAKEFLAGS_GVIMEXT = DEBUG=yes
|
||||
!endif
|
||||
|
||||
|
||||
# Get all sorts of useful, standard macros from the Platform SDK.
|
||||
# Get all sorts of useful, standard macros from the Platform SDK,
|
||||
# if SDK_INCLUDE_DIR is set or USE_WIN32MAK is set to "yes".
|
||||
|
||||
!ifdef SDK_INCLUDE_DIR
|
||||
!include $(SDK_INCLUDE_DIR)\Win32.mak
|
||||
!else
|
||||
!elseif "$(USE_WIN32MAK)"=="yes"
|
||||
!include <Win32.mak>
|
||||
!else
|
||||
link = link
|
||||
!endif
|
||||
|
||||
|
||||
@@ -354,13 +358,24 @@ CSCOPE_DEFS = -DFEAT_CSCOPE
|
||||
!endif
|
||||
|
||||
!if "$(TERMINAL)" == "yes"
|
||||
TERMINAL_OBJ = $(OBJDIR)/terminal.obj
|
||||
TERMINAL_DEFS = -DFEAT_TERMINAL
|
||||
!if $(MSVC_MAJOR) <= 11
|
||||
TERMINAL_DEFS = $(TERMINAL_DEFS) /I if_perl_msvc
|
||||
!endif
|
||||
TERMINAL_SRC = terminal.c
|
||||
VTERM_LIB = libvterm/vterm.lib
|
||||
TERM_OBJ = \
|
||||
$(OBJDIR)/terminal.obj \
|
||||
$(OBJDIR)/term_encoding.obj \
|
||||
$(OBJDIR)/term_keyboard.obj \
|
||||
$(OBJDIR)/term_mouse.obj \
|
||||
$(OBJDIR)/term_parser.obj \
|
||||
$(OBJDIR)/term_pen.obj \
|
||||
$(OBJDIR)/term_screen.obj \
|
||||
$(OBJDIR)/term_state.obj \
|
||||
$(OBJDIR)/term_unicode.obj \
|
||||
$(OBJDIR)/term_vterm.obj
|
||||
TERM_DEFS = -DFEAT_TERMINAL
|
||||
TERM_DEPS = \
|
||||
libvterm/include/vterm.h \
|
||||
libvterm/include/vterm_keycodes.h \
|
||||
libvterm/src/rect.h \
|
||||
libvterm/src/utf8.h \
|
||||
libvterm/src/vterm_internal.h
|
||||
!endif
|
||||
|
||||
!ifndef NETBEANS
|
||||
@@ -470,10 +485,9 @@ WINVER = 0x0501
|
||||
#VIMRUNTIMEDIR = somewhere
|
||||
|
||||
CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
|
||||
$(CSCOPE_DEFS) $(TERMINAL_DEFS) $(NETBEANS_DEFS) $(CHANNEL_DEFS) \
|
||||
$(CSCOPE_DEFS) $(TERM_DEFS) $(NETBEANS_DEFS) $(CHANNEL_DEFS) \
|
||||
$(NBDEBUG_DEFS) $(XPM_DEFS) \
|
||||
$(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
|
||||
/Fo$(OUTDIR)/
|
||||
$(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
|
||||
|
||||
#>>>>> end of choices
|
||||
###########################################################################
|
||||
@@ -1121,6 +1135,9 @@ LINK_PDB = /PDB:$(VIM).pdb -debug
|
||||
#
|
||||
!message
|
||||
|
||||
# CFLAGS with /Fo$(OUTDIR)/
|
||||
CFLAGS_OUTDIR=$(CFLAGS) /Fo$(OUTDIR)/
|
||||
|
||||
conflags = /nologo /subsystem:$(SUBSYSTEM)
|
||||
|
||||
PATHDEF_SRC = $(OUTDIR)\pathdef.c
|
||||
@@ -1136,7 +1153,7 @@ conflags = $(conflags) /map /mapinfo:lines
|
||||
LINKARGS1 = $(linkdebug) $(conflags)
|
||||
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) $(VTERM_LIB) $(XPM_LIB) $(LINK_PDB)
|
||||
$(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
|
||||
|
||||
# Report link time code generation progress if used.
|
||||
!ifdef NODEBUG
|
||||
@@ -1157,12 +1174,12 @@ all: $(VIM).exe \
|
||||
|
||||
$(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(CUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
|
||||
$(LUA_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) $(TCL_OBJ) \
|
||||
$(CSCOPE_OBJ) $(TERMINAL_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) $(XPM_OBJ) $(VTERM_LIB) \
|
||||
$(CSCOPE_OBJ) $(TERM_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) $(XPM_OBJ) \
|
||||
version.c version.h
|
||||
$(CC) $(CFLAGS) version.c
|
||||
$(CC) $(CFLAGS_OUTDIR) version.c
|
||||
$(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(CUI_OBJ) $(OLE_OBJ) \
|
||||
$(LUA_OBJ) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) \
|
||||
$(TCL_OBJ) $(CSCOPE_OBJ) $(TERMINAL_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) \
|
||||
$(TCL_OBJ) $(CSCOPE_OBJ) $(TERM_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
|
||||
|
||||
@@ -1256,7 +1273,7 @@ testclean:
|
||||
!ELSE
|
||||
.c{$(OUTDIR)/}.obj::
|
||||
!ENDIF
|
||||
$(CC) $(CFLAGS) $<
|
||||
$(CC) $(CFLAGS_OUTDIR) $<
|
||||
|
||||
# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
|
||||
# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
|
||||
@@ -1265,7 +1282,7 @@ testclean:
|
||||
!ELSE
|
||||
.cpp{$(OUTDIR)/}.obj::
|
||||
!ENDIF
|
||||
$(CC) $(CFLAGS) $<
|
||||
$(CC) $(CFLAGS_OUTDIR) $<
|
||||
|
||||
$(OUTDIR)/arabic.obj: $(OUTDIR) arabic.c $(INCL)
|
||||
|
||||
@@ -1324,41 +1341,41 @@ $(OUTDIR)/gui_dwrite.obj: $(OUTDIR) gui_dwrite.cpp $(INCL) $(GUI_INCL)
|
||||
$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
|
||||
|
||||
$(OUTDIR)/if_lua.obj: $(OUTDIR) if_lua.c $(INCL)
|
||||
$(CC) $(CFLAGS) $(LUA_INC) if_lua.c
|
||||
$(CC) $(CFLAGS_OUTDIR) $(LUA_INC) if_lua.c
|
||||
|
||||
if_perl.c : if_perl.xs typemap
|
||||
$(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) \
|
||||
-typemap typemap if_perl.xs > if_perl.c
|
||||
-typemap typemap if_perl.xs -output if_perl.c
|
||||
|
||||
$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
|
||||
$(CC) $(CFLAGS) $(PERL_INC) if_perl.c
|
||||
$(CC) $(CFLAGS_OUTDIR) $(PERL_INC) if_perl.c
|
||||
|
||||
$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
|
||||
$(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c
|
||||
$(CC) $(CFLAGS_OUTDIR) $(PERL_INC) if_perlsfio.c
|
||||
|
||||
$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c if_mzsch.h $(INCL) $(MZSCHEME_EXTRA_DEP)
|
||||
$(CC) $(CFLAGS) if_mzsch.c \
|
||||
$(CC) $(CFLAGS_OUTDIR) if_mzsch.c \
|
||||
-DMZSCHEME_COLLECTS="\"$(MZSCHEME_COLLECTS:\=\\)\""
|
||||
|
||||
lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib:
|
||||
lib /DEF:"$(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).def"
|
||||
|
||||
$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c if_py_both.h $(INCL)
|
||||
$(CC) $(CFLAGS) $(PYTHON_INC) if_python.c
|
||||
$(CC) $(CFLAGS_OUTDIR) $(PYTHON_INC) if_python.c
|
||||
|
||||
$(OUTDIR)/if_python3.obj: $(OUTDIR) if_python3.c if_py_both.h $(INCL)
|
||||
$(CC) $(CFLAGS) $(PYTHON3_INC) if_python3.c
|
||||
$(CC) $(CFLAGS_OUTDIR) $(PYTHON3_INC) if_python3.c
|
||||
|
||||
$(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
|
||||
$(CC) $(CFLAGS_OUTDIR) $(RUBY_INC) if_ruby.c
|
||||
|
||||
$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
|
||||
$(CC) $(CFLAGS) $(TCL_INC) if_tcl.c
|
||||
$(CC) $(CFLAGS_OUTDIR) $(TCL_INC) if_tcl.c
|
||||
|
||||
$(OUTDIR)/iscygpty.obj: $(OUTDIR) iscygpty.c $(CUI_INCL)
|
||||
$(CC) $(CFLAGS) iscygpty.c -D_WIN32_WINNT=0x0600 -DUSE_DYNFILEID -DENABLE_STUB_IMPL
|
||||
$(CC) $(CFLAGS_OUTDIR) iscygpty.c -D_WIN32_WINNT=0x0600 -DUSE_DYNFILEID -DENABLE_STUB_IMPL
|
||||
|
||||
$(OUTDIR)/json.obj: $(OUTDIR) json.c $(INCL)
|
||||
|
||||
@@ -1396,7 +1413,7 @@ $(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
|
||||
|
||||
$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
|
||||
|
||||
$(OUTDIR)/terminal.obj: $(OUTDIR) terminal.c $(INCL)
|
||||
$(OUTDIR)/terminal.obj: $(OUTDIR) terminal.c $(INCL) $(TERM_DEPS)
|
||||
|
||||
$(OUTDIR)/winclip.obj: $(OUTDIR) winclip.c $(INCL)
|
||||
|
||||
@@ -1405,7 +1422,7 @@ $(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
|
||||
$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
|
||||
|
||||
$(OUTDIR)/pathdef.obj: $(OUTDIR) $(PATHDEF_SRC) $(INCL)
|
||||
$(CC) $(CFLAGS) $(PATHDEF_SRC)
|
||||
$(CC) $(CFLAGS_OUTDIR) $(PATHDEF_SRC)
|
||||
|
||||
$(OUTDIR)/popupmnu.obj: $(OUTDIR) popupmnu.c $(INCL)
|
||||
|
||||
@@ -1438,7 +1455,7 @@ $(OUTDIR)/userfunc.obj: $(OUTDIR) userfunc.c $(INCL)
|
||||
$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
|
||||
|
||||
$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
|
||||
$(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c
|
||||
$(CC) $(CFLAGS_OUTDIR) $(XPM_INC) xpm_w32.c
|
||||
|
||||
$(OUTDIR)/vim.res: $(OUTDIR) vim.rc gvim.exe.mnf version.h tools.bmp \
|
||||
tearoff.bmp vim.ico vim_error.ico \
|
||||
@@ -1456,6 +1473,36 @@ $(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
|
||||
|
||||
$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
|
||||
|
||||
|
||||
CCCTERM = $(CC) $(CFLAGS) -Ilibvterm/include -DINLINE="" -DVSNPRINTF=vim_vsnprintf -D_CRT_SECURE_NO_WARNINGS
|
||||
$(OUTDIR)/term_encoding.obj: $(OUTDIR) libvterm/src/encoding.c $(TERM_DEPS)
|
||||
$(CCCTERM) -Fo$@ libvterm/src/encoding.c
|
||||
|
||||
$(OUTDIR)/term_keyboard.obj: $(OUTDIR) libvterm/src/keyboard.c $(TERM_DEPS)
|
||||
$(CCCTERM) -Fo$@ libvterm/src/keyboard.c
|
||||
|
||||
$(OUTDIR)/term_mouse.obj: $(OUTDIR) libvterm/src/mouse.c $(TERM_DEPS)
|
||||
$(CCCTERM) -Fo$@ libvterm/src/mouse.c
|
||||
|
||||
$(OUTDIR)/term_parser.obj: $(OUTDIR) libvterm/src/parser.c $(TERM_DEPS)
|
||||
$(CCCTERM) -Fo$@ libvterm/src/parser.c
|
||||
|
||||
$(OUTDIR)/term_pen.obj: $(OUTDIR) libvterm/src/pen.c $(TERM_DEPS)
|
||||
$(CCCTERM) -Fo$@ libvterm/src/pen.c
|
||||
|
||||
$(OUTDIR)/term_screen.obj: $(OUTDIR) libvterm/src/screen.c $(TERM_DEPS)
|
||||
$(CCCTERM) -Fo$@ libvterm/src/screen.c
|
||||
|
||||
$(OUTDIR)/term_state.obj: $(OUTDIR) libvterm/src/state.c $(TERM_DEPS)
|
||||
$(CCCTERM) -Fo$@ libvterm/src/state.c
|
||||
|
||||
$(OUTDIR)/term_unicode.obj: $(OUTDIR) libvterm/src/unicode.c $(TERM_DEPS)
|
||||
$(CCCTERM) -Fo$@ libvterm/src/unicode.c
|
||||
|
||||
$(OUTDIR)/term_vterm.obj: $(OUTDIR) libvterm/src/vterm.c $(TERM_DEPS)
|
||||
$(CCCTERM) -Fo$@ libvterm/src/vterm.c
|
||||
|
||||
|
||||
# $CFLAGS may contain backslashes and double quotes, escape them both.
|
||||
E0_CFLAGS = $(CFLAGS:\=\\)
|
||||
E_CFLAGS = $(E0_CFLAGS:"=\")
|
||||
@@ -1550,9 +1597,4 @@ proto.h: \
|
||||
.c.i:
|
||||
$(CC) $(CFLAGS) /P /C $<
|
||||
|
||||
libvterm/vterm.lib :
|
||||
cd libvterm
|
||||
$(MAKE) /NOLOGO -f Makefile.msc "MSVC_MAJOR=$(MSVC_MAJOR)"
|
||||
cd ..
|
||||
|
||||
# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0:
|
||||
|
||||
@@ -2154,6 +2154,7 @@ test_arglist \
|
||||
test_crypt \
|
||||
test_cscope \
|
||||
test_cursor_func \
|
||||
test_curswant \
|
||||
test_delete \
|
||||
test_diffmode \
|
||||
test_digraph \
|
||||
@@ -2172,6 +2173,7 @@ test_arglist \
|
||||
test_farsi \
|
||||
test_feedkeys \
|
||||
test_file_perm \
|
||||
test_file_size \
|
||||
test_fileformat \
|
||||
test_filetype \
|
||||
test_filter_cmd \
|
||||
@@ -2184,6 +2186,7 @@ test_arglist \
|
||||
test_functions \
|
||||
test_ga \
|
||||
test_getcwd \
|
||||
test_getvar \
|
||||
test_gf \
|
||||
test_glob2regpat \
|
||||
test_global \
|
||||
@@ -2195,6 +2198,7 @@ test_arglist \
|
||||
test_help \
|
||||
test_help_tagjump \
|
||||
test_hide \
|
||||
test_highlight \
|
||||
test_history \
|
||||
test_hlsearch \
|
||||
test_increment \
|
||||
@@ -2206,6 +2210,8 @@ test_arglist \
|
||||
test_lambda \
|
||||
test_langmap \
|
||||
test_largefile \
|
||||
test_let \
|
||||
test_lineending \
|
||||
test_lispwords \
|
||||
test_listlbr \
|
||||
test_listlbr_utf8 \
|
||||
@@ -2250,6 +2256,7 @@ test_arglist \
|
||||
test_reltime \
|
||||
test_retab \
|
||||
test_ruby \
|
||||
test_scrollbind \
|
||||
test_search \
|
||||
test_searchpos \
|
||||
test_set \
|
||||
@@ -2273,6 +2280,7 @@ test_arglist \
|
||||
test_tagjump \
|
||||
test_taglist \
|
||||
test_tcl \
|
||||
test_terminal \
|
||||
test_textobjects \
|
||||
test_timers \
|
||||
test_true_false \
|
||||
|
||||
+154
-10
@@ -249,7 +249,7 @@ open_buffer(
|
||||
netbeansFireChanges = oldFire;
|
||||
#endif
|
||||
/* Help buffer is filtered. */
|
||||
if (curbuf->b_help)
|
||||
if (bt_help(curbuf))
|
||||
fix_help_buffer();
|
||||
}
|
||||
else if (read_stdin)
|
||||
@@ -468,6 +468,31 @@ close_buffer(
|
||||
int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
|
||||
int wipe_buf = (action == DOBUF_WIPE);
|
||||
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (bt_terminal(buf))
|
||||
{
|
||||
if (term_job_running(buf->b_term))
|
||||
{
|
||||
if (wipe_buf)
|
||||
/* Wiping out a terminal buffer kills the job. */
|
||||
free_terminal(buf);
|
||||
else
|
||||
{
|
||||
/* The job keeps running, hide the buffer. */
|
||||
del_buf = FALSE;
|
||||
unload_buf = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* A terminal buffer is wiped out if the job has finished. */
|
||||
del_buf = TRUE;
|
||||
unload_buf = TRUE;
|
||||
wipe_buf = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
/*
|
||||
* Force unloading or deleting when 'bufhidden' says so.
|
||||
* The caller must take care of NOT deleting/freeing when 'bufhidden' is
|
||||
@@ -862,7 +887,7 @@ free_buffer(buf_T *buf)
|
||||
channel_buffer_free(buf);
|
||||
#endif
|
||||
#ifdef FEAT_TERMINAL
|
||||
free_terminal(buf->b_term);
|
||||
free_terminal(buf);
|
||||
#endif
|
||||
|
||||
buf_hashtab_remove(buf);
|
||||
@@ -1715,7 +1740,7 @@ set_curbuf(buf_T *buf, int action)
|
||||
u_sync(FALSE);
|
||||
close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf,
|
||||
unload ? action : (action == DOBUF_GOTO
|
||||
&& !P_HID(prevbuf)
|
||||
&& !buf_hide(prevbuf)
|
||||
&& !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE);
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (curwin != previouswin && win_valid(previouswin))
|
||||
@@ -4971,12 +4996,12 @@ do_arg_all(
|
||||
|
||||
if (i == opened_len && !keep_tabs)/* close this window */
|
||||
{
|
||||
if (P_HID(buf) || forceit || buf->b_nwindows > 1
|
||||
if (buf_hide(buf) || forceit || buf->b_nwindows > 1
|
||||
|| !bufIsChanged(buf))
|
||||
{
|
||||
/* If the buffer was changed, and we would like to hide it,
|
||||
* try autowriting. */
|
||||
if (!P_HID(buf) && buf->b_nwindows <= 1
|
||||
if (!buf_hide(buf) && buf->b_nwindows <= 1
|
||||
&& bufIsChanged(buf))
|
||||
{
|
||||
#ifdef FEAT_AUTOCMD
|
||||
@@ -5003,7 +5028,7 @@ do_arg_all(
|
||||
#ifdef FEAT_WINDOWS
|
||||
else
|
||||
{
|
||||
win_close(wp, !P_HID(buf) && !bufIsChanged(buf));
|
||||
win_close(wp, !buf_hide(buf) && !bufIsChanged(buf));
|
||||
# ifdef FEAT_AUTOCMD
|
||||
/* check if autocommands removed the next window */
|
||||
if (!win_valid(wpnext))
|
||||
@@ -5102,7 +5127,7 @@ do_arg_all(
|
||||
}
|
||||
(void)do_ecmd(0, alist_name(&AARGLIST(alist)[i]), NULL, NULL,
|
||||
ECMD_ONE,
|
||||
((P_HID(curwin->w_buffer)
|
||||
((buf_hide(curwin->w_buffer)
|
||||
|| bufIsChanged(curwin->w_buffer)) ? ECMD_HIDE : 0)
|
||||
+ ECMD_OLDBUF, curwin);
|
||||
#ifdef FEAT_AUTOCMD
|
||||
@@ -5357,7 +5382,7 @@ ex_buffer_all(exarg_T *eap)
|
||||
*/
|
||||
for (wp = lastwin; open_wins > count; )
|
||||
{
|
||||
r = (P_HID(wp->w_buffer) || !bufIsChanged(wp->w_buffer)
|
||||
r = (buf_hide(wp->w_buffer) || !bufIsChanged(wp->w_buffer)
|
||||
|| autowrite(wp->w_buffer, FALSE) == OK);
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (!win_valid(wp))
|
||||
@@ -5369,7 +5394,7 @@ ex_buffer_all(exarg_T *eap)
|
||||
#endif
|
||||
if (r)
|
||||
{
|
||||
win_close(wp, !P_HID(wp->w_buffer));
|
||||
win_close(wp, !buf_hide(wp->w_buffer));
|
||||
--open_wins;
|
||||
wp = lastwin;
|
||||
}
|
||||
@@ -5660,6 +5685,82 @@ write_viminfo_bufferlist(FILE *fp)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Return TRUE if "buf" is the quickfix buffer.
|
||||
*/
|
||||
int
|
||||
bt_quickfix(buf_T *buf)
|
||||
{
|
||||
return buf != NULL && buf->b_p_bt[0] == 'q';
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "buf" is a terminal buffer.
|
||||
*/
|
||||
int
|
||||
bt_terminal(buf_T *buf)
|
||||
{
|
||||
return buf != NULL && buf->b_p_bt[0] == 't';
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "buf" is a help buffer.
|
||||
*/
|
||||
int
|
||||
bt_help(buf_T *buf)
|
||||
{
|
||||
return buf != NULL && buf->b_help;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "buf" is a "nofile", "acwrite" or "terminal" buffer.
|
||||
* This means the buffer name is not a file name.
|
||||
*/
|
||||
int
|
||||
bt_nofile(buf_T *buf)
|
||||
{
|
||||
return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f')
|
||||
|| buf->b_p_bt[0] == 'a'
|
||||
|| buf->b_p_bt[0] == 't');
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "buf" is a "nowrite", "nofile" or "terminal" buffer.
|
||||
*/
|
||||
int
|
||||
bt_dontwrite(buf_T *buf)
|
||||
{
|
||||
return buf != NULL && (buf->b_p_bt[0] == 'n' || buf->b_p_bt[0] == 't');
|
||||
}
|
||||
|
||||
int
|
||||
bt_dontwrite_msg(buf_T *buf)
|
||||
{
|
||||
if (bt_dontwrite(buf))
|
||||
{
|
||||
EMSG(_("E382: Cannot write, 'buftype' option is set"));
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if the buffer should be hidden, according to 'hidden', ":hide"
|
||||
* and 'bufhidden'.
|
||||
*/
|
||||
int
|
||||
buf_hide(buf_T *buf)
|
||||
{
|
||||
/* 'bufhidden' overrules 'hidden' and ":hide", check it first */
|
||||
switch (buf->b_p_bh[0])
|
||||
{
|
||||
case 'u': /* "unload" */
|
||||
case 'w': /* "wipe" */
|
||||
case 'd': return FALSE; /* "delete" */
|
||||
case 'h': return TRUE; /* "hide" */
|
||||
}
|
||||
return (p_hid || cmdmod.hide);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return special buffer name.
|
||||
@@ -5703,9 +5804,52 @@ buf_spname(buf_T *buf)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
|
||||
#if defined(FEAT_JOB_CHANNEL) \
|
||||
|| defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) \
|
||||
|| defined(PROTO)
|
||||
# define SWITCH_TO_WIN
|
||||
|
||||
/*
|
||||
* Find a window that contains "buf" and switch to it.
|
||||
* If there is no such window, use the current window and change "curbuf".
|
||||
* Caller must initialize save_curbuf to NULL.
|
||||
* restore_win_for_buf() MUST be called later!
|
||||
*/
|
||||
void
|
||||
switch_to_win_for_buf(
|
||||
buf_T *buf,
|
||||
win_T **save_curwinp,
|
||||
tabpage_T **save_curtabp,
|
||||
bufref_T *save_curbuf)
|
||||
{
|
||||
win_T *wp;
|
||||
tabpage_T *tp;
|
||||
|
||||
if (find_win_for_buf(buf, &wp, &tp) == FAIL)
|
||||
switch_buffer(save_curbuf, buf);
|
||||
else if (switch_win(save_curwinp, save_curtabp, wp, tp, TRUE) == FAIL)
|
||||
{
|
||||
restore_win(*save_curwinp, *save_curtabp, TRUE);
|
||||
switch_buffer(save_curbuf, buf);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
restore_win_for_buf(
|
||||
win_T *save_curwin,
|
||||
tabpage_T *save_curtab,
|
||||
bufref_T *save_curbuf)
|
||||
{
|
||||
if (save_curbuf->br_buf == NULL)
|
||||
restore_win(save_curwin, save_curtab, TRUE);
|
||||
else
|
||||
restore_buffer(save_curbuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
|
||||
|| defined(SWITCH_TO_WIN) \
|
||||
|| defined(PROTO)
|
||||
/*
|
||||
* Find a window for buffer "buf".
|
||||
* If found OK is returned and "wp" and "tp" are set to the window and tabpage.
|
||||
|
||||
+139
-165
@@ -161,38 +161,16 @@ ch_log_lead(char *what, channel_T *ch)
|
||||
static int did_log_msg = TRUE;
|
||||
|
||||
void
|
||||
ch_log(channel_T *ch, char *msg)
|
||||
ch_log(channel_T *ch, const char *fmt, ...)
|
||||
{
|
||||
if (log_fd != NULL)
|
||||
{
|
||||
ch_log_lead("", ch);
|
||||
fputs(msg, log_fd);
|
||||
fputc('\n', log_fd);
|
||||
fflush(log_fd);
|
||||
did_log_msg = TRUE;
|
||||
}
|
||||
}
|
||||
va_list ap;
|
||||
|
||||
void
|
||||
ch_logn(channel_T *ch, char *msg, int nr)
|
||||
{
|
||||
if (log_fd != NULL)
|
||||
{
|
||||
ch_log_lead("", ch);
|
||||
fprintf(log_fd, msg, nr);
|
||||
fputc('\n', log_fd);
|
||||
fflush(log_fd);
|
||||
did_log_msg = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ch_logs(channel_T *ch, char *msg, char *name)
|
||||
{
|
||||
if (log_fd != NULL)
|
||||
{
|
||||
ch_log_lead("", ch);
|
||||
fprintf(log_fd, msg, name);
|
||||
va_start(ap, fmt);
|
||||
vfprintf(log_fd, fmt, ap);
|
||||
va_end(ap);
|
||||
fputc('\n', log_fd);
|
||||
fflush(log_fd);
|
||||
did_log_msg = TRUE;
|
||||
@@ -200,51 +178,16 @@ ch_logs(channel_T *ch, char *msg, char *name)
|
||||
}
|
||||
|
||||
static void
|
||||
ch_logsn(channel_T *ch, char *msg, char *name, int nr)
|
||||
ch_error(channel_T *ch, const char *fmt, ...)
|
||||
{
|
||||
if (log_fd != NULL)
|
||||
{
|
||||
ch_log_lead("", ch);
|
||||
fprintf(log_fd, msg, name, nr);
|
||||
fputc('\n', log_fd);
|
||||
fflush(log_fd);
|
||||
did_log_msg = TRUE;
|
||||
}
|
||||
}
|
||||
va_list ap;
|
||||
|
||||
static void
|
||||
ch_error(channel_T *ch, char *msg)
|
||||
{
|
||||
if (log_fd != NULL)
|
||||
{
|
||||
ch_log_lead("ERR ", ch);
|
||||
fputs(msg, log_fd);
|
||||
fputc('\n', log_fd);
|
||||
fflush(log_fd);
|
||||
did_log_msg = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ch_errorn(channel_T *ch, char *msg, int nr)
|
||||
{
|
||||
if (log_fd != NULL)
|
||||
{
|
||||
ch_log_lead("ERR ", ch);
|
||||
fprintf(log_fd, msg, nr);
|
||||
fputc('\n', log_fd);
|
||||
fflush(log_fd);
|
||||
did_log_msg = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ch_errors(channel_T *ch, char *msg, char *arg)
|
||||
{
|
||||
if (log_fd != NULL)
|
||||
{
|
||||
ch_log_lead("ERR ", ch);
|
||||
fprintf(log_fd, msg, arg);
|
||||
va_start(ap, fmt);
|
||||
vfprintf(log_fd, fmt, ap);
|
||||
va_end(ap);
|
||||
fputc('\n', log_fd);
|
||||
fflush(log_fd);
|
||||
did_log_msg = TRUE;
|
||||
@@ -518,7 +461,7 @@ channel_read_fd(int fd)
|
||||
|
||||
channel = channel_fd2channel(fd, &part);
|
||||
if (channel == NULL)
|
||||
ch_errorn(NULL, "Channel for fd %d not found", fd);
|
||||
ch_error(NULL, "Channel for fd %d not found", fd);
|
||||
else
|
||||
channel_read(channel, part, "channel_read_fd");
|
||||
}
|
||||
@@ -778,7 +721,7 @@ channel_open(
|
||||
)
|
||||
{
|
||||
SOCK_ERRNO;
|
||||
ch_errorn(channel,
|
||||
ch_error(channel,
|
||||
"channel_open: Connect failed with errno %d", errno);
|
||||
sock_close(sd);
|
||||
channel_free(channel);
|
||||
@@ -787,7 +730,7 @@ channel_open(
|
||||
}
|
||||
|
||||
/* Try connecting to the server. */
|
||||
ch_logsn(channel, "Connecting to %s port %d", hostname, port);
|
||||
ch_log(channel, "Connecting to %s port %d", hostname, port);
|
||||
ret = connect(sd, (struct sockaddr *)&server, sizeof(server));
|
||||
|
||||
if (ret == 0)
|
||||
@@ -802,7 +745,7 @@ channel_open(
|
||||
#endif
|
||||
))
|
||||
{
|
||||
ch_errorn(channel,
|
||||
ch_error(channel,
|
||||
"channel_open: Connect failed with errno %d", errno);
|
||||
PERROR(_(e_cannot_connect));
|
||||
sock_close(sd);
|
||||
@@ -839,14 +782,14 @@ channel_open(
|
||||
#ifndef WIN32
|
||||
gettimeofday(&start_tv, NULL);
|
||||
#endif
|
||||
ch_logn(channel,
|
||||
ch_log(channel,
|
||||
"Waiting for connection (waiting %d msec)...", waitnow);
|
||||
ret = select((int)sd + 1, &rfds, &wfds, NULL, &tv);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
SOCK_ERRNO;
|
||||
ch_errorn(channel,
|
||||
ch_error(channel,
|
||||
"channel_open: Connect failed with errno %d", errno);
|
||||
PERROR(_(e_cannot_connect));
|
||||
sock_close(sd);
|
||||
@@ -885,7 +828,7 @@ channel_open(
|
||||
# endif
|
||||
))
|
||||
{
|
||||
ch_errorn(channel,
|
||||
ch_error(channel,
|
||||
"channel_open: Connect failed with errno %d",
|
||||
so_error);
|
||||
PERROR(_(e_cannot_connect));
|
||||
@@ -1037,11 +980,9 @@ ch_close_part(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
/* When using a pty the same FD is set on multiple parts, only
|
||||
* close it when the last reference is closed. */
|
||||
if ((part == PART_IN || channel->ch_part[PART_IN].ch_fd != *fd)
|
||||
&& (part == PART_OUT
|
||||
|| channel->ch_part[PART_OUT].ch_fd != *fd)
|
||||
&& (part == PART_ERR
|
||||
|| channel->ch_part[PART_ERR].ch_fd != *fd))
|
||||
if ((part == PART_IN || channel->CH_IN_FD != *fd)
|
||||
&& (part == PART_OUT || channel->CH_OUT_FD != *fd)
|
||||
&& (part == PART_ERR || channel->CH_ERR_FD != *fd))
|
||||
fd_close(*fd);
|
||||
}
|
||||
*fd = INVALID_FD;
|
||||
@@ -1100,7 +1041,7 @@ channel_set_job(channel_T *channel, job_T *job, jobopt_T *options)
|
||||
chanpart_T *in_part = &channel->ch_part[PART_IN];
|
||||
|
||||
set_bufref(&in_part->ch_bufref, job->jv_in_buf);
|
||||
ch_logs(channel, "reading from buffer '%s'",
|
||||
ch_log(channel, "reading from buffer '%s'",
|
||||
(char *)in_part->ch_bufref.br_buf->b_ffname);
|
||||
if (options->jo_set & JO_IN_TOP)
|
||||
{
|
||||
@@ -1267,7 +1208,7 @@ channel_set_options(channel_T *channel, jobopt_T *opt)
|
||||
}
|
||||
else
|
||||
{
|
||||
ch_logs(channel, "writing out to buffer '%s'",
|
||||
ch_log(channel, "writing out to buffer '%s'",
|
||||
(char *)buf->b_ffname);
|
||||
set_bufref(&channel->ch_part[PART_OUT].ch_bufref, buf);
|
||||
}
|
||||
@@ -1310,7 +1251,7 @@ channel_set_options(channel_T *channel, jobopt_T *opt)
|
||||
}
|
||||
else
|
||||
{
|
||||
ch_logs(channel, "writing err to buffer '%s'",
|
||||
ch_log(channel, "writing err to buffer '%s'",
|
||||
(char *)buf->b_ffname);
|
||||
set_bufref(&channel->ch_part[PART_ERR].ch_bufref, buf);
|
||||
}
|
||||
@@ -1483,9 +1424,9 @@ channel_write_in(channel_T *channel)
|
||||
}
|
||||
|
||||
if (written == 1)
|
||||
ch_logn(channel, "written line %d to channel", (int)lnum - 1);
|
||||
ch_log(channel, "written line %d to channel", (int)lnum - 1);
|
||||
else if (written > 1)
|
||||
ch_logn(channel, "written %d lines to channel", written);
|
||||
ch_log(channel, "written %d lines to channel", written);
|
||||
|
||||
in_part->ch_buf_top = lnum;
|
||||
if (lnum > buf->b_ml.ml_line_count || lnum > in_part->ch_buf_bot)
|
||||
@@ -1498,7 +1439,7 @@ channel_write_in(channel_T *channel)
|
||||
ch_close_part(channel, PART_IN);
|
||||
}
|
||||
else
|
||||
ch_logn(channel, "Still %d more lines to write",
|
||||
ch_log(channel, "Still %d more lines to write",
|
||||
buf->b_ml.ml_line_count - lnum + 1);
|
||||
}
|
||||
|
||||
@@ -1518,7 +1459,7 @@ channel_buffer_free(buf_T *buf)
|
||||
|
||||
if (ch_part->ch_bufref.br_buf == buf)
|
||||
{
|
||||
ch_logs(channel, "%s buffer has been wiped out",
|
||||
ch_log(channel, "%s buffer has been wiped out",
|
||||
part_names[part]);
|
||||
ch_part->ch_bufref.br_buf = NULL;
|
||||
}
|
||||
@@ -1579,11 +1520,11 @@ channel_write_new_lines(buf_T *buf)
|
||||
}
|
||||
|
||||
if (written == 1)
|
||||
ch_logn(channel, "written line %d to channel", (int)lnum - 1);
|
||||
ch_log(channel, "written line %d to channel", (int)lnum - 1);
|
||||
else if (written > 1)
|
||||
ch_logn(channel, "written %d lines to channel", written);
|
||||
ch_log(channel, "written %d lines to channel", written);
|
||||
if (lnum < buf->b_ml.ml_line_count)
|
||||
ch_logn(channel, "Still %d more lines to write",
|
||||
ch_log(channel, "Still %d more lines to write",
|
||||
buf->b_ml.ml_line_count - lnum);
|
||||
|
||||
in_part->ch_buf_bot = lnum;
|
||||
@@ -1952,7 +1893,7 @@ channel_parse_json(channel_T *channel, ch_part_T part)
|
||||
if (listtv.v_type != VAR_LIST)
|
||||
ch_error(channel, "Did not receive a list, discarding");
|
||||
else
|
||||
ch_errorn(channel, "Expected list with two items, got %d",
|
||||
ch_error(channel, "Expected list with two items, got %d",
|
||||
listtv.vval.v_list->lv_len);
|
||||
clear_tv(&listtv);
|
||||
}
|
||||
@@ -1995,7 +1936,7 @@ channel_parse_json(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
/* First time encountering incomplete message or after receiving
|
||||
* more (but still incomplete): set a deadline of 100 msec. */
|
||||
ch_logn(channel,
|
||||
ch_log(channel,
|
||||
"Incomplete message (%d bytes) - wait 100 msec for more",
|
||||
(int)buflen);
|
||||
reader.js_used = 0;
|
||||
@@ -2129,7 +2070,7 @@ channel_get_json(
|
||||
{
|
||||
*rettv = item->jq_value;
|
||||
if (tv->v_type == VAR_NUMBER)
|
||||
ch_logn(channel, "Getting JSON message %d", tv->vval.v_number);
|
||||
ch_log(channel, "Getting JSON message %d", tv->vval.v_number);
|
||||
remove_json_node(head, item);
|
||||
return OK;
|
||||
}
|
||||
@@ -2227,12 +2168,12 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv)
|
||||
int save_called_emsg = called_emsg;
|
||||
|
||||
called_emsg = FALSE;
|
||||
ch_logs(channel, "Executing ex command '%s'", (char *)arg);
|
||||
ch_log(channel, "Executing ex command '%s'", (char *)arg);
|
||||
++emsg_silent;
|
||||
do_cmdline_cmd(arg);
|
||||
--emsg_silent;
|
||||
if (called_emsg)
|
||||
ch_logs(channel, "Ex command error: '%s'",
|
||||
ch_log(channel, "Ex command error: '%s'",
|
||||
(char *)get_vim_var_str(VV_ERRMSG));
|
||||
called_emsg = save_called_emsg;
|
||||
}
|
||||
@@ -2240,7 +2181,7 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv)
|
||||
{
|
||||
exarg_T ea;
|
||||
|
||||
ch_logs(channel, "Executing normal command '%s'", (char *)arg);
|
||||
ch_log(channel, "Executing normal command '%s'", (char *)arg);
|
||||
ea.arg = arg;
|
||||
ea.addr_count = 0;
|
||||
ea.forceit = TRUE; /* no mapping */
|
||||
@@ -2293,12 +2234,12 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv)
|
||||
++emsg_skip;
|
||||
if (!is_call)
|
||||
{
|
||||
ch_logs(channel, "Evaluating expression '%s'", (char *)arg);
|
||||
ch_log(channel, "Evaluating expression '%s'", (char *)arg);
|
||||
tv = eval_expr(arg, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
ch_logs(channel, "Calling '%s'", (char *)arg);
|
||||
ch_log(channel, "Calling '%s'", (char *)arg);
|
||||
if (func_call(arg, &argv[2], NULL, NULL, &res_tv) == OK)
|
||||
tv = &res_tv;
|
||||
}
|
||||
@@ -2335,7 +2276,7 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv)
|
||||
}
|
||||
else if (p_verbose > 2)
|
||||
{
|
||||
ch_errors(channel, "Received unknown command: %s", (char *)cmd);
|
||||
ch_error(channel, "Received unknown command: %s", (char *)cmd);
|
||||
EMSG2(_("E905: received unknown command: %s"), cmd);
|
||||
}
|
||||
}
|
||||
@@ -2351,7 +2292,7 @@ invoke_one_time_callback(
|
||||
cbq_T *item,
|
||||
typval_T *argv)
|
||||
{
|
||||
ch_logs(channel, "Invoking one-time callback %s",
|
||||
ch_log(channel, "Invoking one-time callback %s",
|
||||
(char *)item->cq_callback);
|
||||
/* Remove the item from the list first, if the callback
|
||||
* invokes ch_close() the list will be cleared. */
|
||||
@@ -2364,7 +2305,9 @@ invoke_one_time_callback(
|
||||
static void
|
||||
append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part)
|
||||
{
|
||||
buf_T *save_curbuf = curbuf;
|
||||
bufref_T save_curbuf = {NULL, 0, 0};
|
||||
win_T *save_curwin = NULL;
|
||||
tabpage_T *save_curtab = NULL;
|
||||
linenr_T lnum = buffer->b_ml.ml_line_count;
|
||||
int save_write_to = buffer->b_write_to_channel;
|
||||
chanpart_T *ch_part = &channel->ch_part[part];
|
||||
@@ -2390,11 +2333,13 @@ append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part)
|
||||
}
|
||||
|
||||
/* Append to the buffer */
|
||||
ch_logn(channel, "appending line %d to buffer", (int)lnum + 1 - empty);
|
||||
ch_log(channel, "appending line %d to buffer", (int)lnum + 1 - empty);
|
||||
|
||||
buffer->b_p_ma = TRUE;
|
||||
curbuf = buffer;
|
||||
curwin->w_buffer = curbuf;
|
||||
|
||||
/* Save curbuf/curwin/curtab and make "buffer" the current buffer. */
|
||||
switch_to_win_for_buf(buffer, &save_curwin, &save_curtab, &save_curbuf);
|
||||
|
||||
u_sync(TRUE);
|
||||
/* ignore undo failure, undo is not very useful here */
|
||||
ignored = u_save(lnum - empty, lnum + 1);
|
||||
@@ -2408,8 +2353,10 @@ append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part)
|
||||
else
|
||||
ml_append(lnum, msg, 0, FALSE);
|
||||
appended_lines_mark(lnum, 1L);
|
||||
curbuf = save_curbuf;
|
||||
curwin->w_buffer = curbuf;
|
||||
|
||||
/* Restore curbuf/curwin/curtab */
|
||||
restore_win_for_buf(save_curwin, save_curtab, &save_curbuf);
|
||||
|
||||
if (ch_part->ch_nomodifiable)
|
||||
buffer->b_p_ma = FALSE;
|
||||
else
|
||||
@@ -2418,7 +2365,6 @@ append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part)
|
||||
if (buffer->b_nwindows > 0)
|
||||
{
|
||||
win_T *wp;
|
||||
win_T *save_curwin;
|
||||
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
{
|
||||
@@ -2465,7 +2411,7 @@ drop_messages(channel_T *channel, ch_part_T part)
|
||||
|
||||
while ((msg = channel_get(channel, part)) != NULL)
|
||||
{
|
||||
ch_logs(channel, "Dropping message '%s'", (char *)msg);
|
||||
ch_log(channel, "Dropping message '%s'", (char *)msg);
|
||||
vim_free(msg);
|
||||
}
|
||||
}
|
||||
@@ -2520,7 +2466,7 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
|
||||
|| buffer->b_ml.ml_mfp == NULL))
|
||||
{
|
||||
/* buffer was wiped out or unloaded */
|
||||
ch_logs(channel, "%s buffer has been wiped out", part_names[part]);
|
||||
ch_log(channel, "%s buffer has been wiped out", part_names[part]);
|
||||
ch_part->ch_bufref.br_buf = NULL;
|
||||
buffer = NULL;
|
||||
}
|
||||
@@ -2674,7 +2620,7 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
|
||||
listtv = NULL;
|
||||
}
|
||||
else
|
||||
ch_logn(channel, "Dropping message %d without callback",
|
||||
ch_log(channel, "Dropping message %d without callback",
|
||||
seq_nr);
|
||||
}
|
||||
}
|
||||
@@ -2703,14 +2649,14 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
|
||||
else
|
||||
{
|
||||
/* invoke the channel callback */
|
||||
ch_logs(channel, "Invoking channel callback %s",
|
||||
ch_log(channel, "Invoking channel callback %s",
|
||||
(char *)callback);
|
||||
invoke_callback(channel, callback, partial, argv);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
ch_logn(channel, "Dropping message %d", seq_nr);
|
||||
ch_log(channel, "Dropping message %d", seq_nr);
|
||||
|
||||
if (listtv != NULL)
|
||||
free_tv(listtv);
|
||||
@@ -2892,26 +2838,41 @@ channel_close(channel_T *channel, int invoke_close_cb)
|
||||
ch_close_part(channel, PART_OUT);
|
||||
ch_close_part(channel, PART_ERR);
|
||||
|
||||
if (invoke_close_cb && channel->ch_close_cb != NULL)
|
||||
if (invoke_close_cb)
|
||||
{
|
||||
typval_T argv[1];
|
||||
typval_T rettv;
|
||||
int dummy;
|
||||
ch_part_T part;
|
||||
ch_part_T part;
|
||||
|
||||
/* Invoke callbacks before the close callback, since it's weird to
|
||||
* first invoke the close callback. Increment the refcount to avoid
|
||||
* the channel being freed halfway. */
|
||||
++channel->ch_refcount;
|
||||
ch_log(channel, "Invoking callbacks before closing");
|
||||
for (part = PART_SOCK; part < PART_IN; ++part)
|
||||
while (may_invoke_callback(channel, part))
|
||||
;
|
||||
/* Invoke callbacks and flush buffers before the close callback. */
|
||||
if (channel->ch_close_cb != NULL)
|
||||
ch_log(channel,
|
||||
"Invoking callbacks and flushing buffers before closing");
|
||||
for (part = PART_SOCK; part < PART_IN; ++part)
|
||||
{
|
||||
if (channel->ch_close_cb != NULL
|
||||
|| channel->ch_part[part].ch_bufref.br_buf != NULL)
|
||||
{
|
||||
/* Increment the refcount to avoid the channel being freed
|
||||
* halfway. */
|
||||
++channel->ch_refcount;
|
||||
if (channel->ch_close_cb == NULL)
|
||||
ch_log(channel, "flushing %s buffers before closing",
|
||||
part_names[part]);
|
||||
while (may_invoke_callback(channel, part))
|
||||
;
|
||||
--channel->ch_refcount;
|
||||
}
|
||||
}
|
||||
|
||||
/* Invoke the close callback, if still set. */
|
||||
if (channel->ch_close_cb != NULL)
|
||||
{
|
||||
ch_logs(channel, "Invoking close callback %s",
|
||||
if (channel->ch_close_cb != NULL)
|
||||
{
|
||||
typval_T argv[1];
|
||||
typval_T rettv;
|
||||
int dummy;
|
||||
|
||||
/* Increment the refcount to avoid the channel being freed
|
||||
* halfway. */
|
||||
++channel->ch_refcount;
|
||||
ch_log(channel, "Invoking close callback %s",
|
||||
(char *)channel->ch_close_cb);
|
||||
argv[0].v_type = VAR_CHANNEL;
|
||||
argv[0].vval.v_channel = channel;
|
||||
@@ -2920,28 +2881,32 @@ channel_close(channel_T *channel, int invoke_close_cb)
|
||||
channel->ch_close_partial, NULL);
|
||||
clear_tv(&rettv);
|
||||
channel_need_redraw = TRUE;
|
||||
}
|
||||
|
||||
/* the callback is only called once */
|
||||
free_callback(channel->ch_close_cb, channel->ch_close_partial);
|
||||
channel->ch_close_cb = NULL;
|
||||
channel->ch_close_partial = NULL;
|
||||
/* the callback is only called once */
|
||||
free_callback(channel->ch_close_cb, channel->ch_close_partial);
|
||||
channel->ch_close_cb = NULL;
|
||||
channel->ch_close_partial = NULL;
|
||||
|
||||
--channel->ch_refcount;
|
||||
--channel->ch_refcount;
|
||||
|
||||
if (channel_need_redraw)
|
||||
{
|
||||
channel_need_redraw = FALSE;
|
||||
redraw_after_callback();
|
||||
}
|
||||
if (channel_need_redraw)
|
||||
{
|
||||
channel_need_redraw = FALSE;
|
||||
redraw_after_callback();
|
||||
}
|
||||
|
||||
if (!channel->ch_drop_never)
|
||||
/* any remaining messages are useless now */
|
||||
for (part = PART_SOCK; part < PART_IN; ++part)
|
||||
drop_messages(channel, part);
|
||||
if (!channel->ch_drop_never)
|
||||
/* any remaining messages are useless now */
|
||||
for (part = PART_SOCK; part < PART_IN; ++part)
|
||||
drop_messages(channel, part);
|
||||
}
|
||||
}
|
||||
|
||||
channel->ch_nb_close_cb = NULL;
|
||||
|
||||
#ifdef FEAT_TERMINAL
|
||||
term_channel_closed(channel);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3093,7 +3058,7 @@ typedef enum {
|
||||
channel_wait(channel_T *channel, sock_T fd, int timeout)
|
||||
{
|
||||
if (timeout > 0)
|
||||
ch_logn(channel, "Waiting for up to %d msec", timeout);
|
||||
ch_log(channel, "Waiting for up to %d msec", timeout);
|
||||
|
||||
# ifdef WIN32
|
||||
if (fd != channel->CH_SOCK_FD)
|
||||
@@ -3194,17 +3159,13 @@ channel_wait(channel_T *channel, sock_T fd, int timeout)
|
||||
ch_close_part_on_error(
|
||||
channel_T *channel, ch_part_T part, int is_err, char *func)
|
||||
{
|
||||
char msgbuf[80];
|
||||
|
||||
vim_snprintf(msgbuf, sizeof(msgbuf),
|
||||
"%%s(): Read %s from ch_part[%d], closing",
|
||||
(is_err ? "error" : "EOF"), part);
|
||||
char msg[] = "%s(): Read %s from ch_part[%d], closing";
|
||||
|
||||
if (is_err)
|
||||
/* Do not call emsg(), most likely the other end just exited. */
|
||||
ch_errors(channel, msgbuf, func);
|
||||
ch_error(channel, msg, func, "error", part);
|
||||
else
|
||||
ch_logs(channel, msgbuf, func);
|
||||
ch_log(channel, msg, func, "EOF", part);
|
||||
|
||||
/* Queue a "DETACH" netbeans message in the command queue in order to
|
||||
* terminate the netbeans session later. Do not end the session here
|
||||
@@ -3261,7 +3222,7 @@ channel_read(channel_T *channel, ch_part_T part, char *func)
|
||||
fd = channel->ch_part[part].ch_fd;
|
||||
if (fd == INVALID_FD)
|
||||
{
|
||||
ch_errors(channel, "channel_read() called while %s part is closed",
|
||||
ch_error(channel, "channel_read() called while %s part is closed",
|
||||
part_names[part]);
|
||||
return;
|
||||
}
|
||||
@@ -3323,7 +3284,7 @@ channel_read_block(channel_T *channel, ch_part_T part, int timeout)
|
||||
char_u *nl;
|
||||
readq_T *node;
|
||||
|
||||
ch_logsn(channel, "Blocking %s read, timeout: %d msec",
|
||||
ch_log(channel, "Blocking %s read, timeout: %d msec",
|
||||
mode == MODE_RAW ? "RAW" : "NL", timeout);
|
||||
|
||||
while (TRUE)
|
||||
@@ -3382,7 +3343,7 @@ channel_read_block(channel_T *channel, ch_part_T part, int timeout)
|
||||
}
|
||||
}
|
||||
if (log_fd != NULL)
|
||||
ch_logn(channel, "Returning %d bytes", (int)STRLEN(msg));
|
||||
ch_log(channel, "Returning %d bytes", (int)STRLEN(msg));
|
||||
return msg;
|
||||
}
|
||||
|
||||
@@ -3614,7 +3575,7 @@ channel_send(
|
||||
{
|
||||
if (!channel->ch_error && fun != NULL)
|
||||
{
|
||||
ch_errors(channel, "%s(): write while not connected", fun);
|
||||
ch_error(channel, "%s(): write while not connected", fun);
|
||||
EMSG2(_("E630: %s(): write while not connected"), fun);
|
||||
}
|
||||
channel->ch_error = TRUE;
|
||||
@@ -3639,7 +3600,7 @@ channel_send(
|
||||
{
|
||||
if (!channel->ch_error && fun != NULL)
|
||||
{
|
||||
ch_errors(channel, "%s(): write failed", fun);
|
||||
ch_error(channel, "%s(): write failed", fun);
|
||||
EMSG2(_("E631: %s(): write failed"), fun);
|
||||
}
|
||||
channel->ch_error = TRUE;
|
||||
@@ -4244,7 +4205,6 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported)
|
||||
hashitem_T *hi;
|
||||
ch_part_T part;
|
||||
|
||||
opt->jo_set = 0;
|
||||
if (tv->v_type == VAR_UNKNOWN)
|
||||
return OK;
|
||||
if (tv->v_type != VAR_DICT)
|
||||
@@ -4471,6 +4431,20 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported)
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
#ifdef FEAT_TERMINAL
|
||||
else if (STRCMP(hi->hi_key, "term_name") == 0)
|
||||
{
|
||||
if (!(supported & JO2_TERM_NAME))
|
||||
break;
|
||||
opt->jo_set2 |= JO2_TERM_NAME;
|
||||
opt->jo_term_name = get_tv_string_chk(item);
|
||||
if (opt->jo_term_name == NULL)
|
||||
{
|
||||
EMSG2(_(e_invarg2), "term_name");
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if (STRCMP(hi->hi_key, "waittime") == 0)
|
||||
{
|
||||
if (!(supported & JO_WAITTIME))
|
||||
@@ -4613,6 +4587,7 @@ job_free_contents(job_T *job)
|
||||
}
|
||||
mch_clear_job(job);
|
||||
|
||||
vim_free(job->jv_tty_name);
|
||||
vim_free(job->jv_stoponexit);
|
||||
free_callback(job->jv_exit_cb, job->jv_exit_partial);
|
||||
}
|
||||
@@ -4699,6 +4674,7 @@ job_cleanup(job_T *job)
|
||||
int dummy;
|
||||
|
||||
/* Invoke the exit callback. Make sure the refcount is > 0. */
|
||||
ch_log(job->jv_channel, "Invoking exit callback %s", job->jv_exit_cb);
|
||||
++job->jv_refcount;
|
||||
argv[0].v_type = VAR_JOB;
|
||||
argv[0].vval.v_job = job;
|
||||
@@ -4721,10 +4697,6 @@ job_cleanup(job_T *job)
|
||||
* not use "job" after this! */
|
||||
job_free(job);
|
||||
}
|
||||
|
||||
#ifdef FEAT_TERMINAL
|
||||
term_job_ended(job);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4975,7 +4947,7 @@ job_start(typval_T *argvars, jobopt_T *opt_arg)
|
||||
if (get_job_options(&argvars[1], &opt,
|
||||
JO_MODE_ALL + JO_CB_ALL + JO_TIMEOUT_ALL + JO_STOPONEXIT
|
||||
+ JO_EXIT_CB + JO_OUT_IO + JO_BLOCK_WRITE) == FAIL)
|
||||
goto theend;
|
||||
goto theend;
|
||||
}
|
||||
|
||||
/* Check that when io is "file" that there is a file name. */
|
||||
@@ -5115,12 +5087,12 @@ job_start(typval_T *argvars, jobopt_T *opt_arg)
|
||||
ga_concat(&ga, (char_u *)" ");
|
||||
ga_concat(&ga, (char_u *)argv[i]);
|
||||
}
|
||||
ch_logs(NULL, "Starting job: %s", (char *)ga.ga_data);
|
||||
ch_log(NULL, "Starting job: %s", (char *)ga.ga_data);
|
||||
ga_clear(&ga);
|
||||
}
|
||||
mch_job_start(argv, job, &opt);
|
||||
#else
|
||||
ch_logs(NULL, "Starting job: %s", (char *)cmd);
|
||||
ch_log(NULL, "Starting job: %s", (char *)cmd);
|
||||
mch_job_start((char *)cmd, job, &opt);
|
||||
#endif
|
||||
|
||||
@@ -5189,6 +5161,8 @@ job_info(job_T *job, dict_T *dict)
|
||||
nr = job->jv_proc_info.dwProcessId;
|
||||
#endif
|
||||
dict_add_nr_str(dict, "process", nr, NULL);
|
||||
dict_add_nr_str(dict, "tty", 0L,
|
||||
job->jv_tty_name != NULL ? job->jv_tty_name : (char_u *)"");
|
||||
|
||||
dict_add_nr_str(dict, "exitval", job->jv_exitval, NULL);
|
||||
dict_add_nr_str(dict, "exit_cb", 0L, job->jv_exit_cb);
|
||||
@@ -5228,7 +5202,7 @@ job_stop(job_T *job, typval_T *argvars, char *type)
|
||||
ch_log(job->jv_channel, "Job has already ended, job_stop() skipped");
|
||||
return 0;
|
||||
}
|
||||
ch_logs(job->jv_channel, "Stopping job with '%s'", (char *)arg);
|
||||
ch_log(job->jv_channel, "Stopping job with '%s'", (char *)arg);
|
||||
if (mch_stop_job(job, arg) == FAIL)
|
||||
return 0;
|
||||
|
||||
|
||||
+24
-8
@@ -5329,6 +5329,10 @@ garbage_collect(int testing)
|
||||
abort = abort || set_ref_in_quickfix(copyID);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_TERMINAL
|
||||
abort = abort || set_ref_in_term(copyID);
|
||||
#endif
|
||||
|
||||
if (!abort)
|
||||
{
|
||||
/*
|
||||
@@ -5679,9 +5683,9 @@ get_var_special_name(int nr)
|
||||
* If the memory is allocated "tofree" is set to it, otherwise NULL.
|
||||
* "numbuf" is used for a number.
|
||||
* When "copyID" is not NULL replace recursive lists and dicts with "...".
|
||||
* When both "echo_style" and "dict_val" are FALSE, put quotes around stings as
|
||||
* "string()", otherwise does not put quotes around strings, as ":echo"
|
||||
* displays values.
|
||||
* When both "echo_style" and "composite_val" are FALSE, put quotes around
|
||||
* stings as "string()", otherwise does not put quotes around strings, as
|
||||
* ":echo" displays values.
|
||||
* When "restore_copyID" is FALSE, repeated items in dictionaries and lists
|
||||
* are replaced with "...".
|
||||
* May return NULL.
|
||||
@@ -5694,7 +5698,7 @@ echo_string_core(
|
||||
int copyID,
|
||||
int echo_style,
|
||||
int restore_copyID,
|
||||
int dict_val)
|
||||
int composite_val)
|
||||
{
|
||||
static int recurse = 0;
|
||||
char_u *r = NULL;
|
||||
@@ -5717,10 +5721,12 @@ echo_string_core(
|
||||
switch (tv->v_type)
|
||||
{
|
||||
case VAR_STRING:
|
||||
if (echo_style && !dict_val)
|
||||
if (echo_style && !composite_val)
|
||||
{
|
||||
*tofree = NULL;
|
||||
r = get_tv_string_buf(tv, numbuf);
|
||||
r = tv->vval.v_string;
|
||||
if (r == NULL)
|
||||
r = (char_u *)"";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5837,10 +5843,19 @@ echo_string_core(
|
||||
|
||||
case VAR_NUMBER:
|
||||
case VAR_UNKNOWN:
|
||||
*tofree = NULL;
|
||||
r = get_tv_string_buf(tv, numbuf);
|
||||
break;
|
||||
|
||||
case VAR_JOB:
|
||||
case VAR_CHANNEL:
|
||||
*tofree = NULL;
|
||||
r = get_tv_string_buf(tv, numbuf);
|
||||
if (composite_val)
|
||||
{
|
||||
*tofree = string_quote(r, FALSE);
|
||||
r = *tofree;
|
||||
}
|
||||
break;
|
||||
|
||||
case VAR_FLOAT:
|
||||
@@ -8066,8 +8081,9 @@ get_user_input(
|
||||
rettv->vval.v_string = NULL;
|
||||
|
||||
#ifdef NO_CONSOLE_INPUT
|
||||
/* While starting up, there is no place to enter text. */
|
||||
if (no_console_input())
|
||||
/* While starting up, there is no place to enter text. When running tests
|
||||
* with --not-a-term we assume feedkeys() will be used. */
|
||||
if (no_console_input() && !is_not_a_term())
|
||||
return;
|
||||
#endif
|
||||
|
||||
|
||||
+60
-10
@@ -830,6 +830,21 @@ static struct fst
|
||||
{"tanh", 1, 1, f_tanh},
|
||||
#endif
|
||||
{"tempname", 0, 0, f_tempname},
|
||||
#ifdef FEAT_TERMINAL
|
||||
{"term_getattr", 2, 2, f_term_getattr},
|
||||
{"term_getcursor", 1, 1, f_term_getcursor},
|
||||
{"term_getjob", 1, 1, f_term_getjob},
|
||||
{"term_getline", 2, 2, f_term_getline},
|
||||
{"term_getsize", 1, 1, f_term_getsize},
|
||||
{"term_getstatus", 1, 1, f_term_getstatus},
|
||||
{"term_gettitle", 1, 1, f_term_gettitle},
|
||||
{"term_gettty", 1, 1, f_term_gettty},
|
||||
{"term_list", 0, 0, f_term_list},
|
||||
{"term_scrape", 2, 2, f_term_scrape},
|
||||
{"term_sendkeys", 2, 2, f_term_sendkeys},
|
||||
{"term_start", 1, 2, f_term_start},
|
||||
{"term_wait", 1, 2, f_term_wait},
|
||||
#endif
|
||||
{"test_alloc_fail", 3, 3, f_test_alloc_fail},
|
||||
{"test_autochdir", 0, 0, f_test_autochdir},
|
||||
{"test_garbagecollect_now", 0, 0, f_test_garbagecollect_now},
|
||||
@@ -1540,7 +1555,7 @@ buflist_find_by_name(char_u *name, int curtab_only)
|
||||
/*
|
||||
* Get buffer by number or pattern.
|
||||
*/
|
||||
static buf_T *
|
||||
buf_T *
|
||||
get_buf_tv(typval_T *tv, int curtab_only)
|
||||
{
|
||||
char_u *name = tv->vval.v_string;
|
||||
@@ -1915,6 +1930,9 @@ f_ch_logfile(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
char_u *opt = (char_u *)"";
|
||||
char_u buf[NUMBUFLEN];
|
||||
|
||||
/* Don't open a file in restricted mode. */
|
||||
if (check_restricted() || check_secure())
|
||||
return;
|
||||
fname = get_tv_string(&argvars[0]);
|
||||
if (argvars[1].v_type == VAR_STRING)
|
||||
opt = get_tv_string_buf(&argvars[1], buf);
|
||||
@@ -2314,8 +2332,45 @@ f_count(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
long n = 0;
|
||||
int ic = FALSE;
|
||||
int error = FALSE;
|
||||
|
||||
if (argvars[0].v_type == VAR_LIST)
|
||||
if (argvars[2].v_type != VAR_UNKNOWN)
|
||||
ic = (int)get_tv_number_chk(&argvars[2], &error);
|
||||
|
||||
if (argvars[0].v_type == VAR_STRING)
|
||||
{
|
||||
char_u *expr = get_tv_string_chk(&argvars[1]);
|
||||
char_u *p = argvars[0].vval.v_string;
|
||||
char_u *next;
|
||||
|
||||
if (!error && expr != NULL && p != NULL)
|
||||
{
|
||||
if (ic)
|
||||
{
|
||||
size_t len = STRLEN(expr);
|
||||
|
||||
while (*p != NUL)
|
||||
{
|
||||
if (MB_STRNICMP(p, expr, len) == 0)
|
||||
{
|
||||
++n;
|
||||
p += len;
|
||||
}
|
||||
else
|
||||
MB_PTR_ADV(p);
|
||||
}
|
||||
}
|
||||
else
|
||||
while ((next = (char_u *)strstr((char *)p, (char *)expr))
|
||||
!= NULL)
|
||||
{
|
||||
++n;
|
||||
p = next + STRLEN(expr);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (argvars[0].v_type == VAR_LIST)
|
||||
{
|
||||
listitem_T *li;
|
||||
list_T *l;
|
||||
@@ -2326,9 +2381,6 @@ f_count(typval_T *argvars, typval_T *rettv)
|
||||
li = l->lv_first;
|
||||
if (argvars[2].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
int error = FALSE;
|
||||
|
||||
ic = (int)get_tv_number_chk(&argvars[2], &error);
|
||||
if (argvars[3].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
idx = (long)get_tv_number_chk(&argvars[3], &error);
|
||||
@@ -2356,11 +2408,8 @@ f_count(typval_T *argvars, typval_T *rettv)
|
||||
|
||||
if ((d = argvars[0].vval.v_dict) != NULL)
|
||||
{
|
||||
int error = FALSE;
|
||||
|
||||
if (argvars[2].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
ic = (int)get_tv_number_chk(&argvars[2], &error);
|
||||
if (argvars[3].v_type != VAR_UNKNOWN)
|
||||
EMSG(_(e_invarg));
|
||||
}
|
||||
@@ -6459,8 +6508,9 @@ f_inputlist(typval_T *argvars, typval_T *rettv)
|
||||
int mouse_used;
|
||||
|
||||
#ifdef NO_CONSOLE_INPUT
|
||||
/* While starting up, there is no place to enter text. */
|
||||
if (no_console_input())
|
||||
/* While starting up, there is no place to enter text. When running tests
|
||||
* with --not-a-term we assume feedkeys() will be used. */
|
||||
if (no_console_input() && !is_not_a_term())
|
||||
return;
|
||||
#endif
|
||||
if (argvars[0].v_type != VAR_LIST || argvars[0].vval.v_list == NULL)
|
||||
|
||||
+6
-6
@@ -3561,7 +3561,7 @@ getfile(
|
||||
|
||||
if (other)
|
||||
++no_wait_return; /* don't wait for autowrite message */
|
||||
if (other && !forceit && curbuf->b_nwindows == 1 && !P_HID(curbuf)
|
||||
if (other && !forceit && curbuf->b_nwindows == 1 && !buf_hide(curbuf)
|
||||
&& curbufIsChanged() && autowrite(curbuf, forceit) == FAIL)
|
||||
{
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
@@ -3590,7 +3590,7 @@ getfile(
|
||||
retval = GETFILE_SAME_FILE; /* it's in the same file */
|
||||
}
|
||||
else if (do_ecmd(fnum, ffname, sfname, NULL, lnum,
|
||||
(P_HID(curbuf) ? ECMD_HIDE : 0) + (forceit ? ECMD_FORCEIT : 0),
|
||||
(buf_hide(curbuf) ? ECMD_HIDE : 0) + (forceit ? ECMD_FORCEIT : 0),
|
||||
curwin) == OK)
|
||||
retval = GETFILE_OPEN_OTHER; /* opened another file */
|
||||
else
|
||||
@@ -6314,7 +6314,7 @@ ex_help(exarg_T *eap)
|
||||
* Re-use an existing help window or open a new one.
|
||||
* Always open a new one for ":tab help".
|
||||
*/
|
||||
if (!curwin->w_buffer->b_help
|
||||
if (!bt_help(curwin->w_buffer)
|
||||
#ifdef FEAT_WINDOWS
|
||||
|| cmdmod.tab != 0
|
||||
#endif
|
||||
@@ -6325,7 +6325,7 @@ ex_help(exarg_T *eap)
|
||||
wp = NULL;
|
||||
else
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
if (wp->w_buffer != NULL && wp->w_buffer->b_help)
|
||||
if (bt_help(wp->w_buffer))
|
||||
break;
|
||||
if (wp != NULL && wp->w_buffer->b_nwindows > 0)
|
||||
win_enter(wp, TRUE);
|
||||
@@ -6425,7 +6425,7 @@ ex_helpclose(exarg_T *eap UNUSED)
|
||||
|
||||
FOR_ALL_WINDOWS(win)
|
||||
{
|
||||
if (win->w_buffer->b_help)
|
||||
if (bt_help(win->w_buffer))
|
||||
{
|
||||
win_close(win, FALSE);
|
||||
return;
|
||||
@@ -8401,7 +8401,7 @@ ex_drop(exarg_T *eap)
|
||||
* Skip the check if the 'hidden' option is set, as in this case the
|
||||
* buffer won't be lost.
|
||||
*/
|
||||
if (!P_HID(curbuf))
|
||||
if (!buf_hide(curbuf))
|
||||
{
|
||||
# ifdef FEAT_WINDOWS
|
||||
++emsg_off;
|
||||
|
||||
+1
-1
@@ -1490,7 +1490,7 @@ EX(CMD_tearoff, "tearoff", ex_tearoff,
|
||||
NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN,
|
||||
ADDR_LINES),
|
||||
EX(CMD_terminal, "terminal", ex_terminal,
|
||||
RANGE|NOTADR|EXTRA|TRLBAR|CMDWIN,
|
||||
RANGE|NOTADR|FILES|TRLBAR|CMDWIN,
|
||||
ADDR_OTHER),
|
||||
EX(CMD_tfirst, "tfirst", ex_tag,
|
||||
RANGE|NOTADR|BANG|TRLBAR|ZEROR,
|
||||
|
||||
+24
-11
@@ -2137,7 +2137,7 @@ dialog_changed(
|
||||
int
|
||||
can_abandon(buf_T *buf, int forceit)
|
||||
{
|
||||
return ( P_HID(buf)
|
||||
return ( buf_hide(buf)
|
||||
|| !bufIsChanged(buf)
|
||||
|| buf->b_nwindows > 1
|
||||
|| autowrite(buf, forceit) == OK
|
||||
@@ -2253,7 +2253,14 @@ check_changed_any(
|
||||
msg_col = 0;
|
||||
msg_didout = FALSE;
|
||||
}
|
||||
if (EMSG2(_("E162: No write since last change for buffer \"%s\""),
|
||||
if (
|
||||
#ifdef FEAT_TERMINAL
|
||||
term_job_running(buf->b_term)
|
||||
? EMSG2(_("E947: Job still running in buffer \"%s\""),
|
||||
buf->b_fname)
|
||||
:
|
||||
#endif
|
||||
EMSG2(_("E162: No write since last change for buffer \"%s\""),
|
||||
buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname))
|
||||
{
|
||||
save = no_wait_return;
|
||||
@@ -2393,8 +2400,8 @@ do_one_arg(char_u *str)
|
||||
* Separate the arguments in "str" and return a list of pointers in the
|
||||
* growarray "gap".
|
||||
*/
|
||||
int
|
||||
get_arglist(garray_T *gap, char_u *str)
|
||||
static int
|
||||
get_arglist(garray_T *gap, char_u *str, int escaped)
|
||||
{
|
||||
ga_init2(gap, (int)sizeof(char_u *), 20);
|
||||
while (*str != NUL)
|
||||
@@ -2406,6 +2413,10 @@ get_arglist(garray_T *gap, char_u *str)
|
||||
}
|
||||
((char_u **)gap->ga_data)[gap->ga_len++] = str;
|
||||
|
||||
/* If str is escaped, don't handle backslashes or spaces */
|
||||
if (!escaped)
|
||||
return OK;
|
||||
|
||||
/* Isolate one argument, change it in-place, put a NUL after it. */
|
||||
str = do_one_arg(str);
|
||||
}
|
||||
@@ -2428,7 +2439,7 @@ get_arglist_exp(
|
||||
garray_T ga;
|
||||
int i;
|
||||
|
||||
if (get_arglist(&ga, str) == FAIL)
|
||||
if (get_arglist(&ga, str, TRUE) == FAIL)
|
||||
return FAIL;
|
||||
if (wig == TRUE)
|
||||
i = expand_wildcards(ga.ga_len, (char_u **)ga.ga_data,
|
||||
@@ -2474,6 +2485,7 @@ do_arglist(
|
||||
char_u *p;
|
||||
int match;
|
||||
#endif
|
||||
int arg_escaped = TRUE;
|
||||
|
||||
/*
|
||||
* Set default argument for ":argadd" command.
|
||||
@@ -2483,12 +2495,13 @@ do_arglist(
|
||||
if (curbuf->b_ffname == NULL)
|
||||
return FAIL;
|
||||
str = curbuf->b_fname;
|
||||
arg_escaped = FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Collect all file name arguments in "new_ga".
|
||||
*/
|
||||
if (get_arglist(&new_ga, str) == FAIL)
|
||||
if (get_arglist(&new_ga, str, arg_escaped) == FAIL)
|
||||
return FAIL;
|
||||
|
||||
#ifdef FEAT_LISTCMDS
|
||||
@@ -2801,13 +2814,13 @@ do_argfile(exarg_T *eap, int argn)
|
||||
* the same buffer
|
||||
*/
|
||||
other = TRUE;
|
||||
if (P_HID(curbuf))
|
||||
if (buf_hide(curbuf))
|
||||
{
|
||||
p = fix_fname(alist_name(&ARGLIST[argn]));
|
||||
other = otherfile(p);
|
||||
vim_free(p);
|
||||
}
|
||||
if ((!P_HID(curbuf) || !other)
|
||||
if ((!buf_hide(curbuf) || !other)
|
||||
&& check_changed(curbuf, CCGD_AW
|
||||
| (other ? 0 : CCGD_MULTWIN)
|
||||
| (eap->forceit ? CCGD_FORCEIT : 0)
|
||||
@@ -2828,7 +2841,7 @@ do_argfile(exarg_T *eap, int argn)
|
||||
* argument index. */
|
||||
if (do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL,
|
||||
eap, ECMD_LAST,
|
||||
(P_HID(curwin->w_buffer) ? ECMD_HIDE : 0)
|
||||
(buf_hide(curwin->w_buffer) ? ECMD_HIDE : 0)
|
||||
+ (eap->forceit ? ECMD_FORCEIT : 0), curwin) == FAIL)
|
||||
curwin->w_arg_idx = old_arg_idx;
|
||||
/* like Vi: set the mark where the cursor is in the file. */
|
||||
@@ -2849,7 +2862,7 @@ ex_next(exarg_T *eap)
|
||||
* check for changed buffer now, if this fails the argument list is not
|
||||
* redefined.
|
||||
*/
|
||||
if ( P_HID(curbuf)
|
||||
if ( buf_hide(curbuf)
|
||||
|| eap->cmdidx == CMD_snext
|
||||
|| !check_changed(curbuf, CCGD_AW
|
||||
| (eap->forceit ? CCGD_FORCEIT : 0)
|
||||
@@ -3004,7 +3017,7 @@ ex_listdo(exarg_T *eap)
|
||||
|
||||
if (eap->cmdidx == CMD_windo
|
||||
|| eap->cmdidx == CMD_tabdo
|
||||
|| P_HID(curbuf)
|
||||
|| buf_hide(curbuf)
|
||||
|| !check_changed(curbuf, CCGD_AW
|
||||
| (eap->forceit ? CCGD_FORCEIT : 0)
|
||||
| CCGD_EXCMD))
|
||||
|
||||
+45
-20
@@ -2639,6 +2639,7 @@ do_one_cmd(
|
||||
* Any others?
|
||||
*/
|
||||
else if (ea.cmdidx == CMD_bang
|
||||
|| ea.cmdidx == CMD_terminal
|
||||
|| ea.cmdidx == CMD_global
|
||||
|| ea.cmdidx == CMD_vglobal
|
||||
|| ea.usefilter)
|
||||
@@ -3795,7 +3796,7 @@ set_one_cmd_context(
|
||||
xp->xp_context = EXPAND_FILES;
|
||||
|
||||
/* For a shell command more chars need to be escaped. */
|
||||
if (usefilter || ea.cmdidx == CMD_bang)
|
||||
if (usefilter || ea.cmdidx == CMD_bang || ea.cmdidx == CMD_terminal)
|
||||
{
|
||||
#ifndef BACKSLASH_IN_FILENAME
|
||||
xp->xp_shell = TRUE;
|
||||
@@ -4229,6 +4230,19 @@ set_one_cmd_context(
|
||||
case CMD_xunmap:
|
||||
return set_context_in_map_cmd(xp, cmd, arg, forceit,
|
||||
FALSE, TRUE, ea.cmdidx);
|
||||
case CMD_mapclear:
|
||||
case CMD_nmapclear:
|
||||
case CMD_vmapclear:
|
||||
case CMD_omapclear:
|
||||
case CMD_imapclear:
|
||||
case CMD_cmapclear:
|
||||
case CMD_lmapclear:
|
||||
case CMD_smapclear:
|
||||
case CMD_xmapclear:
|
||||
xp->xp_context = EXPAND_MAPCLEAR;
|
||||
xp->xp_pattern = arg;
|
||||
break;
|
||||
|
||||
case CMD_abbreviate: case CMD_noreabbrev:
|
||||
case CMD_cabbrev: case CMD_cnoreabbrev:
|
||||
case CMD_iabbrev: case CMD_inoreabbrev:
|
||||
@@ -5057,13 +5071,14 @@ expand_filename(
|
||||
if (!eap->usefilter
|
||||
&& !escaped
|
||||
&& eap->cmdidx != CMD_bang
|
||||
&& eap->cmdidx != CMD_make
|
||||
&& eap->cmdidx != CMD_lmake
|
||||
&& eap->cmdidx != CMD_grep
|
||||
&& eap->cmdidx != CMD_lgrep
|
||||
&& eap->cmdidx != CMD_grepadd
|
||||
&& eap->cmdidx != CMD_lgrepadd
|
||||
&& eap->cmdidx != CMD_hardcopy
|
||||
&& eap->cmdidx != CMD_lgrep
|
||||
&& eap->cmdidx != CMD_lgrepadd
|
||||
&& eap->cmdidx != CMD_lmake
|
||||
&& eap->cmdidx != CMD_make
|
||||
&& eap->cmdidx != CMD_terminal
|
||||
#ifndef UNIX
|
||||
&& !(eap->argt & NOSPC)
|
||||
#endif
|
||||
@@ -5093,7 +5108,8 @@ expand_filename(
|
||||
}
|
||||
|
||||
/* For a shell command a '!' must be escaped. */
|
||||
if ((eap->usefilter || eap->cmdidx == CMD_bang)
|
||||
if ((eap->usefilter || eap->cmdidx == CMD_bang
|
||||
|| eap->cmdidx == CMD_terminal)
|
||||
&& vim_strpbrk(repl, (char_u *)"!") != NULL)
|
||||
{
|
||||
char_u *l;
|
||||
@@ -5978,6 +5994,7 @@ static struct
|
||||
&& (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
|
||||
{EXPAND_LOCALES, "locale"},
|
||||
#endif
|
||||
{EXPAND_MAPCLEAR, "mapclear"},
|
||||
{EXPAND_MAPPINGS, "mapping"},
|
||||
{EXPAND_MENUS, "menu"},
|
||||
{EXPAND_MESSAGES, "messages"},
|
||||
@@ -7305,7 +7322,7 @@ ex_quit(exarg_T *eap)
|
||||
*/
|
||||
if (check_more(FALSE, eap->forceit) == OK && only_one_window())
|
||||
exiting = TRUE;
|
||||
if ((!P_HID(curbuf)
|
||||
if ((!buf_hide(curbuf)
|
||||
&& check_changed(curbuf, (p_awa ? CCGD_AW : 0)
|
||||
| (eap->forceit ? CCGD_FORCEIT : 0)
|
||||
| CCGD_EXCMD))
|
||||
@@ -7332,7 +7349,7 @@ ex_quit(exarg_T *eap)
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
/* close window; may free buffer */
|
||||
win_close(wp, !P_HID(wp->w_buffer) || eap->forceit);
|
||||
win_close(wp, !buf_hide(wp->w_buffer) || eap->forceit);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -7452,7 +7469,7 @@ ex_win_close(
|
||||
buf_T *buf = win->w_buffer;
|
||||
|
||||
need_hide = (bufIsChanged(buf) && buf->b_nwindows <= 1);
|
||||
if (need_hide && !P_HID(buf) && !forceit)
|
||||
if (need_hide && !buf_hide(buf) && !forceit)
|
||||
{
|
||||
# if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
if ((p_confirm || cmdmod.confirm) && p_write)
|
||||
@@ -7479,9 +7496,9 @@ ex_win_close(
|
||||
|
||||
/* free buffer when not hiding it or when it's a scratch buffer */
|
||||
if (tp == NULL)
|
||||
win_close(win, !need_hide && !P_HID(buf));
|
||||
win_close(win, !need_hide && !buf_hide(buf));
|
||||
else
|
||||
win_close_othertab(win, !need_hide && !P_HID(buf), tp);
|
||||
win_close_othertab(win, !need_hide && !buf_hide(buf), tp);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -7878,7 +7895,7 @@ ex_exit(exarg_T *eap)
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
/* Quit current window, may free the buffer. */
|
||||
win_close(curwin, !P_HID(curwin->w_buffer));
|
||||
win_close(curwin, !buf_hide(curwin->w_buffer));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -7975,7 +7992,7 @@ handle_drop(
|
||||
* We don't need to check if the 'hidden' option is set, as in this
|
||||
* case the buffer won't be lost.
|
||||
*/
|
||||
if (!P_HID(curbuf) && !split)
|
||||
if (!buf_hide(curbuf) && !split)
|
||||
{
|
||||
++emsg_off;
|
||||
split = check_changed(curbuf, CCGD_AW);
|
||||
@@ -8762,7 +8779,7 @@ do_exedit(
|
||||
(*eap->arg == NUL && eap->do_ecmd_lnum == 0
|
||||
&& vim_strchr(p_cpo, CPO_GOTO1) != NULL)
|
||||
? ECMD_ONE : eap->do_ecmd_lnum,
|
||||
(P_HID(curbuf) ? ECMD_HIDE : 0)
|
||||
(buf_hide(curbuf) ? ECMD_HIDE : 0)
|
||||
+ (eap->forceit ? ECMD_FORCEIT : 0)
|
||||
/* after a split we can use an existing buffer */
|
||||
+ (old_curwin != NULL ? ECMD_OLDBUF : 0)
|
||||
@@ -8776,7 +8793,7 @@ do_exedit(
|
||||
if (old_curwin != NULL)
|
||||
{
|
||||
need_hide = (curbufIsChanged() && curbuf->b_nwindows <= 1);
|
||||
if (!need_hide || P_HID(curbuf))
|
||||
if (!need_hide || buf_hide(curbuf))
|
||||
{
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
cleanup_T cs;
|
||||
@@ -8788,7 +8805,7 @@ do_exedit(
|
||||
# ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
win_close(curwin, !need_hide && !P_HID(curbuf));
|
||||
win_close(curwin, !need_hide && !buf_hide(curbuf));
|
||||
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
/* Restore the error/interrupt/exception state if not
|
||||
@@ -10543,7 +10560,7 @@ ex_pedit(exarg_T *eap)
|
||||
|
||||
g_do_tagpreview = p_pvh;
|
||||
prepare_tagpreview(TRUE);
|
||||
keep_help_flag = curwin_save->w_buffer->b_help;
|
||||
keep_help_flag = bt_help(curwin_save->w_buffer);
|
||||
do_exedit(eap, NULL);
|
||||
keep_help_flag = FALSE;
|
||||
if (curwin != curwin_save && win_valid(curwin_save))
|
||||
@@ -11300,7 +11317,7 @@ makeopens(
|
||||
{
|
||||
if (ses_do_win(wp)
|
||||
&& wp->w_buffer->b_ffname != NULL
|
||||
&& !wp->w_buffer->b_help
|
||||
&& !bt_help(wp->w_buffer)
|
||||
#ifdef FEAT_QUICKFIX
|
||||
&& !bt_nofile(wp->w_buffer)
|
||||
#endif
|
||||
@@ -11584,7 +11601,7 @@ ses_do_win(win_T *wp)
|
||||
#endif
|
||||
)
|
||||
return (ssop_flags & SSOP_BLANK);
|
||||
if (wp->w_buffer->b_help)
|
||||
if (bt_help(wp->w_buffer))
|
||||
return (ssop_flags & SSOP_HELP);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -11714,7 +11731,7 @@ put_view(
|
||||
*/
|
||||
if ((*flagp & SSOP_FOLDS)
|
||||
&& wp->w_buffer->b_ffname != NULL
|
||||
&& (*wp->w_buffer->b_p_bt == NUL || wp->w_buffer->b_help))
|
||||
&& (*wp->w_buffer->b_p_bt == NUL || bt_help(wp->w_buffer)))
|
||||
{
|
||||
if (put_folds(fd, wp) == FAIL)
|
||||
return FAIL;
|
||||
@@ -12115,6 +12132,14 @@ get_messages_arg(expand_T *xp UNUSED, int idx)
|
||||
}
|
||||
#endif
|
||||
|
||||
char_u *
|
||||
get_mapclear_arg(expand_T *xp UNUSED, int idx)
|
||||
{
|
||||
if (idx == 0)
|
||||
return (char_u *)"<buffer>";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
static int filetype_detect = FALSE;
|
||||
static int filetype_plugin = FALSE;
|
||||
|
||||
@@ -4890,6 +4890,7 @@ ExpandFromContext(
|
||||
{
|
||||
{EXPAND_COMMANDS, get_command_name, FALSE, TRUE},
|
||||
{EXPAND_BEHAVE, get_behave_arg, TRUE, TRUE},
|
||||
{EXPAND_MAPCLEAR, get_mapclear_arg, TRUE, TRUE},
|
||||
{EXPAND_MESSAGES, get_messages_arg, TRUE, TRUE},
|
||||
#ifdef FEAT_CMDHIST
|
||||
{EXPAND_HISTORY, get_history_arg, TRUE, TRUE},
|
||||
|
||||
@@ -4262,43 +4262,6 @@ py_fix_cursor(linenr_T lo, linenr_T hi, linenr_T extra)
|
||||
invalidate_botline();
|
||||
}
|
||||
|
||||
/*
|
||||
* Find a window that contains "buf" and switch to it.
|
||||
* If there is no such window, use the current window and change "curbuf".
|
||||
* Caller must initialize save_curbuf to NULL.
|
||||
* restore_win_for_buf() MUST be called later!
|
||||
*/
|
||||
static void
|
||||
switch_to_win_for_buf(
|
||||
buf_T *buf,
|
||||
win_T **save_curwinp,
|
||||
tabpage_T **save_curtabp,
|
||||
bufref_T *save_curbuf)
|
||||
{
|
||||
win_T *wp;
|
||||
tabpage_T *tp;
|
||||
|
||||
if (find_win_for_buf(buf, &wp, &tp) == FAIL)
|
||||
switch_buffer(save_curbuf, buf);
|
||||
else if (switch_win(save_curwinp, save_curtabp, wp, tp, TRUE) == FAIL)
|
||||
{
|
||||
restore_win(*save_curwinp, *save_curtabp, TRUE);
|
||||
switch_buffer(save_curbuf, buf);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
restore_win_for_buf(
|
||||
win_T *save_curwin,
|
||||
tabpage_T *save_curtab,
|
||||
bufref_T *save_curbuf)
|
||||
{
|
||||
if (save_curbuf->br_buf == NULL)
|
||||
restore_win(save_curwin, save_curtab, TRUE);
|
||||
else
|
||||
restore_buffer(save_curbuf);
|
||||
}
|
||||
|
||||
/*
|
||||
* Replace a line in the specified buffer. The line number is
|
||||
* in Vim format (1-based). The replacement line is given as
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
CFLAGS = /DINLINE= /Iinclude
|
||||
|
||||
OBJS = \
|
||||
src\encoding.c \
|
||||
src\keyboard.c \
|
||||
src\mouse.c \
|
||||
src\parser.c \
|
||||
src\pen.c \
|
||||
src\screen.c \
|
||||
src\state.c \
|
||||
src\unicode.c \
|
||||
src\vterm.c
|
||||
|
||||
OBJS = \
|
||||
src\encoding.obj \
|
||||
src\keyboard.obj \
|
||||
src\mouse.obj \
|
||||
src\parser.obj \
|
||||
src\pen.obj \
|
||||
src\screen.obj \
|
||||
src\state.obj \
|
||||
src\unicode.obj \
|
||||
src\vterm.obj
|
||||
|
||||
all : vterm.lib
|
||||
|
||||
|
||||
.c.obj :
|
||||
cl $(CFLAGS) /Fo$@ /c $<
|
||||
|
||||
vterm.lib : $(OBJS)
|
||||
lib /OUT:$@ $(OBJS)
|
||||
|
||||
clean:
|
||||
del $(OBJS) vterm.lib
|
||||
@@ -265,7 +265,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
vt = vterm_new(rows, cols);
|
||||
vterm_set_utf8(vt, true);
|
||||
vterm_set_utf8(vt, TRUE);
|
||||
|
||||
vts = vterm_obtain_screen(vt);
|
||||
vterm_screen_set_callbacks(vts, &cb_screen, NULL);
|
||||
|
||||
@@ -8,12 +8,17 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "vterm_keycodes.h"
|
||||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
/* from stdint.h */
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned int uint32_t;
|
||||
|
||||
typedef struct VTerm VTerm;
|
||||
typedef struct VTermState VTermState;
|
||||
typedef struct VTermScreen VTermScreen;
|
||||
@@ -183,7 +188,7 @@ void vterm_keyboard_start_paste(VTerm *vt);
|
||||
void vterm_keyboard_end_paste(VTerm *vt);
|
||||
|
||||
void vterm_mouse_move(VTerm *vt, int row, int col, VTermModifier mod);
|
||||
void vterm_mouse_button(VTerm *vt, int button, bool pressed, VTermModifier mod);
|
||||
void vterm_mouse_button(VTerm *vt, int button, int pressed, VTermModifier mod);
|
||||
|
||||
/* ------------
|
||||
* Parser layer
|
||||
@@ -235,6 +240,8 @@ typedef struct {
|
||||
int (*erase)(VTermRect rect, int selective, void *user);
|
||||
int (*initpen)(void *user);
|
||||
int (*setpenattr)(VTermAttr attr, VTermValue *val, void *user);
|
||||
/* Callback for setting various properties. Must return 1 if the property
|
||||
* was accepted, 0 otherwise. */
|
||||
int (*settermprop)(VTermProp prop, VTermValue *val, void *user);
|
||||
int (*bell)(void *user);
|
||||
int (*resize)(int rows, int cols, VTermPos *delta, void *user);
|
||||
|
||||
@@ -70,7 +70,7 @@ void vterm_mouse_move(VTerm *vt, int row, int col, VTermModifier mod)
|
||||
}
|
||||
}
|
||||
|
||||
void vterm_mouse_button(VTerm *vt, int button, bool pressed, VTermModifier mod)
|
||||
void vterm_mouse_button(VTerm *vt, int button, int pressed, VTermModifier mod)
|
||||
{
|
||||
VTermState *state = vt->state;
|
||||
|
||||
@@ -86,6 +86,8 @@ void vterm_mouse_button(VTerm *vt, int button, bool pressed, VTermModifier mod)
|
||||
/* Most of the time we don't get button releases from 4/5 */
|
||||
if(state->mouse_buttons == old_buttons && button < 4)
|
||||
return;
|
||||
if (!(state->mouse_flags & MOUSE_WANT_CLICK))
|
||||
return;
|
||||
|
||||
if(button < 4) {
|
||||
output_mouse(state, button-1, pressed, mod, state->mouse_col, state->mouse_row);
|
||||
|
||||
+11
-11
@@ -33,17 +33,17 @@ static int ramp24[] = {
|
||||
0x85, 0x90, 0x9B, 0xA6, 0xB1, 0xBC, 0xC7, 0xD2, 0xDD, 0xE8, 0xF3, 0xFF,
|
||||
};
|
||||
|
||||
static bool lookup_colour_ansi(const VTermState *state, long index, VTermColor *col)
|
||||
static int lookup_colour_ansi(const VTermState *state, long index, VTermColor *col)
|
||||
{
|
||||
if(index >= 0 && index < 16) {
|
||||
*col = state->colors[index];
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool lookup_colour_palette(const VTermState *state, long index, VTermColor *col)
|
||||
static int lookup_colour_palette(const VTermState *state, long index, VTermColor *col)
|
||||
{
|
||||
if(index >= 0 && index < 16) {
|
||||
/* Normal 8 colours or high intensity - parse as palette 0 */
|
||||
@@ -57,7 +57,7 @@ static bool lookup_colour_palette(const VTermState *state, long index, VTermColo
|
||||
col->green = ramp6[index/6 % 6];
|
||||
col->red = ramp6[index/6/6 % 6];
|
||||
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
else if(index >= 232 && index < 256) {
|
||||
/* 24 greyscales */
|
||||
@@ -67,10 +67,10 @@ static bool lookup_colour_palette(const VTermState *state, long index, VTermColo
|
||||
col->green = ramp24[index];
|
||||
col->red = ramp24[index];
|
||||
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int lookup_colour(const VTermState *state, int palette, const long args[], int argcount, VTermColor *col, int *index)
|
||||
@@ -80,9 +80,9 @@ static int lookup_colour(const VTermState *state, int palette, const long args[]
|
||||
if(argcount < 3)
|
||||
return argcount;
|
||||
|
||||
col->red = CSI_ARG(args[0]);
|
||||
col->green = CSI_ARG(args[1]);
|
||||
col->blue = CSI_ARG(args[2]);
|
||||
col->red = (uint8_t)CSI_ARG(args[0]);
|
||||
col->green = (uint8_t)CSI_ARG(args[1]);
|
||||
col->blue = (uint8_t)CSI_ARG(args[2]);
|
||||
|
||||
return 3;
|
||||
|
||||
@@ -106,7 +106,7 @@ static void setpenattr(VTermState *state, VTermAttr attr, VTermValueType type UN
|
||||
{
|
||||
#ifdef DEBUG
|
||||
if(type != vterm_get_attr_type(attr)) {
|
||||
DEBUG_LOG("Cannot set attr %d as it has type %d, not type %d\n",
|
||||
DEBUG_LOG3("Cannot set attr %d as it has type %d, not type %d\n",
|
||||
attr, vterm_get_attr_type(attr), type);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ static int on_text(const char bytes[], size_t len, void *user)
|
||||
&state->encoding[state->gr_set];
|
||||
|
||||
(*encoding->enc->decode)(encoding->enc, encoding->data,
|
||||
codepoints, &npoints, state->gsingle_set ? 1 : len,
|
||||
codepoints, &npoints, state->gsingle_set ? 1 : (int)len,
|
||||
bytes, &eaten, len);
|
||||
|
||||
/* There's a chance an encoding (e.g. UTF-8) hasn't found enough bytes yet
|
||||
@@ -411,7 +411,7 @@ static int on_text(const char bytes[], size_t len, void *user)
|
||||
#endif
|
||||
|
||||
vterm_allocator_free(state->vt, codepoints);
|
||||
return eaten;
|
||||
return (int)eaten;
|
||||
}
|
||||
|
||||
static int on_control(unsigned char control, void *user)
|
||||
@@ -1680,7 +1680,7 @@ VTermState *vterm_obtain_state(VTerm *vt)
|
||||
state->lineinfo = vterm_allocator_malloc(state->vt, state->rows * sizeof(VTermLineInfo));
|
||||
|
||||
state->encoding_utf8.enc = vterm_lookup_encoding(ENC_UTF8, 'u');
|
||||
if(*state->encoding_utf8.enc->init)
|
||||
if(*state->encoding_utf8.enc->init != NULL)
|
||||
(*state->encoding_utf8.enc->init)(state->encoding_utf8.enc, state->encoding_utf8.data);
|
||||
|
||||
vterm_parser_set_callbacks(vt, &parser_callbacks, state);
|
||||
|
||||
@@ -351,7 +351,7 @@ static int screen_damage(VTermRect rect, void *user)
|
||||
rect.start_row, rect.end_row, rect.start_col, rect.end_col);
|
||||
|
||||
if(want_screen_damage_cells) {
|
||||
bool equals = false;
|
||||
int equals = FALSE;
|
||||
int row;
|
||||
int col;
|
||||
|
||||
@@ -373,7 +373,7 @@ static int screen_damage(VTermRect rect, void *user)
|
||||
break;
|
||||
|
||||
if(!equals)
|
||||
printf(" ="), equals = true;
|
||||
printf(" ="), equals = TRUE;
|
||||
|
||||
printf(" %d<", row);
|
||||
for(col = rect.start_col; col < eol; col++) {
|
||||
|
||||
+1
-1
@@ -740,7 +740,7 @@ list_join_inner(
|
||||
for (item = l->lv_first; item != NULL && !got_int; item = item->li_next)
|
||||
{
|
||||
s = echo_string_core(&item->li_tv, &tofree, numbuf, copyID,
|
||||
echo_style, restore_copyID, FALSE);
|
||||
echo_style, restore_copyID, !echo_style);
|
||||
if (s == NULL)
|
||||
return FAIL;
|
||||
|
||||
|
||||
@@ -191,9 +191,6 @@
|
||||
# ifndef WIN32
|
||||
# define mch_access(n, p) access((n), (p))
|
||||
# endif
|
||||
# if !(defined(FEAT_MBYTE) && defined(WIN3264))
|
||||
# define mch_fopen(n, p) fopen((n), (p))
|
||||
# endif
|
||||
# define mch_fstat(n, p) fstat((n), (p))
|
||||
# ifdef MSWIN /* has it's own mch_stat() function */
|
||||
# define mch_stat(n, p) vim_stat((n), (p))
|
||||
@@ -223,10 +220,6 @@
|
||||
* but it is not recommended, because it can destroy indexes etc.
|
||||
*/
|
||||
# define mch_open(n, m, p) open(vms_fixfilename(n), (m), (p))
|
||||
# else
|
||||
# if !(defined(FEAT_MBYTE) && defined(WIN3264))
|
||||
# define mch_open(n, m, p) open((n), (m), (p))
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
+12
-4
@@ -1425,11 +1425,19 @@ main_loop(
|
||||
else
|
||||
{
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (curbuf->b_term != NULL && oa.op_type == OP_NOP
|
||||
&& oa.regname == NUL)
|
||||
terminal_loop();
|
||||
if (term_use_loop()
|
||||
&& oa.op_type == OP_NOP && oa.regname == NUL
|
||||
&& !VIsual_active)
|
||||
{
|
||||
/* If terminal_loop() returns OK we got a key that is handled
|
||||
* in Normal model. With FAIL we first need to position the
|
||||
* cursor and the screen needs to be redrawn. */
|
||||
if (terminal_loop() == OK)
|
||||
normal_cmd(&oa, TRUE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
normal_cmd(&oa, TRUE);
|
||||
normal_cmd(&oa, TRUE);
|
||||
}
|
||||
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
|
||||
+27
-6
@@ -171,10 +171,8 @@ msg_attr_keep(
|
||||
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
if (emsg_to_channel_log)
|
||||
{
|
||||
/* Write message in the channel log. */
|
||||
ch_logs(NULL, "ERROR: %s", (char *)s);
|
||||
}
|
||||
ch_log(NULL, "ERROR: %s", (char *)s);
|
||||
#endif
|
||||
|
||||
/* When displaying keep_msg, don't let msg_start() free it, caller must do
|
||||
@@ -667,7 +665,7 @@ emsg(char_u *s)
|
||||
redir_write(s, -1);
|
||||
}
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
ch_logs(NULL, "ERROR: %s", (char *)s);
|
||||
ch_log(NULL, "ERROR: %s", (char *)s);
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
@@ -2634,10 +2632,30 @@ msg_puts_printf(char_u *str, int maxlen)
|
||||
char_u *s = str;
|
||||
char_u buf[4];
|
||||
char_u *p;
|
||||
|
||||
#ifdef WIN3264
|
||||
# if defined(FEAT_MBYTE) && !defined(FEAT_GUI_MSWIN)
|
||||
char_u *ccp = NULL;
|
||||
|
||||
# endif
|
||||
if (!(silent_mode && p_verbose == 0))
|
||||
mch_settmode(TMODE_COOK); /* handle '\r' and '\n' correctly */
|
||||
|
||||
# if defined(FEAT_MBYTE) && !defined(FEAT_GUI_MSWIN)
|
||||
if (enc_codepage >= 0 && (int)GetConsoleCP() != enc_codepage)
|
||||
{
|
||||
int inlen = (int)STRLEN(str);
|
||||
int outlen;
|
||||
WCHAR *widestr = (WCHAR *)enc_to_utf16(str, &inlen);
|
||||
|
||||
if (widestr != NULL)
|
||||
{
|
||||
WideCharToMultiByte_alloc(GetConsoleCP(), 0, widestr, inlen,
|
||||
(LPSTR *)&ccp, &outlen, 0, 0);
|
||||
vim_free(widestr);
|
||||
s = str = ccp;
|
||||
}
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
while ((maxlen < 0 || (int)(s - str) < maxlen) && *s != NUL)
|
||||
{
|
||||
@@ -2681,6 +2699,9 @@ msg_puts_printf(char_u *str, int maxlen)
|
||||
msg_didout = TRUE; /* assume that line is not empty */
|
||||
|
||||
#ifdef WIN3264
|
||||
# if defined(FEAT_MBYTE) && !defined(FEAT_GUI_MSWIN)
|
||||
vim_free(ccp);
|
||||
# endif
|
||||
if (!(silent_mode && p_verbose == 0))
|
||||
mch_settmode(TMODE_RAW);
|
||||
#endif
|
||||
@@ -5149,7 +5170,7 @@ vim_vsnprintf_typval(
|
||||
{
|
||||
if (str_l < str_m)
|
||||
{
|
||||
size_t avail = str_m-str_l;
|
||||
size_t avail = str_m - str_l;
|
||||
|
||||
vim_memset(str + str_l, '0',
|
||||
(size_t)zn > avail ? avail
|
||||
|
||||
+14
-6
@@ -626,6 +626,9 @@ open_line(
|
||||
int do_si = (!p_paste && curbuf->b_p_si
|
||||
# ifdef FEAT_CINDENT
|
||||
&& !curbuf->b_p_cin
|
||||
# endif
|
||||
# ifdef FEAT_EVAL
|
||||
&& *curbuf->b_p_inde == NUL
|
||||
# endif
|
||||
);
|
||||
int no_si = FALSE; /* reset did_si afterwards */
|
||||
@@ -4183,13 +4186,18 @@ expand_env_esc(
|
||||
}
|
||||
else if ((src[0] == ' ' || src[0] == ',') && !one)
|
||||
at_start = TRUE;
|
||||
*dst++ = *src++;
|
||||
--dstlen;
|
||||
if (dstlen > 0)
|
||||
{
|
||||
*dst++ = *src++;
|
||||
--dstlen;
|
||||
|
||||
if (startstr != NULL && src - startstr_len >= srcp
|
||||
&& STRNCMP(src - startstr_len, startstr, startstr_len) == 0)
|
||||
at_start = TRUE;
|
||||
if (startstr != NULL && src - startstr_len >= srcp
|
||||
&& STRNCMP(src - startstr_len, startstr,
|
||||
startstr_len) == 0)
|
||||
at_start = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
*dst = NUL;
|
||||
}
|
||||
@@ -4644,7 +4652,7 @@ home_replace(
|
||||
*/
|
||||
if (buf != NULL && buf->b_help)
|
||||
{
|
||||
STRCPY(dst, gettail(src));
|
||||
vim_snprintf((char *)dst, dstlen, "%s", gettail(src));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+15
-2
@@ -4655,6 +4655,11 @@ nv_mousescroll(cmdarg_T *cap)
|
||||
|
||||
if (cap->arg == MSCR_UP || cap->arg == MSCR_DOWN)
|
||||
{
|
||||
# ifdef FEAT_TERMINAL
|
||||
if (term_use_loop())
|
||||
send_keys_to_term(curbuf->b_term, cap->cmdchar, TRUE);
|
||||
else
|
||||
# endif
|
||||
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
|
||||
{
|
||||
(void)onepage(cap->arg ? FORWARD : BACKWARD, 1L);
|
||||
@@ -6289,11 +6294,11 @@ nv_gotofile(cmdarg_T *cap)
|
||||
if (ptr != NULL)
|
||||
{
|
||||
/* do autowrite if necessary */
|
||||
if (curbufIsChanged() && curbuf->b_nwindows <= 1 && !P_HID(curbuf))
|
||||
if (curbufIsChanged() && curbuf->b_nwindows <= 1 && !buf_hide(curbuf))
|
||||
(void)autowrite(curbuf, FALSE);
|
||||
setpcmark();
|
||||
if (do_ecmd(0, ptr, NULL, NULL, ECMD_LAST,
|
||||
P_HID(curbuf) ? ECMD_HIDE : 0, curwin) == OK
|
||||
buf_hide(curbuf) ? ECMD_HIDE : 0, curwin) == OK
|
||||
&& cap->nchar == 'F' && lnum >= 0)
|
||||
{
|
||||
curwin->w_cursor.lnum = lnum;
|
||||
@@ -9089,6 +9094,14 @@ nv_edit(cmdarg_T *cap)
|
||||
clearopbeep(cap->oap);
|
||||
#endif
|
||||
}
|
||||
#ifdef FEAT_TERMINAL
|
||||
else if (term_in_normal_mode())
|
||||
{
|
||||
clearop(cap->oap);
|
||||
term_enter_job_mode();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
else if (!curbuf->b_p_ma && !p_im)
|
||||
{
|
||||
/* Only give this error when 'insertmode' is off. */
|
||||
|
||||
@@ -396,7 +396,10 @@ shift_block(oparg_T *oap, int amount)
|
||||
return;
|
||||
|
||||
/* total is number of screen columns to be inserted/removed */
|
||||
total = amount * p_sw;
|
||||
total = (int)((unsigned)amount * (unsigned)p_sw);
|
||||
if ((total / p_sw) != amount)
|
||||
return; /* multiplication overflow */
|
||||
|
||||
oldp = ml_get_curline();
|
||||
|
||||
if (!left)
|
||||
|
||||
+16
-4
@@ -485,8 +485,9 @@ struct vimoption
|
||||
#if defined(FEAT_DIFF) || defined(FEAT_FOLDING) || defined(FEAT_SPELL) \
|
||||
|| defined(FEAT_WINDOWS) || defined(FEAT_CLIPBOARD) \
|
||||
|| defined(FEAT_INS_EXPAND) || defined(FEAT_SYN_HL) \
|
||||
|| defined(FEAT_CONCEAL) || defined(FEAT_QUICKFIX)
|
||||
# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine"
|
||||
|| defined(FEAT_CONCEAL) || defined(FEAT_QUICKFIX) \
|
||||
|| defined(FEAT_TERMINAL)
|
||||
# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,$:StatusLineTerm"
|
||||
#else
|
||||
# define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,t:Title,v:Visual,w:WarningMsg,W:WildMenu,>:SignColumn,*:TabLine,#:TabLineSel,_:TabLineFill"
|
||||
#endif
|
||||
@@ -2863,7 +2864,7 @@ static struct vimoption options[] =
|
||||
{"termkey", "tk", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF,
|
||||
#ifdef FEAT_TERMINAL
|
||||
(char_u *)VAR_WIN, PV_TK,
|
||||
{(char_u *)"\x17", (char_u *)NULL}
|
||||
{(char_u *)"", (char_u *)NULL}
|
||||
#else
|
||||
(char_u *)NULL, PV_NONE,
|
||||
{(char_u *)NULL, (char_u *)0L}
|
||||
@@ -8359,12 +8360,23 @@ set_bool_option(
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_TITLE
|
||||
/* when 'modifiable' is changed, redraw the window title */
|
||||
else if ((int *)varp == &curbuf->b_p_ma)
|
||||
{
|
||||
# ifdef FEAT_TERMINAL
|
||||
/* Cannot set 'modifiable' when in Terminal mode. */
|
||||
if (term_in_normal_mode()
|
||||
|| (bt_terminal(curbuf) && !term_is_finished(curbuf)))
|
||||
{
|
||||
curbuf->b_p_ma = FALSE;
|
||||
return (char_u *)N_("E946: Cannot make a terminal with running job modifiable");
|
||||
}
|
||||
# endif
|
||||
# ifdef FEAT_TITLE
|
||||
redraw_titles();
|
||||
# endif
|
||||
}
|
||||
#ifdef FEAT_TITLE
|
||||
/* when 'endofline' is changed, redraw the window title */
|
||||
else if ((int *)varp == &curbuf->b_p_eol)
|
||||
{
|
||||
|
||||
@@ -570,13 +570,6 @@ EXTERN long p_hh; /* 'helpheight' */
|
||||
EXTERN char_u *p_hlg; /* 'helplang' */
|
||||
#endif
|
||||
EXTERN int p_hid; /* 'hidden' */
|
||||
/* Use P_HID to check if a buffer is to be hidden when it is no longer
|
||||
* visible in a window. */
|
||||
#ifndef FEAT_QUICKFIX
|
||||
# define P_HID(dummy) (p_hid || cmdmod.hide)
|
||||
#else
|
||||
# define P_HID(buf) (buf_hide(buf))
|
||||
#endif
|
||||
EXTERN char_u *p_hl; /* 'highlight' */
|
||||
EXTERN int p_hls; /* 'hlsearch' */
|
||||
EXTERN long p_hi; /* 'history' */
|
||||
|
||||
@@ -450,6 +450,16 @@ slash_adjust(char_u *p)
|
||||
{
|
||||
if (path_with_url(p))
|
||||
return;
|
||||
|
||||
if (*p == '`')
|
||||
{
|
||||
size_t len = STRLEN(p);
|
||||
|
||||
/* don't replace backslash in backtick quoted strings */
|
||||
if (len > 2 && *(p + len - 1) == '`')
|
||||
return;
|
||||
}
|
||||
|
||||
while (*p)
|
||||
{
|
||||
if (*p == psepcN)
|
||||
@@ -809,6 +819,18 @@ mch_char_avail(void)
|
||||
/* never used */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
# if defined(FEAT_TERMINAL) || defined(PROTO)
|
||||
/*
|
||||
* Check for any pending input or messages.
|
||||
*/
|
||||
int
|
||||
mch_check_messages(void)
|
||||
{
|
||||
/* TODO: check for messages */
|
||||
return TRUE;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
+107
-43
@@ -175,8 +175,8 @@ typedef int waitstatus;
|
||||
#endif
|
||||
static pid_t wait4pid(pid_t, waitstatus *);
|
||||
|
||||
static int WaitForChar(long msec, int *interrupted);
|
||||
static int WaitForCharOrMouse(long msec, int *interrupted);
|
||||
static int WaitForChar(long msec, int *interrupted, int ignore_input);
|
||||
static int WaitForCharOrMouse(long msec, int *interrupted, int ignore_input);
|
||||
#if defined(__BEOS__) || defined(VMS)
|
||||
int RealWaitForChar(int, long, int *, int *interrupted);
|
||||
#else
|
||||
@@ -412,6 +412,9 @@ mch_inchar(
|
||||
|
||||
#ifdef MESSAGE_QUEUE
|
||||
parse_queued_messages();
|
||||
/* If input was put directly in typeahead buffer bail out here. */
|
||||
if (typebuf_changed(tb_change_cnt))
|
||||
return 0;
|
||||
#endif
|
||||
if (wtime < 0 && did_start_blocking)
|
||||
/* blocking and already waited for p_ut */
|
||||
@@ -478,7 +481,7 @@ mch_inchar(
|
||||
* We want to be interrupted by the winch signal
|
||||
* or by an event on the monitored file descriptors.
|
||||
*/
|
||||
if (WaitForChar(wait_time, &interrupted))
|
||||
if (WaitForChar(wait_time, &interrupted, FALSE))
|
||||
{
|
||||
/* If input was put directly in typeahead buffer bail out here. */
|
||||
if (typebuf_changed(tb_change_cnt))
|
||||
@@ -533,9 +536,20 @@ handle_resize(void)
|
||||
int
|
||||
mch_char_avail(void)
|
||||
{
|
||||
return WaitForChar(0L, NULL);
|
||||
return WaitForChar(0L, NULL, FALSE);
|
||||
}
|
||||
|
||||
#if defined(FEAT_TERMINAL) || defined(PROTO)
|
||||
/*
|
||||
* Check for any pending input or messages.
|
||||
*/
|
||||
int
|
||||
mch_check_messages(void)
|
||||
{
|
||||
return WaitForChar(0L, NULL, TRUE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_TOTAL_MEM) || defined(PROTO)
|
||||
# ifdef HAVE_SYS_RESOURCE_H
|
||||
# include <sys/resource.h>
|
||||
@@ -715,7 +729,7 @@ mch_delay(long msec, int ignoreinput)
|
||||
in_mch_delay = FALSE;
|
||||
}
|
||||
else
|
||||
WaitForChar(msec, NULL);
|
||||
WaitForChar(msec, NULL, FALSE);
|
||||
}
|
||||
|
||||
#if defined(HAVE_STACK_LIMIT) \
|
||||
@@ -4097,6 +4111,9 @@ mch_parse_cmd(char_u *cmd, int use_shcf, char ***argv, int *argc)
|
||||
#endif
|
||||
|
||||
#if !defined(USE_SYSTEM) || defined(FEAT_JOB_CHANNEL)
|
||||
/*
|
||||
* Set the environment for a child process.
|
||||
*/
|
||||
static void
|
||||
set_child_environment(long rows, long columns, char *term)
|
||||
{
|
||||
@@ -4108,6 +4125,9 @@ set_child_environment(long rows, long columns, char *term)
|
||||
static char envbuf_Lines[20];
|
||||
static char envbuf_Columns[20];
|
||||
static char envbuf_Colors[20];
|
||||
# ifdef FEAT_CLIENTSERVER
|
||||
static char envbuf_Servername[60];
|
||||
# endif
|
||||
# endif
|
||||
long colors =
|
||||
# ifdef FEAT_GUI
|
||||
@@ -4115,7 +4135,6 @@ set_child_environment(long rows, long columns, char *term)
|
||||
# endif
|
||||
t_colors;
|
||||
|
||||
/* Simulate to have a dumb terminal (for now) */
|
||||
# ifdef HAVE_SETENV
|
||||
setenv("TERM", term, 1);
|
||||
sprintf((char *)envbuf, "%ld", rows);
|
||||
@@ -4126,10 +4145,14 @@ set_child_environment(long rows, long columns, char *term)
|
||||
setenv("COLUMNS", (char *)envbuf, 1);
|
||||
sprintf((char *)envbuf, "%ld", colors);
|
||||
setenv("COLORS", (char *)envbuf, 1);
|
||||
# ifdef FEAT_CLIENTSERVER
|
||||
setenv("VIM_SERVERNAME", serverName == NULL ? "" : (char *)serverName, 1);
|
||||
# endif
|
||||
# else
|
||||
/*
|
||||
* Putenv does not copy the string, it has to remain valid.
|
||||
* Use a static array to avoid losing allocated memory.
|
||||
* This won't work well when running multiple children...
|
||||
*/
|
||||
vim_snprintf(envbuf_Term, sizeof(envbuf_Term), "TERM=%s", term);
|
||||
putenv(envbuf_Term);
|
||||
@@ -4142,6 +4165,11 @@ set_child_environment(long rows, long columns, char *term)
|
||||
putenv(envbuf_Columns);
|
||||
vim_snprintf(envbuf_Colors, sizeof(envbuf_Colors), "COLORS=%ld", colors);
|
||||
putenv(envbuf_Colors);
|
||||
# ifdef FEAT_CLIENTSERVER
|
||||
vim_snprintf(envbuf_Servername, sizeof(envbuf_Servername),
|
||||
"VIM_SERVERNAME=%s", serverName == NULL ? "" : (char *)serverName);
|
||||
putenv(envbuf_Servername);
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
|
||||
@@ -4153,8 +4181,13 @@ set_default_child_environment(void)
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_GUI) || defined(FEAT_JOB_CHANNEL)
|
||||
/*
|
||||
* Open a PTY, with FD for the master and slave side.
|
||||
* When failing "pty_master_fd" and "pty_slave_fd" are -1.
|
||||
* When successful both file descriptors are stored.
|
||||
*/
|
||||
static void
|
||||
open_pty(int *pty_master_fd, int *pty_slave_fd)
|
||||
open_pty(int *pty_master_fd, int *pty_slave_fd, char_u **namep)
|
||||
{
|
||||
char *tty_name;
|
||||
|
||||
@@ -4174,10 +4207,32 @@ open_pty(int *pty_master_fd, int *pty_slave_fd)
|
||||
close(*pty_master_fd);
|
||||
*pty_master_fd = -1;
|
||||
}
|
||||
else if (namep != NULL)
|
||||
*namep = vim_strsave((char_u *)tty_name);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Send SIGINT to a child process if "c" is an interrupt character.
|
||||
*/
|
||||
void
|
||||
may_send_sigint(int c UNUSED, pid_t pid UNUSED, pid_t wpid UNUSED)
|
||||
{
|
||||
# ifdef SIGINT
|
||||
if (c == Ctrl_C || c == intr_char)
|
||||
{
|
||||
# ifdef HAVE_SETSID
|
||||
kill(-pid, SIGINT);
|
||||
# else
|
||||
kill(0, SIGINT);
|
||||
# endif
|
||||
if (wpid > 0)
|
||||
kill(wpid, SIGINT);
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
int
|
||||
mch_call_shell(
|
||||
char_u *cmd,
|
||||
@@ -4360,7 +4415,7 @@ mch_call_shell(
|
||||
* If the slave can't be opened, close the master pty.
|
||||
*/
|
||||
if (p_guipty && !(options & (SHELL_READ|SHELL_WRITE)))
|
||||
open_pty(&pty_master_fd, &pty_slave_fd);
|
||||
open_pty(&pty_master_fd, &pty_slave_fd, NULL);
|
||||
/*
|
||||
* If not opening a pty or it didn't work, try using pipes.
|
||||
*/
|
||||
@@ -4761,23 +4816,12 @@ mch_call_shell(
|
||||
*/
|
||||
if (len == 1 && (pty_master_fd < 0 || cmd != NULL))
|
||||
{
|
||||
# ifdef SIGINT
|
||||
/*
|
||||
* Send SIGINT to the child's group or all
|
||||
* processes in our group.
|
||||
*/
|
||||
if (ta_buf[ta_len] == Ctrl_C
|
||||
|| ta_buf[ta_len] == intr_char)
|
||||
{
|
||||
# ifdef HAVE_SETSID
|
||||
kill(-pid, SIGINT);
|
||||
# else
|
||||
kill(0, SIGINT);
|
||||
# endif
|
||||
if (wpid > 0)
|
||||
kill(wpid, SIGINT);
|
||||
}
|
||||
# endif
|
||||
may_send_sigint(ta_buf[ta_len], pid, wpid);
|
||||
|
||||
if (pty_master_fd < 0 && toshell_fd >= 0
|
||||
&& ta_buf[ta_len] == Ctrl_D)
|
||||
{
|
||||
@@ -5180,9 +5224,9 @@ error:
|
||||
mch_job_start(char **argv, job_T *job, jobopt_T *options)
|
||||
{
|
||||
pid_t pid;
|
||||
int fd_in[2]; /* for stdin */
|
||||
int fd_out[2]; /* for stdout */
|
||||
int fd_err[2]; /* for stderr */
|
||||
int fd_in[2] = {-1, -1}; /* for stdin */
|
||||
int fd_out[2] = {-1, -1}; /* for stdout */
|
||||
int fd_err[2] = {-1, -1}; /* for stderr */
|
||||
int pty_master_fd = -1;
|
||||
int pty_slave_fd = -1;
|
||||
channel_T *channel = NULL;
|
||||
@@ -5200,15 +5244,9 @@ mch_job_start(char **argv, job_T *job, jobopt_T *options)
|
||||
|
||||
/* default is to fail */
|
||||
job->jv_status = JOB_FAILED;
|
||||
fd_in[0] = -1;
|
||||
fd_in[1] = -1;
|
||||
fd_out[0] = -1;
|
||||
fd_out[1] = -1;
|
||||
fd_err[0] = -1;
|
||||
fd_err[1] = -1;
|
||||
|
||||
if (options->jo_pty)
|
||||
open_pty(&pty_master_fd, &pty_slave_fd);
|
||||
open_pty(&pty_master_fd, &pty_slave_fd, &job->jv_tty_name);
|
||||
|
||||
/* TODO: without the channel feature connect the child to /dev/null? */
|
||||
/* Open pipes for stdin, stdout, stderr. */
|
||||
@@ -5298,7 +5336,8 @@ mch_job_start(char **argv, job_T *job, jobopt_T *options)
|
||||
set_child_environment(
|
||||
(long)options->jo_term_rows,
|
||||
(long)options->jo_term_cols,
|
||||
"xterm");
|
||||
STRNCMP(T_NAME, "xterm", 5) == 0
|
||||
? (char *)T_NAME : "xterm");
|
||||
else
|
||||
# endif
|
||||
set_default_child_environment();
|
||||
@@ -5306,6 +5345,17 @@ mch_job_start(char **argv, job_T *job, jobopt_T *options)
|
||||
if (use_null_for_in || use_null_for_out || use_null_for_err)
|
||||
null_fd = open("/dev/null", O_RDWR | O_EXTRA, 0);
|
||||
|
||||
if (pty_slave_fd >= 0)
|
||||
{
|
||||
/* push stream discipline modules */
|
||||
SetupSlavePTY(pty_slave_fd);
|
||||
# ifdef TIOCSCTTY
|
||||
/* Try to become controlling tty (probably doesn't work,
|
||||
* unless run by root) */
|
||||
ioctl(pty_slave_fd, TIOCSCTTY, (char *)NULL);
|
||||
# endif
|
||||
}
|
||||
|
||||
/* set up stdin for the child */
|
||||
close(0);
|
||||
if (use_null_for_in && null_fd >= 0)
|
||||
@@ -5352,8 +5402,8 @@ mch_job_start(char **argv, job_T *job, jobopt_T *options)
|
||||
close(fd_err[1]);
|
||||
if (pty_master_fd >= 0)
|
||||
{
|
||||
close(pty_master_fd); /* not used */
|
||||
close(pty_slave_fd); /* duped above */
|
||||
close(pty_master_fd); /* not used in the child */
|
||||
close(pty_slave_fd); /* was duped above */
|
||||
}
|
||||
|
||||
if (null_fd >= 0)
|
||||
@@ -5364,10 +5414,10 @@ mch_job_start(char **argv, job_T *job, jobopt_T *options)
|
||||
|
||||
if (stderr_works)
|
||||
perror("executing job failed");
|
||||
#ifdef EXITFREE
|
||||
# ifdef EXITFREE
|
||||
/* calling free_all_mem() here causes problems. Ignore valgrind
|
||||
* reporting possibly leaked memory. */
|
||||
#endif
|
||||
# endif
|
||||
_exit(EXEC_FAILED); /* exec failed, return failure code */
|
||||
}
|
||||
|
||||
@@ -5398,6 +5448,17 @@ mch_job_start(char **argv, job_T *job, jobopt_T *options)
|
||||
? INVALID_FD : fd_err[0] < 0 ? pty_master_fd : fd_err[0]);
|
||||
channel_set_job(channel, job, options);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fd_in[1] >= 0)
|
||||
close(fd_in[1]);
|
||||
if (fd_out[0] >= 0)
|
||||
close(fd_out[0]);
|
||||
if (fd_err[0] >= 0)
|
||||
close(fd_err[0]);
|
||||
if (pty_master_fd >= 0)
|
||||
close(pty_master_fd);
|
||||
}
|
||||
|
||||
/* success! */
|
||||
return;
|
||||
@@ -5588,13 +5649,15 @@ mch_breakcheck(int force)
|
||||
* from inbuf[].
|
||||
* "msec" == -1 will block forever.
|
||||
* Invokes timer callbacks when needed.
|
||||
* When "ignore_input" is TRUE even check for pending input when input is
|
||||
* already available.
|
||||
* "interrupted" (if not NULL) is set to TRUE when no character is available
|
||||
* but something else needs to be done.
|
||||
* Returns TRUE when a character is available.
|
||||
* When a GUI is being used, this will never get called -- webb
|
||||
*/
|
||||
static int
|
||||
WaitForChar(long msec, int *interrupted)
|
||||
WaitForChar(long msec, int *interrupted, int ignore_input)
|
||||
{
|
||||
#ifdef FEAT_TIMERS
|
||||
long due_time;
|
||||
@@ -5603,7 +5666,7 @@ WaitForChar(long msec, int *interrupted)
|
||||
|
||||
/* When waiting very briefly don't trigger timers. */
|
||||
if (msec >= 0 && msec < 10L)
|
||||
return WaitForCharOrMouse(msec, NULL);
|
||||
return WaitForCharOrMouse(msec, NULL, ignore_input);
|
||||
|
||||
while (msec < 0 || remaining > 0)
|
||||
{
|
||||
@@ -5617,7 +5680,7 @@ WaitForChar(long msec, int *interrupted)
|
||||
}
|
||||
if (due_time <= 0 || (msec > 0 && due_time > remaining))
|
||||
due_time = remaining;
|
||||
if (WaitForCharOrMouse(due_time, interrupted))
|
||||
if (WaitForCharOrMouse(due_time, interrupted, ignore_input))
|
||||
return TRUE;
|
||||
if (interrupted != NULL && *interrupted)
|
||||
/* Nothing available, but need to return so that side effects get
|
||||
@@ -5628,7 +5691,7 @@ WaitForChar(long msec, int *interrupted)
|
||||
}
|
||||
return FALSE;
|
||||
#else
|
||||
return WaitForCharOrMouse(msec, interrupted);
|
||||
return WaitForCharOrMouse(msec, interrupted, ignore_input);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -5636,12 +5699,13 @@ WaitForChar(long msec, int *interrupted)
|
||||
* Wait "msec" msec until a character is available from the mouse or keyboard
|
||||
* or from inbuf[].
|
||||
* "msec" == -1 will block forever.
|
||||
* for "ignore_input" see WaitForCharOr().
|
||||
* "interrupted" (if not NULL) is set to TRUE when no character is available
|
||||
* but something else needs to be done.
|
||||
* When a GUI is being used, this will never get called -- webb
|
||||
*/
|
||||
static int
|
||||
WaitForCharOrMouse(long msec, int *interrupted)
|
||||
WaitForCharOrMouse(long msec, int *interrupted, int ignore_input)
|
||||
{
|
||||
#ifdef FEAT_MOUSE_GPM
|
||||
int gpm_process_wanted;
|
||||
@@ -5651,7 +5715,7 @@ WaitForCharOrMouse(long msec, int *interrupted)
|
||||
#endif
|
||||
int avail;
|
||||
|
||||
if (input_available()) /* something in inbuf[] */
|
||||
if (!ignore_input && input_available()) /* something in inbuf[] */
|
||||
return 1;
|
||||
|
||||
#if defined(FEAT_MOUSE_DEC)
|
||||
@@ -5694,7 +5758,7 @@ WaitForCharOrMouse(long msec, int *interrupted)
|
||||
# endif
|
||||
if (!avail)
|
||||
{
|
||||
if (input_available())
|
||||
if (!ignore_input && input_available())
|
||||
return 1;
|
||||
# ifdef FEAT_XCLIPBOARD
|
||||
if (rest == 0 || !do_xterm_trace())
|
||||
|
||||
+39
-15
@@ -111,6 +111,7 @@ typedef int HICON;
|
||||
typedef int HINSTANCE;
|
||||
typedef int HWND;
|
||||
typedef int INPUT_RECORD;
|
||||
typedef int INT;
|
||||
typedef int KEY_EVENT_RECORD;
|
||||
typedef int LOGFONT;
|
||||
typedef int LPBOOL;
|
||||
@@ -657,13 +658,13 @@ null_libintl_textdomain(const char *domainname UNUSED)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
null_libintl_putenv(const char *envstring UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
null_libintl_wputenv(const wchar_t *envstring UNUSED)
|
||||
{
|
||||
return 0;
|
||||
@@ -1399,10 +1400,11 @@ handle_focus_event(INPUT_RECORD ir)
|
||||
/*
|
||||
* Wait until console input from keyboard or mouse is available,
|
||||
* or the time is up.
|
||||
* When "ignore_input" is TRUE even wait when input is available.
|
||||
* Return TRUE if something is available FALSE if not.
|
||||
*/
|
||||
static int
|
||||
WaitForChar(long msec)
|
||||
WaitForChar(long msec, int ignore_input)
|
||||
{
|
||||
DWORD dwNow = 0, dwEndTime = 0;
|
||||
INPUT_RECORD ir;
|
||||
@@ -1439,7 +1441,7 @@ WaitForChar(long msec)
|
||||
|| g_nMouseClick != -1
|
||||
#endif
|
||||
#ifdef FEAT_CLIENTSERVER
|
||||
|| input_available()
|
||||
|| (!ignore_input && input_available())
|
||||
#endif
|
||||
)
|
||||
return TRUE;
|
||||
@@ -1582,8 +1584,19 @@ WaitForChar(long msec)
|
||||
int
|
||||
mch_char_avail(void)
|
||||
{
|
||||
return WaitForChar(0L);
|
||||
return WaitForChar(0L, FALSE);
|
||||
}
|
||||
|
||||
# if defined(FEAT_TERMINAL) || defined(PROTO)
|
||||
/*
|
||||
* Check for any pending input or messages.
|
||||
*/
|
||||
int
|
||||
mch_check_messages(void)
|
||||
{
|
||||
return WaitForChar(0L, TRUE);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -1613,7 +1626,7 @@ tgetch(int *pmodifiers, WCHAR *pch2)
|
||||
DWORD cRecords = 0;
|
||||
|
||||
#ifdef FEAT_CLIENTSERVER
|
||||
(void)WaitForChar(-1L);
|
||||
(void)WaitForChar(-1L, FALSE);
|
||||
if (input_available())
|
||||
return 0;
|
||||
# ifdef FEAT_MOUSE
|
||||
@@ -1680,7 +1693,7 @@ mch_inchar(
|
||||
|
||||
if (time >= 0)
|
||||
{
|
||||
if (!WaitForChar(time)) /* no character available */
|
||||
if (!WaitForChar(time, FALSE)) /* no character available */
|
||||
return 0;
|
||||
}
|
||||
else /* time == -1, wait forever */
|
||||
@@ -1692,7 +1705,7 @@ mch_inchar(
|
||||
* write the autoscript file to disk. Or cause the CursorHold event
|
||||
* to be triggered.
|
||||
*/
|
||||
if (!WaitForChar(p_ut))
|
||||
if (!WaitForChar(p_ut, FALSE))
|
||||
{
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (trigger_cursorhold() && maxlen >= 3)
|
||||
@@ -1722,7 +1735,7 @@ mch_inchar(
|
||||
/* Keep looping until there is something in the typeahead buffer and more
|
||||
* to get and still room in the buffer (up to two bytes for a char and
|
||||
* three bytes for a modifier). */
|
||||
while ((typeaheadlen == 0 || WaitForChar(0L))
|
||||
while ((typeaheadlen == 0 || WaitForChar(0L, FALSE))
|
||||
&& typeaheadlen + 5 <= TYPEAHEADLEN)
|
||||
{
|
||||
if (typebuf_changed(tb_change_cnt))
|
||||
@@ -5720,7 +5733,7 @@ cursor_visible(BOOL fVisible)
|
||||
|
||||
|
||||
/*
|
||||
* write `cbToWrite' bytes in `pchBuf' to the screen
|
||||
* Write "cbToWrite" bytes in `pchBuf' to the screen.
|
||||
* Returns the number of bytes actually written (at least one).
|
||||
*/
|
||||
static DWORD
|
||||
@@ -5827,7 +5840,7 @@ mch_write(
|
||||
|
||||
if (p_wd)
|
||||
{
|
||||
WaitForChar(p_wd);
|
||||
WaitForChar(p_wd, FALSE);
|
||||
if (prefix != 0)
|
||||
prefix = 1;
|
||||
}
|
||||
@@ -6119,7 +6132,7 @@ mch_delay(
|
||||
# endif
|
||||
Sleep((int)msec);
|
||||
else
|
||||
WaitForChar(msec);
|
||||
WaitForChar(msec, FALSE);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -6503,7 +6516,7 @@ getout:
|
||||
* Version of open() that may use UTF-16 file name.
|
||||
*/
|
||||
int
|
||||
mch_open(char *name, int flags, int mode)
|
||||
mch_open(const char *name, int flags, int mode)
|
||||
{
|
||||
/* _wopen() does not work with Borland C 5.5: creates a read-only file. */
|
||||
# ifndef __BORLANDC__
|
||||
@@ -6536,7 +6549,7 @@ mch_open(char *name, int flags, int mode)
|
||||
* Version of fopen() that may use UTF-16 file name.
|
||||
*/
|
||||
FILE *
|
||||
mch_fopen(char *name, char *mode)
|
||||
mch_fopen(const char *name, const char *mode)
|
||||
{
|
||||
WCHAR *wn, *wm;
|
||||
FILE *f = NULL;
|
||||
@@ -6991,6 +7004,8 @@ fix_arg_enc(void)
|
||||
str = utf16_to_enc(ArglistW[idx], NULL);
|
||||
if (str != NULL)
|
||||
{
|
||||
int literal = used_file_literal;
|
||||
|
||||
#ifdef FEAT_DIFF
|
||||
/* When using diff mode may need to concatenate file name to
|
||||
* directory name. Just like it's done in main(). */
|
||||
@@ -7012,7 +7027,16 @@ fix_arg_enc(void)
|
||||
if (used_file_literal)
|
||||
buf_set_name(fnum_list[i], str);
|
||||
|
||||
alist_add(&global_alist, str, used_file_literal ? 2 : 0);
|
||||
/* Check backtick literal. backtick literal is already expanded in
|
||||
* main.c, so this part add str as literal. */
|
||||
if (literal == FALSE)
|
||||
{
|
||||
size_t len = STRLEN(str);
|
||||
|
||||
if (len > 2 && *str == '`' && *(str + len - 1) == '`')
|
||||
literal = TRUE;
|
||||
}
|
||||
alist_add(&global_alist, str, literal ? 2 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
-2
@@ -84,7 +84,13 @@ language.
|
||||
You should include your name and E-mail address instead, for example:
|
||||
msgstr "Berichten übersetzt bei: John Doe <john@doe.org>"
|
||||
|
||||
(3) Clean up
|
||||
(3) Remove unused messages (optional)
|
||||
Remove messages that have been marked as obsolete.
|
||||
Such messages start with "#~".
|
||||
|
||||
The cleanup script will also do that (see next step).
|
||||
|
||||
(4) Clean up
|
||||
This is very important to make sure the translation works on all systems.
|
||||
Comment-out all non-translated strings. There are two types:
|
||||
- items marked with "#, fuzzy"
|
||||
@@ -100,7 +106,7 @@ language.
|
||||
messed up by changes in line numbers and show the actual changes in the
|
||||
text.
|
||||
|
||||
(4) Check:
|
||||
(5) Check:
|
||||
|
||||
While editing the .po file:
|
||||
:source check.vim
|
||||
|
||||
+2492
-1754
File diff suppressed because it is too large
Load Diff
+13
-5
@@ -114,14 +114,12 @@ endif
|
||||
func! CountNl(first, last)
|
||||
let nl = 0
|
||||
for lnum in range(a:first, a:last)
|
||||
if getline(lnum) =~ '\\n'
|
||||
let nl += 1
|
||||
endif
|
||||
let nl += count(getline(lnum), "\n")
|
||||
endfor
|
||||
return nl
|
||||
endfunc
|
||||
|
||||
" Check that the \n at the end of the msid line is also present in the msgstr
|
||||
" Check that the \n at the end of the msgid line is also present in the msgstr
|
||||
" line. Skip over the header.
|
||||
/^"MIME-Version:
|
||||
while 1
|
||||
@@ -138,13 +136,23 @@ while 1
|
||||
let transcount = CountNl(strlnum, end - 1)
|
||||
" Allow for a few more or less line breaks when there are 2 or more
|
||||
if origcount != transcount && (origcount <= 2 || transcount <= 2)
|
||||
echomsg 'Mismatching "\\n" in line ' . line('.')
|
||||
echomsg 'Mismatching "\n" in line ' . line('.')
|
||||
if error == 0
|
||||
let error = lnum
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" Check that the file is well formed according to msgfmts understanding
|
||||
if executable("msgfmt")
|
||||
let filename = expand("%")
|
||||
let a = system("msgfmt --statistics OLD_PO_FILE_INPUT=yes " . filename)
|
||||
if v:shell_error != 0
|
||||
let error = matchstr(a, filename.':\zs\d\+\ze:')+0
|
||||
for line in split(a, '\n') | echomsg line | endfor
|
||||
endif
|
||||
endif
|
||||
|
||||
if error == 0
|
||||
" If all was OK restore the view.
|
||||
call winrestview(wsv)
|
||||
|
||||
+317
-620
File diff suppressed because it is too large
Load Diff
@@ -53,7 +53,16 @@ void ex_buffer_all(exarg_T *eap);
|
||||
void do_modelines(int flags);
|
||||
int read_viminfo_bufferlist(vir_T *virp, int writing);
|
||||
void write_viminfo_bufferlist(FILE *fp);
|
||||
int bt_quickfix(buf_T *buf);
|
||||
int bt_terminal(buf_T *buf);
|
||||
int bt_help(buf_T *buf);
|
||||
int bt_nofile(buf_T *buf);
|
||||
int bt_dontwrite(buf_T *buf);
|
||||
int bt_dontwrite_msg(buf_T *buf);
|
||||
int buf_hide(buf_T *buf);
|
||||
char_u *buf_spname(buf_T *buf);
|
||||
void switch_to_win_for_buf(buf_T *buf, win_T **save_curwinp, tabpage_T **save_curtabp, bufref_T *save_curbuf);
|
||||
void restore_win_for_buf(win_T *save_curwin, tabpage_T *save_curtab, bufref_T *save_curbuf);
|
||||
int find_win_for_buf(buf_T *buf, win_T **wp, tabpage_T **tp);
|
||||
void buf_addsign(buf_T *buf, int id, linenr_T lnum, int typenr);
|
||||
linenr_T buf_change_sign_type(buf_T *buf, int markId, int typenr);
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
/* channel.c */
|
||||
void ch_logfile(char_u *fname, char_u *opt);
|
||||
int ch_log_active(void);
|
||||
void ch_log(channel_T *ch, char *msg);
|
||||
void ch_logn(channel_T *ch, char *msg, int nr);
|
||||
void ch_logs(channel_T *ch, char *msg, char *name);
|
||||
void ch_log(channel_T *ch, const char *fmt, ...);
|
||||
channel_T *add_channel(void);
|
||||
int has_any_channel(void);
|
||||
int channel_unref(channel_T *channel);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* evalfunc.c */
|
||||
buf_T* get_buf_tv(typval_T *tv, int curtab_only);
|
||||
char_u *get_function_name(expand_T *xp, int idx);
|
||||
char_u *get_expr_name(expand_T *xp, int idx);
|
||||
int find_internal_func(char_u *name);
|
||||
|
||||
@@ -52,7 +52,6 @@ int can_abandon(buf_T *buf, int forceit);
|
||||
int check_changed_any(int hidden, int unload);
|
||||
int check_fname(void);
|
||||
int buf_write_all(buf_T *buf, int forceit);
|
||||
int get_arglist(garray_T *gap, char_u *str);
|
||||
int get_arglist_exp(char_u *str, int *fcountp, char_u ***fnamesp, int wig);
|
||||
void set_arglist(char_u *str);
|
||||
void check_arg_idx(win_T *win);
|
||||
|
||||
@@ -62,4 +62,5 @@ int put_line(FILE *fd, char *s);
|
||||
void dialog_msg(char_u *buff, char *format, char_u *fname);
|
||||
char_u *get_behave_arg(expand_T *xp, int idx);
|
||||
char_u *get_messages_arg(expand_T *xp, int idx);
|
||||
char_u *get_mapclear_arg(expand_T *xp, int idx);
|
||||
/* vim: set ft=c : */
|
||||
|
||||
@@ -3,6 +3,7 @@ int mch_chdir(char *path);
|
||||
void mch_write(char_u *s, int len);
|
||||
int mch_inchar(char_u *buf, int maxlen, long wtime, int tb_change_cnt);
|
||||
int mch_char_avail(void);
|
||||
int mch_check_messages(void);
|
||||
long_u mch_total_mem(int special);
|
||||
void mch_delay(long msec, int ignoreinput);
|
||||
int mch_stackcheck(char *p);
|
||||
@@ -57,6 +58,7 @@ int mch_report_winsize(int fd, int rows, int cols);
|
||||
void mch_set_shellsize(void);
|
||||
void mch_new_shellsize(void);
|
||||
int mch_parse_cmd(char_u *cmd, int use_shcf, char ***argv, int *argc);
|
||||
void may_send_sigint(int c, pid_t pid, pid_t wpid);
|
||||
int mch_call_shell(char_u *cmd, int options);
|
||||
void mch_job_start(char **argv, job_T *job, jobopt_T *options);
|
||||
char *mch_job_status(job_T *job);
|
||||
|
||||
@@ -8,6 +8,7 @@ void PlatformId(void);
|
||||
void mch_setmouse(int on);
|
||||
void mch_update_cursor(void);
|
||||
int mch_char_avail(void);
|
||||
int mch_check_messages(void);
|
||||
int mch_inchar(char_u *buf, int maxlen, long time, int tb_change_cnt);
|
||||
void mch_init(void);
|
||||
void mch_exit(int r);
|
||||
@@ -56,8 +57,8 @@ int mch_wrename(WCHAR *wold, WCHAR *wnew);
|
||||
int mch_rename(const char *pszOldFile, const char *pszNewFile);
|
||||
char *default_shell(void);
|
||||
int mch_access(char *n, int p);
|
||||
int mch_open(char *name, int flags, int mode);
|
||||
FILE *mch_fopen(char *name, char *mode);
|
||||
int mch_open(const char *name, int flags, int mode);
|
||||
FILE *mch_fopen(const char *name, const char *mode);
|
||||
int mch_copy_file_attribute(char_u *from, char_u *to);
|
||||
int myresetstkoflw(void);
|
||||
int get_cmd_argsW(char ***argvp);
|
||||
|
||||
@@ -28,10 +28,4 @@ int set_ref_in_quickfix(int copyID);
|
||||
void ex_cbuffer(exarg_T *eap);
|
||||
void ex_cexpr(exarg_T *eap);
|
||||
void ex_helpgrep(exarg_T *eap);
|
||||
int bt_quickfix(buf_T *buf);
|
||||
int bt_terminal(buf_T *buf);
|
||||
int bt_nofile(buf_T *buf);
|
||||
int bt_dontwrite(buf_T *buf);
|
||||
int bt_dontwrite_msg(buf_T *buf);
|
||||
int buf_hide(buf_T *buf);
|
||||
/* vim: set ft=c : */
|
||||
|
||||
@@ -23,6 +23,7 @@ void ex_syntime(exarg_T *eap);
|
||||
char_u *get_syntime_arg(expand_T *xp, int idx);
|
||||
void init_highlight(int both, int reset);
|
||||
int load_colors(char_u *name);
|
||||
int lookup_color(int idx, int foreground, int *boldp);
|
||||
void do_highlight(char_u *line, int forceit, int init);
|
||||
void free_highlight(void);
|
||||
void restore_cterm_colors(void);
|
||||
|
||||
+27
-3
@@ -1,9 +1,33 @@
|
||||
/* terminal.c */
|
||||
void ex_terminal(exarg_T *eap);
|
||||
void free_terminal(term_T *term);
|
||||
void free_terminal(buf_T *buf);
|
||||
void write_to_term(buf_T *buffer, char_u *msg, channel_T *channel);
|
||||
void terminal_loop(void);
|
||||
int term_job_running(term_T *term);
|
||||
int term_in_normal_mode(void);
|
||||
void term_enter_job_mode(void);
|
||||
int send_keys_to_term(term_T *term, int c, int typed);
|
||||
int term_use_loop(void);
|
||||
int terminal_loop(void);
|
||||
void term_job_ended(job_T *job);
|
||||
void term_update_window(win_T *wp);
|
||||
void term_channel_closed(channel_T *ch);
|
||||
int term_update_window(win_T *wp);
|
||||
int term_is_finished(buf_T *buf);
|
||||
int term_show_buffer(buf_T *buf);
|
||||
void term_change_in_curbuf(void);
|
||||
int term_get_attr(buf_T *buf, linenr_T lnum, int col);
|
||||
char_u *term_get_status_text(term_T *term);
|
||||
int set_ref_in_term(int copyID);
|
||||
void f_term_getattr(typval_T *argvars, typval_T *rettv);
|
||||
void f_term_getcursor(typval_T *argvars, typval_T *rettv);
|
||||
void f_term_getjob(typval_T *argvars, typval_T *rettv);
|
||||
void f_term_getline(typval_T *argvars, typval_T *rettv);
|
||||
void f_term_getsize(typval_T *argvars, typval_T *rettv);
|
||||
void f_term_getstatus(typval_T *argvars, typval_T *rettv);
|
||||
void f_term_gettitle(typval_T *argvars, typval_T *rettv);
|
||||
void f_term_gettty(typval_T *argvars, typval_T *rettv);
|
||||
void f_term_list(typval_T *argvars, typval_T *rettv);
|
||||
void f_term_scrape(typval_T *argvars, typval_T *rettv);
|
||||
void f_term_sendkeys(typval_T *argvars, typval_T *rettv);
|
||||
void f_term_start(typval_T *argvars, typval_T *rettv);
|
||||
void f_term_wait(typval_T *argvars, typval_T *rettv);
|
||||
/* vim: set ft=c : */
|
||||
|
||||
+11
-76
@@ -2101,7 +2101,7 @@ qf_jump(
|
||||
/*
|
||||
* For ":helpgrep" find a help window or open one.
|
||||
*/
|
||||
if (qf_ptr->qf_type == 1 && (!curwin->w_buffer->b_help || cmdmod.tab != 0))
|
||||
if (qf_ptr->qf_type == 1 && (!bt_help(curwin->w_buffer) || cmdmod.tab != 0))
|
||||
{
|
||||
win_T *wp;
|
||||
|
||||
@@ -2109,7 +2109,7 @@ qf_jump(
|
||||
wp = NULL;
|
||||
else
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
if (wp->w_buffer != NULL && wp->w_buffer->b_help)
|
||||
if (bt_help(wp->w_buffer))
|
||||
break;
|
||||
if (wp != NULL && wp->w_buffer->b_nwindows > 0)
|
||||
win_enter(wp, TRUE);
|
||||
@@ -5343,10 +5343,14 @@ ex_helpgrep(exarg_T *eap)
|
||||
|
||||
if (eap->cmdidx == CMD_lhelpgrep)
|
||||
{
|
||||
/* Find an existing help window */
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
if (wp->w_buffer != NULL && wp->w_buffer->b_help)
|
||||
break;
|
||||
/* If the current window is a help window, then use it */
|
||||
if (bt_help(curwin->w_buffer))
|
||||
wp = curwin;
|
||||
else
|
||||
/* Find an existing help window */
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
if (bt_help(wp->w_buffer))
|
||||
break;
|
||||
|
||||
if (wp == NULL) /* Help window not found */
|
||||
qi = NULL;
|
||||
@@ -5515,7 +5519,7 @@ ex_helpgrep(exarg_T *eap)
|
||||
{
|
||||
/* If the help window is not opened or if it already points to the
|
||||
* correct location list, then free the new location list. */
|
||||
if (!curwin->w_buffer->b_help || curwin->w_llist == qi)
|
||||
if (!bt_help(curwin->w_buffer) || curwin->w_llist == qi)
|
||||
{
|
||||
if (new_qi)
|
||||
ll_free_all(&qi);
|
||||
@@ -5526,72 +5530,3 @@ ex_helpgrep(exarg_T *eap)
|
||||
}
|
||||
|
||||
#endif /* FEAT_QUICKFIX */
|
||||
|
||||
/*
|
||||
* Return TRUE if "buf" is the quickfix buffer.
|
||||
*/
|
||||
int
|
||||
bt_quickfix(buf_T *buf)
|
||||
{
|
||||
return buf != NULL && buf->b_p_bt[0] == 'q';
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "buf" is a terminal buffer.
|
||||
*/
|
||||
int
|
||||
bt_terminal(buf_T *buf)
|
||||
{
|
||||
return buf != NULL && buf->b_p_bt[0] == 't';
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "buf" is a "nofile", "acwrite" or "terminal" buffer.
|
||||
* This means the buffer name is not a file name.
|
||||
*/
|
||||
int
|
||||
bt_nofile(buf_T *buf)
|
||||
{
|
||||
return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f')
|
||||
|| buf->b_p_bt[0] == 'a'
|
||||
|| buf->b_p_bt[0] == 't');
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "buf" is a "nowrite", "nofile" or "terminal" buffer.
|
||||
*/
|
||||
int
|
||||
bt_dontwrite(buf_T *buf)
|
||||
{
|
||||
return buf != NULL && (buf->b_p_bt[0] == 'n' || buf->b_p_bt[0] == 't');
|
||||
}
|
||||
|
||||
int
|
||||
bt_dontwrite_msg(buf_T *buf)
|
||||
{
|
||||
if (bt_dontwrite(buf))
|
||||
{
|
||||
EMSG(_("E382: Cannot write, 'buftype' option is set"));
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if the buffer should be hidden, according to 'hidden', ":hide"
|
||||
* and 'bufhidden'.
|
||||
*/
|
||||
int
|
||||
buf_hide(buf_T *buf)
|
||||
{
|
||||
/* 'bufhidden' overrules 'hidden' and ":hide", check it first */
|
||||
switch (buf->b_p_bh[0])
|
||||
{
|
||||
case 'u': /* "unload" */
|
||||
case 'w': /* "wipe" */
|
||||
case 'd': return FALSE; /* "delete" */
|
||||
case 'h': return TRUE; /* "hide" */
|
||||
}
|
||||
return (p_hid || cmdmod.hide);
|
||||
}
|
||||
|
||||
|
||||
@@ -3527,7 +3527,11 @@ post2nfa(int *postfix, int *end, int nfa_calc_size)
|
||||
{
|
||||
/* NFA_ZEND -> NFA_END_PATTERN -> NFA_SKIP -> what follows. */
|
||||
skip = alloc_state(NFA_SKIP, NULL, NULL);
|
||||
if (skip == NULL)
|
||||
goto theend;
|
||||
zend = alloc_state(NFA_ZEND, s1, NULL);
|
||||
if (zend == NULL)
|
||||
goto theend;
|
||||
s1->out= skip;
|
||||
patch(e.out, zend);
|
||||
PUSH(frag(s, list1(&skip->out)));
|
||||
|
||||
+59
-18
@@ -165,7 +165,7 @@ static void recording_mode(int attr);
|
||||
static void draw_tabline(void);
|
||||
#endif
|
||||
#if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT)
|
||||
static int fillchar_status(int *attr, int is_curwin);
|
||||
static int fillchar_status(int *attr, win_T *wp);
|
||||
#endif
|
||||
#ifdef FEAT_WINDOWS
|
||||
static int fillchar_vsep(int *attr);
|
||||
@@ -1019,8 +1019,11 @@ update_debug_sign(buf_T *buf, linenr_T lnum)
|
||||
}
|
||||
|
||||
/* Return when there is nothing to do, screen updating is already
|
||||
* happening (recursive call) or still starting up. */
|
||||
* happening (recursive call), messages on the screen or still starting up.
|
||||
*/
|
||||
if (!doit || updating_screen
|
||||
|| State == ASKMORE || State == HITRETURN
|
||||
|| msg_scrolled
|
||||
#ifdef FEAT_GUI
|
||||
|| gui.starting
|
||||
#endif
|
||||
@@ -1200,11 +1203,10 @@ win_update(win_T *wp)
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (wp->w_buffer->b_term != NULL)
|
||||
/* If this window contains a terminal, redraw works completely differently.
|
||||
*/
|
||||
if (term_update_window(wp) == OK)
|
||||
{
|
||||
/* This window contains a terminal, redraw works completely
|
||||
* differently. */
|
||||
term_update_window(wp);
|
||||
wp->w_redr_type = 0;
|
||||
return;
|
||||
}
|
||||
@@ -3131,6 +3133,9 @@ win_line(
|
||||
#if defined(LINE_ATTR)
|
||||
int did_line_attr = 0;
|
||||
#endif
|
||||
#ifdef FEAT_TERMINAL
|
||||
int get_term_attr = FALSE;
|
||||
#endif
|
||||
|
||||
/* draw_state: items that are drawn in sequence: */
|
||||
#define WL_START 0 /* nothing done yet */
|
||||
@@ -3242,6 +3247,14 @@ win_line(
|
||||
draw_color_col = advance_color_col(VCOL_HLC, &color_cols);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (term_show_buffer(wp->w_buffer))
|
||||
{
|
||||
extra_check = TRUE;
|
||||
get_term_attr = TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_SPELL
|
||||
if (wp->w_p_spell
|
||||
&& *wp->w_s->b_p_spl != NUL
|
||||
@@ -4528,6 +4541,18 @@ win_line(
|
||||
int can_spell = TRUE;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (get_term_attr)
|
||||
{
|
||||
syntax_attr = term_get_attr(wp->w_buffer, lnum, vcol);
|
||||
|
||||
if (!attr_pri)
|
||||
char_attr = syntax_attr;
|
||||
else
|
||||
char_attr = hl_combine_attr(syntax_attr, char_attr);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_SYN_HL
|
||||
/* Get syntax attribute, unless still at the start of the line
|
||||
* (double-wide char that doesn't fit). */
|
||||
@@ -6675,7 +6700,7 @@ win_redr_status_matches(
|
||||
--first_match;
|
||||
}
|
||||
|
||||
fillchar = fillchar_status(&attr, TRUE);
|
||||
fillchar = fillchar_status(&attr, curwin);
|
||||
|
||||
if (first_match == 0)
|
||||
{
|
||||
@@ -6854,20 +6879,20 @@ win_redr_status(win_T *wp)
|
||||
#endif
|
||||
else
|
||||
{
|
||||
fillchar = fillchar_status(&attr, wp == curwin);
|
||||
fillchar = fillchar_status(&attr, wp);
|
||||
|
||||
get_trans_bufname(wp->w_buffer);
|
||||
p = NameBuff;
|
||||
len = (int)STRLEN(p);
|
||||
|
||||
if (wp->w_buffer->b_help
|
||||
if (bt_help(wp->w_buffer)
|
||||
#ifdef FEAT_QUICKFIX
|
||||
|| wp->w_p_pvw
|
||||
#endif
|
||||
|| bufIsChanged(wp->w_buffer)
|
||||
|| wp->w_buffer->b_p_ro)
|
||||
*(p + len++) = ' ';
|
||||
if (wp->w_buffer->b_help)
|
||||
if (bt_help(wp->w_buffer))
|
||||
{
|
||||
STRCPY(p + len, _("[Help]"));
|
||||
len += (int)STRLEN(p + len);
|
||||
@@ -6879,7 +6904,11 @@ win_redr_status(win_T *wp)
|
||||
len += (int)STRLEN(p + len);
|
||||
}
|
||||
#endif
|
||||
if (bufIsChanged(wp->w_buffer))
|
||||
if (bufIsChanged(wp->w_buffer)
|
||||
#ifdef FEAT_TERMINAL
|
||||
&& !bt_terminal(wp->w_buffer)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
STRCPY(p + len, "[+]");
|
||||
len += 3;
|
||||
@@ -6951,7 +6980,7 @@ win_redr_status(win_T *wp)
|
||||
if (wp->w_vsep_width != 0 && wp->w_status_height != 0 && redrawing())
|
||||
{
|
||||
if (stl_connected(wp))
|
||||
fillchar = fillchar_status(&attr, wp == curwin);
|
||||
fillchar = fillchar_status(&attr, wp);
|
||||
else
|
||||
fillchar = fillchar_vsep(&attr);
|
||||
screen_putchar(fillchar, W_WINROW(wp) + wp->w_height, W_ENDCOL(wp),
|
||||
@@ -7125,7 +7154,7 @@ win_redr_custom(
|
||||
else
|
||||
{
|
||||
row = W_WINROW(wp) + wp->w_height;
|
||||
fillchar = fillchar_status(&attr, wp == curwin);
|
||||
fillchar = fillchar_status(&attr, wp);
|
||||
maxwidth = W_WIDTH(wp);
|
||||
|
||||
if (draw_ruler)
|
||||
@@ -10712,10 +10741,22 @@ get_trans_bufname(buf_T *buf)
|
||||
* Get the character to use in a status line. Get its attributes in "*attr".
|
||||
*/
|
||||
static int
|
||||
fillchar_status(int *attr, int is_curwin)
|
||||
fillchar_status(int *attr, win_T *wp)
|
||||
{
|
||||
int fill;
|
||||
if (is_curwin)
|
||||
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (bt_terminal(wp->w_buffer))
|
||||
{
|
||||
*attr = HL_ATTR(HLF_ST);
|
||||
if (wp == curwin)
|
||||
fill = fill_stl;
|
||||
else
|
||||
fill = fill_stlnc;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (wp == curwin)
|
||||
{
|
||||
*attr = HL_ATTR(HLF_S);
|
||||
fill = fill_stl;
|
||||
@@ -10729,10 +10770,10 @@ fillchar_status(int *attr, int is_curwin)
|
||||
* window differs, or the fillchars differ, or this is not the
|
||||
* current window */
|
||||
if (*attr != 0 && ((HL_ATTR(HLF_S) != HL_ATTR(HLF_SNC)
|
||||
|| !is_curwin || ONE_WINDOW)
|
||||
|| wp != curwin || ONE_WINDOW)
|
||||
|| (fill_stl != fill_stlnc)))
|
||||
return fill;
|
||||
if (is_curwin)
|
||||
if (wp == curwin)
|
||||
return '^';
|
||||
return '=';
|
||||
}
|
||||
@@ -10920,7 +10961,7 @@ win_redr_ruler(win_T *wp, int always)
|
||||
if (wp->w_status_height)
|
||||
{
|
||||
row = W_WINROW(wp) + wp->w_height;
|
||||
fillchar = fillchar_status(&attr, wp == curwin);
|
||||
fillchar = fillchar_status(&attr, wp);
|
||||
off = W_WINCOL(wp);
|
||||
width = W_WIDTH(wp);
|
||||
}
|
||||
|
||||
+11
-6
@@ -1478,6 +1478,7 @@ struct jobvar_S
|
||||
PROCESS_INFORMATION jv_proc_info;
|
||||
HANDLE jv_job_object;
|
||||
#endif
|
||||
char_u *jv_tty_name; /* controlling tty, allocated */
|
||||
jobstatus_T jv_status;
|
||||
char_u *jv_stoponexit; /* allocated */
|
||||
int jv_exitval;
|
||||
@@ -1537,18 +1538,20 @@ typedef enum {
|
||||
JIO_OUT
|
||||
} job_io_T;
|
||||
|
||||
#define CH_PART_FD(part) ch_part[part].ch_fd
|
||||
|
||||
/* Ordering matters, it is used in for loops: IN is last, only SOCK/OUT/ERR
|
||||
* are polled. */
|
||||
typedef enum {
|
||||
PART_SOCK = 0,
|
||||
#define CH_SOCK_FD ch_part[PART_SOCK].ch_fd
|
||||
#define CH_SOCK_FD CH_PART_FD(PART_SOCK)
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
PART_OUT,
|
||||
# define CH_OUT_FD ch_part[PART_OUT].ch_fd
|
||||
# define CH_OUT_FD CH_PART_FD(PART_OUT)
|
||||
PART_ERR,
|
||||
# define CH_ERR_FD ch_part[PART_ERR].ch_fd
|
||||
# define CH_ERR_FD CH_PART_FD(PART_ERR)
|
||||
PART_IN,
|
||||
# define CH_IN_FD ch_part[PART_IN].ch_fd
|
||||
# define CH_IN_FD CH_PART_FD(PART_IN)
|
||||
#endif
|
||||
PART_COUNT
|
||||
} ch_part_T;
|
||||
@@ -1656,7 +1659,7 @@ struct channel_S {
|
||||
#define JO_CALLBACK 0x0010 /* channel callback */
|
||||
#define JO_OUT_CALLBACK 0x0020 /* stdout callback */
|
||||
#define JO_ERR_CALLBACK 0x0040 /* stderr callback */
|
||||
#define JO_CLOSE_CALLBACK 0x0080 /* close callback */
|
||||
#define JO_CLOSE_CALLBACK 0x0080 /* "close_cb" */
|
||||
#define JO_WAITTIME 0x0100 /* only for ch_open() */
|
||||
#define JO_TIMEOUT 0x0200 /* all timeouts */
|
||||
#define JO_OUT_TIMEOUT 0x0400 /* stdout timeouts */
|
||||
@@ -1684,7 +1687,8 @@ struct channel_S {
|
||||
|
||||
#define JO2_OUT_MSG 0x0001 /* "out_msg" */
|
||||
#define JO2_ERR_MSG 0x0002 /* "err_msg" (JO_OUT_ << 1) */
|
||||
#define JO2_ALL 0x0003
|
||||
#define JO2_TERM_NAME 0x0004 /* "term_name" */
|
||||
#define JO2_ALL 0x0007
|
||||
|
||||
#define JO_MODE_ALL (JO_MODE + JO_IN_MODE + JO_OUT_MODE + JO_ERR_MODE)
|
||||
#define JO_CB_ALL \
|
||||
@@ -1741,6 +1745,7 @@ typedef struct
|
||||
/* when non-zero run the job in a terminal window of this size */
|
||||
int jo_term_rows;
|
||||
int jo_term_cols;
|
||||
char_u *jo_term_name;
|
||||
#endif
|
||||
} jobopt_T;
|
||||
|
||||
|
||||
+125
-87
@@ -6887,6 +6887,10 @@ static char *(highlight_init_both[]) =
|
||||
"StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold"),
|
||||
CENT("StatusLineNC term=reverse cterm=reverse",
|
||||
"StatusLineNC term=reverse cterm=reverse gui=reverse"),
|
||||
#ifdef FEAT_TERMINAL
|
||||
CENT("StatusLineTerm term=reverse cterm=reverse ctermFg=DarkGreen",
|
||||
"StatusLineTerm term=reverse cterm=reverse ctermFg=DarkGreen gui=reverse guifg=DarkGreen"),
|
||||
#endif
|
||||
"default link EndOfBuffer NonText",
|
||||
#ifdef FEAT_WINDOWS
|
||||
CENT("VertSplit term=reverse cterm=reverse",
|
||||
@@ -7221,6 +7225,115 @@ load_colors(char_u *name)
|
||||
return retval;
|
||||
}
|
||||
|
||||
static char *(color_names[28]) = {
|
||||
"Black", "DarkBlue", "DarkGreen", "DarkCyan",
|
||||
"DarkRed", "DarkMagenta", "Brown", "DarkYellow",
|
||||
"Gray", "Grey", "LightGray", "LightGrey",
|
||||
"DarkGray", "DarkGrey",
|
||||
"Blue", "LightBlue", "Green", "LightGreen",
|
||||
"Cyan", "LightCyan", "Red", "LightRed", "Magenta",
|
||||
"LightMagenta", "Yellow", "LightYellow", "White", "NONE"};
|
||||
/* indices:
|
||||
* 0, 1, 2, 3,
|
||||
* 4, 5, 6, 7,
|
||||
* 8, 9, 10, 11,
|
||||
* 12, 13,
|
||||
* 14, 15, 16, 17,
|
||||
* 18, 19, 20, 21, 22,
|
||||
* 23, 24, 25, 26, 27 */
|
||||
static int color_numbers_16[28] = {0, 1, 2, 3,
|
||||
4, 5, 6, 6,
|
||||
7, 7, 7, 7,
|
||||
8, 8,
|
||||
9, 9, 10, 10,
|
||||
11, 11, 12, 12, 13,
|
||||
13, 14, 14, 15, -1};
|
||||
/* for xterm with 88 colors... */
|
||||
static int color_numbers_88[28] = {0, 4, 2, 6,
|
||||
1, 5, 32, 72,
|
||||
84, 84, 7, 7,
|
||||
82, 82,
|
||||
12, 43, 10, 61,
|
||||
14, 63, 9, 74, 13,
|
||||
75, 11, 78, 15, -1};
|
||||
/* for xterm with 256 colors... */
|
||||
static int color_numbers_256[28] = {0, 4, 2, 6,
|
||||
1, 5, 130, 130,
|
||||
248, 248, 7, 7,
|
||||
242, 242,
|
||||
12, 81, 10, 121,
|
||||
14, 159, 9, 224, 13,
|
||||
225, 11, 229, 15, -1};
|
||||
/* for terminals with less than 16 colors... */
|
||||
static int color_numbers_8[28] = {0, 4, 2, 6,
|
||||
1, 5, 3, 3,
|
||||
7, 7, 7, 7,
|
||||
0+8, 0+8,
|
||||
4+8, 4+8, 2+8, 2+8,
|
||||
6+8, 6+8, 1+8, 1+8, 5+8,
|
||||
5+8, 3+8, 3+8, 7+8, -1};
|
||||
|
||||
/*
|
||||
* Lookup the "cterm" value to be used for color with index "idx" in
|
||||
* color_names[].
|
||||
* "boldp" will be set to TRUE or FALSE for a foreground color when using 8
|
||||
* colors, otherwise it will be unchanged.
|
||||
*/
|
||||
int
|
||||
lookup_color(int idx, int foreground, int *boldp)
|
||||
{
|
||||
int color = color_numbers_16[idx];
|
||||
char_u *p;
|
||||
|
||||
/* Use the _16 table to check if it's a valid color name. */
|
||||
if (color < 0)
|
||||
return -1;
|
||||
|
||||
if (t_colors == 8)
|
||||
{
|
||||
/* t_Co is 8: use the 8 colors table */
|
||||
#if defined(__QNXNTO__)
|
||||
color = color_numbers_8_qansi[idx];
|
||||
#else
|
||||
color = color_numbers_8[idx];
|
||||
#endif
|
||||
if (foreground)
|
||||
{
|
||||
/* set/reset bold attribute to get light foreground
|
||||
* colors (on some terminals, e.g. "linux") */
|
||||
if (color & 8)
|
||||
*boldp = TRUE;
|
||||
else
|
||||
*boldp = FALSE;
|
||||
}
|
||||
color &= 7; /* truncate to 8 colors */
|
||||
}
|
||||
else if (t_colors == 16 || t_colors == 88
|
||||
|| t_colors >= 256)
|
||||
{
|
||||
/*
|
||||
* Guess: if the termcap entry ends in 'm', it is
|
||||
* probably an xterm-like terminal. Use the changed
|
||||
* order for colors.
|
||||
*/
|
||||
if (*T_CAF != NUL)
|
||||
p = T_CAF;
|
||||
else
|
||||
p = T_CSF;
|
||||
if (*p != NUL && (t_colors > 256
|
||||
|| *(p + STRLEN(p) - 1) == 'm'))
|
||||
{
|
||||
if (t_colors == 88)
|
||||
color = color_numbers_88[idx];
|
||||
else if (t_colors >= 256)
|
||||
color = color_numbers_256[idx];
|
||||
else
|
||||
color = color_numbers_8[idx];
|
||||
}
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle the ":highlight .." command.
|
||||
* When using ":hi clear" this is called recursively for each group with
|
||||
@@ -7724,45 +7837,8 @@ do_highlight(
|
||||
}
|
||||
else
|
||||
{
|
||||
static char *(color_names[28]) = {
|
||||
"Black", "DarkBlue", "DarkGreen", "DarkCyan",
|
||||
"DarkRed", "DarkMagenta", "Brown", "DarkYellow",
|
||||
"Gray", "Grey",
|
||||
"LightGray", "LightGrey", "DarkGray", "DarkGrey",
|
||||
"Blue", "LightBlue", "Green", "LightGreen",
|
||||
"Cyan", "LightCyan", "Red", "LightRed", "Magenta",
|
||||
"LightMagenta", "Yellow", "LightYellow", "White", "NONE"};
|
||||
static int color_numbers_16[28] = {0, 1, 2, 3,
|
||||
4, 5, 6, 6,
|
||||
7, 7,
|
||||
7, 7, 8, 8,
|
||||
9, 9, 10, 10,
|
||||
11, 11, 12, 12, 13,
|
||||
13, 14, 14, 15, -1};
|
||||
/* for xterm with 88 colors... */
|
||||
static int color_numbers_88[28] = {0, 4, 2, 6,
|
||||
1, 5, 32, 72,
|
||||
84, 84,
|
||||
7, 7, 82, 82,
|
||||
12, 43, 10, 61,
|
||||
14, 63, 9, 74, 13,
|
||||
75, 11, 78, 15, -1};
|
||||
/* for xterm with 256 colors... */
|
||||
static int color_numbers_256[28] = {0, 4, 2, 6,
|
||||
1, 5, 130, 130,
|
||||
248, 248,
|
||||
7, 7, 242, 242,
|
||||
12, 81, 10, 121,
|
||||
14, 159, 9, 224, 13,
|
||||
225, 11, 229, 15, -1};
|
||||
/* for terminals with less than 16 colors... */
|
||||
static int color_numbers_8[28] = {0, 4, 2, 6,
|
||||
1, 5, 3, 3,
|
||||
7, 7,
|
||||
7, 7, 0+8, 0+8,
|
||||
4+8, 4+8, 2+8, 2+8,
|
||||
6+8, 6+8, 1+8, 1+8, 5+8,
|
||||
5+8, 3+8, 3+8, 7+8, -1};
|
||||
int bold = MAYBE;
|
||||
|
||||
#if defined(__QNXNTO__)
|
||||
static int *color_numbers_8_qansi = color_numbers_8;
|
||||
/* On qnx, the 8 & 16 color arrays are the same */
|
||||
@@ -7783,57 +7859,19 @@ do_highlight(
|
||||
break;
|
||||
}
|
||||
|
||||
/* Use the _16 table to check if it's a valid color name. */
|
||||
color = color_numbers_16[i];
|
||||
if (color >= 0)
|
||||
color = lookup_color(i, key[5] == 'F', &bold);
|
||||
|
||||
/* set/reset bold attribute to get light foreground
|
||||
* colors (on some terminals, e.g. "linux") */
|
||||
if (bold == TRUE)
|
||||
{
|
||||
if (t_colors == 8)
|
||||
{
|
||||
/* t_Co is 8: use the 8 colors table */
|
||||
#if defined(__QNXNTO__)
|
||||
color = color_numbers_8_qansi[i];
|
||||
#else
|
||||
color = color_numbers_8[i];
|
||||
#endif
|
||||
if (key[5] == 'F')
|
||||
{
|
||||
/* set/reset bold attribute to get light foreground
|
||||
* colors (on some terminals, e.g. "linux") */
|
||||
if (color & 8)
|
||||
{
|
||||
HL_TABLE()[idx].sg_cterm |= HL_BOLD;
|
||||
HL_TABLE()[idx].sg_cterm_bold = TRUE;
|
||||
}
|
||||
else
|
||||
HL_TABLE()[idx].sg_cterm &= ~HL_BOLD;
|
||||
}
|
||||
color &= 7; /* truncate to 8 colors */
|
||||
}
|
||||
else if (t_colors == 16 || t_colors == 88
|
||||
|| t_colors >= 256)
|
||||
{
|
||||
/*
|
||||
* Guess: if the termcap entry ends in 'm', it is
|
||||
* probably an xterm-like terminal. Use the changed
|
||||
* order for colors.
|
||||
*/
|
||||
if (*T_CAF != NUL)
|
||||
p = T_CAF;
|
||||
else
|
||||
p = T_CSF;
|
||||
if (*p != NUL && (t_colors > 256
|
||||
|| *(p + STRLEN(p) - 1) == 'm'))
|
||||
{
|
||||
if (t_colors == 88)
|
||||
color = color_numbers_88[i];
|
||||
else if (t_colors >= 256)
|
||||
color = color_numbers_256[i];
|
||||
else
|
||||
color = color_numbers_8[i];
|
||||
}
|
||||
}
|
||||
HL_TABLE()[idx].sg_cterm |= HL_BOLD;
|
||||
HL_TABLE()[idx].sg_cterm_bold = TRUE;
|
||||
}
|
||||
else if (bold == FALSE)
|
||||
HL_TABLE()[idx].sg_cterm &= ~HL_BOLD;
|
||||
}
|
||||
|
||||
/* Add one to the argument, to avoid zero. Zero is used for
|
||||
* "NONE", then "color" is -1. */
|
||||
if (key[5] == 'F')
|
||||
|
||||
+7
-8
@@ -4313,16 +4313,17 @@ check_termcode(
|
||||
|| (tp[0] == CSI && len >= 2))
|
||||
&& (VIM_ISDIGIT(*argp) || *argp == '>' || *argp == '?'))
|
||||
{
|
||||
int col = 0;
|
||||
int semicols = 0;
|
||||
#ifdef FEAT_MBYTE
|
||||
int col;
|
||||
int row_char = NUL;
|
||||
#endif
|
||||
j = 0;
|
||||
|
||||
extra = 0;
|
||||
for (i = 2 + (tp[0] != CSI); i < len
|
||||
&& !(tp[i] >= '{' && tp[i] <= '~')
|
||||
&& !ASCII_ISALPHA(tp[i]); ++i)
|
||||
if (tp[i] == ';' && ++j == 1)
|
||||
if (tp[i] == ';' && ++semicols == 1)
|
||||
{
|
||||
extra = i + 1;
|
||||
#ifdef FEAT_MBYTE
|
||||
@@ -4334,17 +4335,15 @@ check_termcode(
|
||||
LOG_TR("Not enough characters for CRV");
|
||||
return -1;
|
||||
}
|
||||
#ifdef FEAT_MBYTE
|
||||
if (extra > 0)
|
||||
col = atoi((char *)tp + extra);
|
||||
else
|
||||
col = 0;
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
/* Eat it when it has 2 arguments and ends in 'R'. Also when
|
||||
* u7_status is not "sent", it may be from a previous Vim that
|
||||
* just exited. But not for <S-F3>, it sends something
|
||||
* similar, check for row and column to make sense. */
|
||||
if (j == 1 && tp[i] == 'R')
|
||||
if (semicols == 1 && tp[i] == 'R')
|
||||
{
|
||||
if (row_char == '2' && col >= 2)
|
||||
{
|
||||
@@ -4407,7 +4406,7 @@ check_termcode(
|
||||
if (col > 20000)
|
||||
col = 0;
|
||||
|
||||
if (tp[1 + (tp[0] != CSI)] == '>' && j == 2)
|
||||
if (tp[1 + (tp[0] != CSI)] == '>' && semicols == 2)
|
||||
{
|
||||
/* Only set 'ttymouse' automatically if it was not set
|
||||
* by the user already. */
|
||||
|
||||
+1594
-263
File diff suppressed because it is too large
Load Diff
@@ -18,12 +18,10 @@ SCRIPTS_ALL = \
|
||||
test5.out \
|
||||
test7.out \
|
||||
test8.out \
|
||||
test9.out \
|
||||
test14.out \
|
||||
test15.out \
|
||||
test19.out \
|
||||
test20.out \
|
||||
test22.out \
|
||||
test28.out \
|
||||
test29.out \
|
||||
test31.out \
|
||||
@@ -40,7 +38,6 @@ SCRIPTS_ALL = \
|
||||
test44.out \
|
||||
test45.out \
|
||||
test48.out \
|
||||
test51.out \
|
||||
test53.out \
|
||||
test55.out \
|
||||
test56.out \
|
||||
@@ -52,19 +49,12 @@ SCRIPTS_ALL = \
|
||||
test69.out \
|
||||
test70.out \
|
||||
test73.out \
|
||||
test77.out \
|
||||
test79.out \
|
||||
test80.out \
|
||||
test84.out \
|
||||
test88.out \
|
||||
test91.out \
|
||||
test94.out \
|
||||
test95.out \
|
||||
test98.out \
|
||||
test99.out \
|
||||
test103.out \
|
||||
test104.out \
|
||||
test107.out \
|
||||
test108.out \
|
||||
test_autoformat_join.out \
|
||||
test_changelist.out \
|
||||
@@ -137,13 +127,16 @@ NEW_TESTS = test_arabic.res \
|
||||
test_command_count.res \
|
||||
test_crypt.res \
|
||||
test_cscope.res \
|
||||
test_curswant.res \
|
||||
test_diffmode.res \
|
||||
test_digraph.res \
|
||||
test_display.res \
|
||||
test_edit.res \
|
||||
test_farsi.res \
|
||||
test_file_size.res \
|
||||
test_fnameescape.res \
|
||||
test_fold.res \
|
||||
test_getvar.res \
|
||||
test_gf.res \
|
||||
test_gn.res \
|
||||
test_gui.res \
|
||||
@@ -151,6 +144,7 @@ NEW_TESTS = test_arabic.res \
|
||||
test_hardcopy.res \
|
||||
test_help.res \
|
||||
test_hide.res \
|
||||
test_highlight.res \
|
||||
test_history.res \
|
||||
test_hlsearch.res \
|
||||
test_increment.res \
|
||||
@@ -158,6 +152,8 @@ NEW_TESTS = test_arabic.res \
|
||||
test_job_fails.res \
|
||||
test_json.res \
|
||||
test_langmap.res \
|
||||
test_let.res \
|
||||
test_lineending.res \
|
||||
test_listlbr.res \
|
||||
test_listlbr_utf8.res \
|
||||
test_lua.res \
|
||||
@@ -186,6 +182,7 @@ NEW_TESTS = test_arabic.res \
|
||||
test_retab.res \
|
||||
test_registers.res \
|
||||
test_ruby.res \
|
||||
test_scrollbind.res \
|
||||
test_search.res \
|
||||
test_signs.res \
|
||||
test_smartindent.res \
|
||||
@@ -197,6 +194,7 @@ NEW_TESTS = test_arabic.res \
|
||||
test_syntax.res \
|
||||
test_system.res \
|
||||
test_tcl.res \
|
||||
test_terminal.res \
|
||||
test_textobjects.res \
|
||||
test_undo.res \
|
||||
test_usercommands.res \
|
||||
|
||||
@@ -54,6 +54,7 @@ $(TEST_OUTFILES): $(DOSTMP)\$(*B).in
|
||||
-@if exist test.ok del test.ok
|
||||
-@if exist Xdir1 rd /s /q Xdir1
|
||||
-@if exist Xfind rd /s /q Xfind
|
||||
-@if exist XfakeHOME rd /s /q XfakeHOME
|
||||
-@del X*
|
||||
-@if exist viminfo del viminfo
|
||||
$(VIMPROG) -u dos.vim $(NO_INITS) "+set ff=unix|f test.out|wq" \
|
||||
@@ -89,6 +90,7 @@ clean:
|
||||
-if exist lua.vim del lua.vim
|
||||
-if exist Xdir1 rd /s /q Xdir1
|
||||
-if exist Xfind rd /s /q Xfind
|
||||
-if exist XfakeHOME rd /s /q XfakeHOME
|
||||
-del X*
|
||||
-for /d %i in (X*) do @rmdir /s/q %i
|
||||
-if exist viminfo del viminfo
|
||||
|
||||
@@ -84,6 +84,7 @@ clean:
|
||||
-@if exist lua.vim $(DEL) lua.vim
|
||||
-@if exist Xdir1 $(DELDIR) Xdir1
|
||||
-@if exist Xfind $(DELDIR) Xfind
|
||||
-@if exist XfakeHOME $(DELDIR) XfakeHOME
|
||||
-@if exist X* $(DEL) X*
|
||||
-@if exist viminfo $(DEL) viminfo
|
||||
-@if exist test.log $(DEL) test.log
|
||||
@@ -98,6 +99,7 @@ clean:
|
||||
@$(MV) test.out $*.out
|
||||
-@if exist Xdir1 $(DELDIR) Xdir1
|
||||
-@if exist Xfind $(DELDIR) Xfind
|
||||
-@if exist XfakeHOME $(DELDIR) XfakeHOME
|
||||
-@if exist X* $(DEL) X*
|
||||
-@if exist test.ok $(DEL) test.ok
|
||||
-@if exist viminfo $(DEL) viminfo
|
||||
|
||||
@@ -54,9 +54,6 @@
|
||||
# Comment out if you have GNU compatible diff on your system
|
||||
# HAVE_GDIFF = YES
|
||||
|
||||
# Comment out if you have GNU compatible cksum on your system
|
||||
# HAVE_CKSUM = YES
|
||||
|
||||
# Comment out if you have ICONV support
|
||||
# HAVE_ICONV = YES
|
||||
|
||||
@@ -77,24 +74,23 @@ VIMPROG = <->vim.exe
|
||||
.SUFFIXES : .out .in
|
||||
|
||||
SCRIPT = test1.out test3.out test4.out test5.out \
|
||||
test7.out test8.out test9.out \
|
||||
test7.out test8.out \
|
||||
test14.out test15.out \
|
||||
test19.out test20.out test22.out \
|
||||
test19.out test20.out \
|
||||
test28.out test29.out test30.out test31.out test32.out \
|
||||
test33.out test34.out test36.out test37.out \
|
||||
test38.out test39.out test40.out test41.out test42.out \
|
||||
test43.out test44.out test45.out \
|
||||
test48.out test49.out test51.out test53.out test54.out \
|
||||
test48.out test49.out test53.out test54.out \
|
||||
test55.out test56.out test57.out test60.out \
|
||||
test64.out \
|
||||
test66.out test68.out test69.out \
|
||||
test72.out \
|
||||
test77a.out test78.out test79.out test80.out \
|
||||
test84.out test88.out \
|
||||
test91.out test94.out \
|
||||
test95.out test98.out test99.out \
|
||||
test103.out test104.out \
|
||||
test107.out test108.out\
|
||||
test88.out \
|
||||
test94.out \
|
||||
test95.out test99.out \
|
||||
test108.out\
|
||||
test_autocmd_option.out \
|
||||
test_autoformat_join.out \
|
||||
test_breakindent.out \
|
||||
@@ -164,10 +160,6 @@ SCRIPT_GZIP = test11.out
|
||||
SCRIPT_GDIFF = test47.out
|
||||
.ENDIF
|
||||
|
||||
.IFDEF HAVE_CKSUM
|
||||
SCRIPT_CKSUM = test77.out
|
||||
.ENDIF
|
||||
|
||||
.IFDEF HAVE_ICONV
|
||||
SCRIPT_ICONV = test83.out
|
||||
.ENDIF
|
||||
@@ -201,7 +193,7 @@ SCRIPT_PYTHON = test86.out test87.out
|
||||
-@ if "''F$SEARCH("Xtest.*")'" .NES. "" then delete/noconfirm/nolog Xtest.*.*
|
||||
|
||||
all : clean nolog $(START_WITH) $(SCRIPT) $(SCRIPT_GUI) $(SCRIPT_UNIX) $(SCRIPT_WIN) $(SCRIPT_SPELL) $(SCRIPT_ODS5) $(SCRIPT_GZIP) \
|
||||
$(SCRIPT_GDIFF) $(SCRIPT_MZSCH) $(SCRIPT_CKSUM) $(SCRIPT_ICONV) $(SCRIPT_LUA) $(SCRIPT_PYTHON) nolog
|
||||
$(SCRIPT_GDIFF) $(SCRIPT_MZSCH) $(SCRIPT_ICONV) $(SCRIPT_LUA) $(SCRIPT_PYTHON) nolog
|
||||
-@ write sys$output " "
|
||||
-@ write sys$output "-----------------------------------------------"
|
||||
-@ write sys$output " All done"
|
||||
@@ -232,7 +224,6 @@ nolog :
|
||||
-@ write sys$output " HAVE_ODS5 = ""$(HAVE_ODS5)"" "
|
||||
-@ write sys$output " HAVE_GZIP = ""$(HAVE_GZIP)"" "
|
||||
-@ write sys$output " HAVE_GDIFF = ""$(HAVE_GDIFF)"" "
|
||||
-@ write sys$output " HAVE_CKSUM = ""$(HAVE_CKSUM)"" "
|
||||
-@ write sys$output " HAVE_ICONV = ""$(HAVE_ICONV)"" "
|
||||
-@ write sys$output " HAVE_LUA = ""$(HAVE_LUA)"" "
|
||||
-@ write sys$output " HAVE_PYTHON= ""$(HAVE_PYTHON)"" "
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
" Print all interface versions and write the result into if_ver.txt.
|
||||
" For Ubuntu. Part 1.
|
||||
|
||||
redir! > if_ver.txt
|
||||
if 1
|
||||
echo "*** Interface versions ***"
|
||||
echo "\nLua:"
|
||||
lua print(_VERSION)
|
||||
" echo "\nLuaJIT:"
|
||||
" lua print(jit.version)
|
||||
if has('mzscheme')
|
||||
echo "\nMzScheme:"
|
||||
mzscheme (display (version))
|
||||
endif
|
||||
echo "\nPerl:"
|
||||
perl print $^V
|
||||
echo "\nRuby:"
|
||||
ruby print RUBY_VERSION
|
||||
if has('tcl')
|
||||
echo "\nTcl:"
|
||||
tcl puts [info patchlevel]
|
||||
endif
|
||||
echo "\nPython 2:"
|
||||
python import sys; print sys.version
|
||||
endif
|
||||
redir END
|
||||
@@ -0,0 +1,10 @@
|
||||
" Print py3 interface version and write the result into if_ver.txt.
|
||||
" For Ubuntu. Part 2.
|
||||
|
||||
redir! >> if_ver.txt
|
||||
if 1
|
||||
echo "\nPython 3:"
|
||||
python3 import sys; print(sys.version)
|
||||
echo "\n"
|
||||
endif
|
||||
redir END
|
||||
@@ -0,0 +1,3 @@
|
||||
# Suppress leaks from X libraries on Ubuntu trusty.
|
||||
leak:libX11.so.6
|
||||
leak:libXt.so.6
|
||||
@@ -5,9 +5,9 @@
|
||||
VimProg ?= ../vim
|
||||
|
||||
Scripts = test1.out test2.out test3.out test4.out test5.out test6.out
|
||||
test7.out test8.out test9.out test11.out
|
||||
test7.out test8.out test11.out
|
||||
test12.out test13.out test14.out test15.out test17.out
|
||||
test18.out test19.out test20.out test21.out test22.out
|
||||
test18.out test19.out test20.out test21.out
|
||||
test25.out test27.out
|
||||
test28.out test29.out test30.out test31.out test32.out
|
||||
test33.out test34.out test36.out test37.out
|
||||
|
||||
@@ -158,6 +158,9 @@ func FinishTesting()
|
||||
" Don't write viminfo on exit.
|
||||
set viminfo=
|
||||
|
||||
" Clean up files created by setup.vim
|
||||
call delete('XfakeHOME', 'rf')
|
||||
|
||||
if s:fail == 0
|
||||
" Success, create the .res file so that make knows it's done.
|
||||
exe 'split ' . fnamemodify(g:testname, ':r') . '.res'
|
||||
@@ -230,6 +233,7 @@ let s:flaky = [
|
||||
\ 'Test_quoteplus()',
|
||||
\ 'Test_quotestar()',
|
||||
\ 'Test_reltime()',
|
||||
\ 'Test_with_partial_callback()',
|
||||
\ ]
|
||||
|
||||
" Locate Test_ functions and execute them.
|
||||
|
||||
+13
-1
@@ -1,5 +1,13 @@
|
||||
" Common preparations for running tests.
|
||||
|
||||
" Only load this once.
|
||||
if 1
|
||||
if exists('s:did_load')
|
||||
finish
|
||||
endif
|
||||
let s:did_load = 1
|
||||
endif
|
||||
|
||||
" Make sure 'runtimepath' and 'packpath' does not include $HOME.
|
||||
set rtp=$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after
|
||||
if has('packages')
|
||||
@@ -14,5 +22,9 @@ if 1
|
||||
endif
|
||||
|
||||
" Make sure $HOME does not get read or written.
|
||||
let $HOME = '/does/not/exist'
|
||||
" It must exist, gnome tries to create $HOME/.gnome2
|
||||
let $HOME = getcwd() . '/XfakeHOME'
|
||||
if !isdirectory($HOME)
|
||||
call mkdir($HOME)
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
Test for visual mode not being reset causing E315 error.
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set belloff=all
|
||||
:enew
|
||||
:let g:msg="Everything's fine."
|
||||
:function! TriggerTheProblem()
|
||||
: " At this point there is no visual selection because :call reset it.
|
||||
: " Let's restore the selection:
|
||||
: normal gv
|
||||
: '<,'>del _
|
||||
: try
|
||||
: exe "normal \<Esc>"
|
||||
: catch /^Vim\%((\a\+)\)\=:E315/
|
||||
: echom 'Snap! E315 error!'
|
||||
: let g:msg='Snap! E315 error!'
|
||||
: endtry
|
||||
:endfunction
|
||||
:enew
|
||||
:setl buftype=nofile
|
||||
:call append(line('$'), 'Delete this line.')
|
||||
:"
|
||||
:"
|
||||
:" NOTE: this has to be done by a call to a function because executing :del the
|
||||
:" ex-way will require the colon operator which resets the visual mode thus
|
||||
:" preventing the problem:
|
||||
:"
|
||||
GV:call TriggerTheProblem()
|
||||
:%del _
|
||||
:call append(line('$'), g:msg)
|
||||
:w! test.out
|
||||
:brewind
|
||||
ENDTEST
|
||||
|
||||
STARTTEST
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
Everything's fine.
|
||||
@@ -1,30 +0,0 @@
|
||||
Tests for :let. vim: set ft=vim ts=8 :
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set runtimepath+=./sautest
|
||||
:" Test to not autoload when assigning. It causes internal error.
|
||||
:try
|
||||
: let Test104#numvar = function('tr')
|
||||
: $put ='OK: ' . string(Test104#numvar)
|
||||
:catch
|
||||
: $put ='FAIL: ' . v:exception
|
||||
:endtry
|
||||
:let a = 1
|
||||
:let b = 2
|
||||
:for letargs in ['a b', '{0 == 1 ? "a" : "b"}', '{0 == 1 ? "a" : "b"} a', 'a {0 == 1 ? "a" : "b"}']
|
||||
: try
|
||||
: redir => messages
|
||||
: execute 'let' letargs
|
||||
: redir END
|
||||
: $put ='OK:'
|
||||
: $put =split(substitute(messages, '\n', '\0 ', 'g'), '\n')
|
||||
: catch
|
||||
: $put ='FAIL: ' . v:exception
|
||||
: redir END
|
||||
: endtry
|
||||
:endfor
|
||||
:/^Results/,$wq! test.out
|
||||
ENDTEST
|
||||
|
||||
Results of test104:
|
||||
@@ -1,13 +0,0 @@
|
||||
Results of test104:
|
||||
OK: function('tr')
|
||||
OK:
|
||||
a #1
|
||||
b #2
|
||||
OK:
|
||||
b #2
|
||||
OK:
|
||||
b #2
|
||||
a #1
|
||||
OK:
|
||||
a #1
|
||||
b #2
|
||||
@@ -1,38 +0,0 @@
|
||||
Tests for adjusting window and contents vim: set ft=vim :
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:new
|
||||
:call setline(1, range(1,256))
|
||||
:let r=[]
|
||||
:func! GetScreenStr(row)
|
||||
: let str = ""
|
||||
: for c in range(1,3)
|
||||
: let str .= nr2char(screenchar(a:row, c))
|
||||
: endfor
|
||||
: return str
|
||||
:endfunc
|
||||
:
|
||||
:exe ":norm! \<C-W>t\<C-W>=1Gzt\<C-W>w\<C-W>+"
|
||||
:let s3=GetScreenStr(1)
|
||||
:wincmd p
|
||||
:call add(r, [line("w0"), s3])
|
||||
:
|
||||
:exe ":norm! \<C-W>t\<C-W>=50Gzt\<C-W>w\<C-W>+"
|
||||
:let s3=GetScreenStr(1)
|
||||
:wincmd p
|
||||
:call add(r, [line("w0"), s3])
|
||||
:
|
||||
:exe ":norm! \<C-W>t\<C-W>=59Gzt\<C-W>w\<C-W>+"
|
||||
:let s3=GetScreenStr(1)
|
||||
::wincmd p
|
||||
:call add(r, [line("w0"), s3])
|
||||
:
|
||||
:bwipeout!
|
||||
:$put=r
|
||||
:call garbagecollect(1)
|
||||
:"
|
||||
:/^start:/,$wq! test.out
|
||||
ENDTEST
|
||||
|
||||
start:
|
||||
@@ -1,4 +0,0 @@
|
||||
start:
|
||||
[1, '1 ']
|
||||
[50, '50 ']
|
||||
[59, '59 ']
|
||||
@@ -1,13 +0,0 @@
|
||||
Tests for file with some lines ending in CTRL-M, some not
|
||||
|
||||
STARTTEST
|
||||
:set ta tx
|
||||
:e!
|
||||
:$-3,$w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
this lines ends in a
|
||||
this one doesn't
|
||||
this one does
|
||||
and the last one doesn't
|
||||
@@ -1,4 +0,0 @@
|
||||
this lines ends in a
|
||||
this one doesn't
|
||||
this one does
|
||||
and the last one doesn't
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user