Skip to content

Commit a9f4184

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents c810e7e + b81bc77 commit a9f4184

39 files changed

Lines changed: 967 additions & 212 deletions

Filelist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ SRC_ALL = \
105105
src/testdir/Make_all.mak \
106106
src/testdir/*.in \
107107
src/testdir/*.py \
108+
src/testdir/lsan-suppress.txt \
108109
src/testdir/sautest/autoload/*.vim \
109110
src/testdir/runtest.vim \
110111
src/testdir/shared.vim \

runtime/doc/channel.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*channel.txt* For Vim version 8.0. Last change: 2017 Jul 22
1+
*channel.txt* For Vim version 8.0. Last change: 2017 Aug 11
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -427,8 +427,8 @@ When no message was available then the result is v:none for a JSON or JS mode
427427
channels, an empty string for a RAW or NL channel. You can use |ch_canread()|
428428
to check if there is something to read.
429429

430-
Note that when there is no callback message are dropped. To avoid that add a
431-
close callback to the channel.
430+
Note that when there is no callback, messages are dropped. To avoid that add
431+
a close callback to the channel.
432432

433433
To read all output from a RAW channel that is available: >
434434
let output = ch_readraw(channel)
@@ -696,6 +696,10 @@ See |job_setoptions()| and |ch_setoptions()|.
696696
"block_write": number only for testing: pretend every other write to stdin
697697
will block
698698

699+
"env": dict environment variables for the new process
700+
"cwd": "/path/to/dir" current working directory for the new process;
701+
if the directory does not exist an error is given
702+
699703

700704
Writing to a buffer ~
701705
*out_io-buffer*
@@ -731,10 +735,6 @@ The "out_msg" option can be used to specify whether a new buffer will have the
731735
first line set to "Reading from channel output...". The default is to add the
732736
message. "err_msg" does the same for channel error.
733737

734-
'modifiable' option off, or write to a buffer that has 'modifiable' off. That
735-
means that lines will be appended to the buffer, but the user can't easily
736-
change the buffer.
737-
738738
When an existing buffer is to be written where 'modifiable' is off and the
739739
"out_modifiable" or "err_modifiable" options is not zero, an error is given
740740
and the buffer will not be written to.

runtime/doc/eval.txt

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 8.0. Last change: 2017 Aug 06
1+
*eval.txt* For Vim version 8.0. Last change: 2017 Aug 11
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2369,6 +2369,7 @@ tagfiles() List tags files used
23692369
tan({expr}) Float tangent of {expr}
23702370
tanh({expr}) Float hyperbolic tangent of {expr}
23712371
tempname() String name for a temporary file
2372+
term_getaltscreen({buf}) Number get the alternate screen flag
23722373
term_getattr({attr}, {what}) Number get the value of attribute {what}
23732374
term_getcursor({buf}) List get the cursor position of a terminal
23742375
term_getjob({buf}) Job get the job associated with a terminal
@@ -6972,10 +6973,12 @@ setpos({expr}, {list})
69726973
|winrestview()|.
69736974

69746975
setqflist({list} [, {action}[, {what}]]) *setqflist()*
6975-
Create or replace or add to the quickfix list using the items
6976-
in {list}. Each item in {list} is a dictionary.
6977-
Non-dictionary items in {list} are ignored. Each dictionary
6978-
item can contain the following entries:
6976+
Create or replace or add to the quickfix list.
6977+
6978+
When {what} is not present, use the items in {list}. Each
6979+
item must be a dictionary. Non-dictionary items in {list} are
6980+
ignored. Each dictionary item can contain the following
6981+
entries:
69796982

69806983
bufnr buffer number; must be the number of a valid
69816984
buffer
@@ -7027,6 +7030,10 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
70277030
argument is ignored. The following items can be specified in
70287031
{what}:
70297032
context any Vim type can be stored as a context
7033+
text use 'errorformat' to extract items from the
7034+
text and add the resulting entries to the
7035+
quickfix list {nr}. The value can be a string
7036+
with one line or a list with multiple lines.
70307037
items list of quickfix entries. Same as the {list}
70317038
argument.
70327039
nr list number in the quickfix stack; zero
@@ -7914,6 +7921,12 @@ tempname() *tempname()* *temp-file-name*
79147921
For MS-Windows forward slashes are used when the 'shellslash'
79157922
option is set or when 'shellcmdflag' starts with '-'.
79167923

7924+
term_getaltscreen({buf}) *term_getaltscreen()*
7925+
Returns 1 if the terminal of {buf} is using the alternate
7926+
screen.
7927+
{buf} is used as with |term_getsize()|.
7928+
{only available when compiled with the |+terminal| feature}
7929+
79177930
term_getattr({attr}, {what}) *term_getattr()*
79187931
Given {attr}, a value returned by term_scrape() in the "attr"
79197932
item, return whether {what} is on. {what} can be one of:
@@ -8037,8 +8050,10 @@ term_sendkeys({buf}, {keys}) *term_sendkeys()*
80378050
term_start({cmd}, {options}) *term_start()*
80388051
Open a terminal window and run {cmd} in it.
80398052

8040-
Returns the buffer number of the terminal window.
8041-
When opening the window fails zero is returned.
8053+
Returns the buffer number of the terminal window. If {cmd}
8054+
cannot be executed the window does open and shows an error
8055+
message.
8056+
If opening the window fails zero is returned.
80428057

80438058
{options} are similar to what is used for |job_start()|, see
80448059
|job-options|. However, not all options can be used. These
@@ -8054,9 +8069,22 @@ term_start({cmd}, {options}) *term_start()*
80548069
connected to the terminal. When I/O is connected to the
80558070
terminal then the callback function for that part is not used.
80568071

8057-
There is one extra option:
8058-
"term_name" name to use for the buffer name, instead of
8059-
the command name.
8072+
There are extra options:
8073+
"term_name" name to use for the buffer name, instead
8074+
of the command name.
8075+
"term_rows" vertical size to use for the terminal,
8076+
instead of using 'termsize'
8077+
"term_cols" horizontal size to use for the terminal,
8078+
instead of using 'termsize'
8079+
"vertical" split the window vertically
8080+
"curwin" use the current window, do not split the
8081+
window; fails if the current buffer
8082+
cannot be |abandon|ed
8083+
"term_finish" What to do when the job is finished:
8084+
"close": close any windows
8085+
"open": open window if needed
8086+
Note that "open" can be interruptive.
8087+
See |term++close| and |term++open|.
80608088
{only available when compiled with the |+terminal| feature}
80618089

80628090
term_wait({buf} [, {time}]) *term_wait()*

runtime/doc/if_pyth.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -894,10 +894,10 @@ On Ubuntu you will want to install these packages for Python 2:
894894
python-dev
895895
For Python 3:
896896
python3
897-
pytyon3-dev
897+
python3-dev
898898
For Python 3.6:
899899
python3.6
900-
pytyon3.6-dev
900+
python3.6-dev
901901

902902
If you have more than one version of Python 3, you need to link python3 to the
903903
one you prefer, before running configure.

runtime/doc/index.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*index.txt* For Vim version 8.0. Last change: 2017 Jul 30
1+
*index.txt* For Vim version 8.0. Last change: 2017 Aug 02
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -540,7 +540,7 @@ tag command action in Normal mode ~
540540
|CTRL-W_J| CTRL-W J move current window to the very bottom
541541
|CTRL-W_K| CTRL-W K move current window to the very top
542542
|CTRL-W_L| CTRL-W L move current window to the far right
543-
|CTRL-W_N| CTRL-W N terminal window: go to Terminal mode
543+
|CTRL-W_N| CTRL-W N terminal window: go to Terminal Normal mode
544544
|CTRL-W_P| CTRL-W P go to preview window
545545
|CTRL-W_R| CTRL-W R rotate windows upwards N times
546546
|CTRL-W_S| CTRL-W S same as "CTRL-W s"

runtime/doc/intro.txt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*intro.txt* For Vim version 8.0. Last change: 2017 Jul 30
1+
*intro.txt* For Vim version 8.0. Last change: 2017 Aug 05
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -530,7 +530,7 @@ examples and use them directly. Or type them literally, including the '<' and
530530
==============================================================================
531531
5. Modes, introduction *vim-modes-intro* *vim-modes*
532532

533-
Vim has six BASIC modes:
533+
Vim has seven BASIC modes:
534534

535535
*Normal* *Normal-mode* *command-mode*
536536
Normal mode In Normal mode you can enter all the normal editor
@@ -566,6 +566,11 @@ Ex mode Like Command-line mode, but after entering a command
566566
you remain in Ex mode. Very limited editing of the
567567
command line. |Ex-mode|
568568

569+
Terminal-Job mode Interacting with a job in a terminal window. Typed
570+
keys go to the job and the job output is displayed in
571+
the terminal window. See |terminal| about how to
572+
switch to other modes.
573+
569574
There are seven ADDITIONAL modes. These are variants of the BASIC modes:
570575

571576
*Operator-pending* *Operator-pending-mode*
@@ -592,10 +597,9 @@ Insert Normal mode Entered when CTRL-O given in Insert mode. This is
592597
If the 'showmode' option is on "-- (insert) --" is
593598
shown at the bottom of the window.
594599

595-
Terminal Normal mode Using Normal mode in a terminal window. Making
596-
changes is impossible. Use a insert command, such as
597-
"a" or "i", to return control to the job running in
598-
the terminal. Also called |Terminal-mode|.
600+
Terminal-Normal mode Using Normal mode in a terminal window. Making
601+
changes is impossible. Use an insert command, such as
602+
"a" or "i", to return to Terminal-Job mode.
599603

600604
Insert Visual mode Entered when starting a Visual selection from Insert
601605
mode, e.g., by using CTRL-O and then "v", "V" or
@@ -671,6 +675,8 @@ Normal mode from any other mode. This can be used to make sure Vim is in
671675
Normal mode, without causing a beep like <Esc> would. However, this does not
672676
work in Ex mode. When used after a command that takes an argument, such as
673677
|f| or |m|, the timeout set with 'ttimeoutlen' applies.
678+
When focus is in a terminal window, CTRL-\ CTRL-N goes to Normal mode for only
679+
one command, see |t_CTRL-\_CTRL-N|.
674680

675681
*CTRL-\_CTRL-G* *i_CTRL-\_CTRL-G* *c_CTRL-\_CTRL-G* *v_CTRL-\_CTRL-G*
676682
The command CTRL-\ CTRL-G or <C-\><C-G> can be used to go to Insert mode when

runtime/doc/tags

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,6 +1339,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
13391339
+tcl various.txt /*+tcl*
13401340
+tcl/dyn various.txt /*+tcl\/dyn*
13411341
+termguicolors various.txt /*+termguicolors*
1342+
+terminal various.txt /*+terminal*
13421343
+terminfo various.txt /*+terminfo*
13431344
+termresponse various.txt /*+termresponse*
13441345
+textobjects various.txt /*+textobjects*
@@ -4590,6 +4591,7 @@ E943 message.txt /*E943*
45904591
E944 pattern.txt /*E944*
45914592
E945 pattern.txt /*E945*
45924593
E946 terminal.txt /*E946*
4594+
E947 terminal.txt /*E947*
45934595
E95 message.txt /*E95*
45944596
E96 diff.txt /*E96*
45954597
E97 diff.txt /*E97*
@@ -8635,6 +8637,7 @@ t_AL term.txt /*t_AL*
86358637
t_BD term.txt /*t_BD*
86368638
t_BE term.txt /*t_BE*
86378639
t_CS term.txt /*t_CS*
8640+
t_CTRL-\_CTRL-N terminal.txt /*t_CTRL-\\_CTRL-N*
86388641
t_CV term.txt /*t_CV*
86398642
t_Ce term.txt /*t_Ce*
86408643
t_Co term.txt /*t_Co*
@@ -8894,16 +8897,21 @@ temp-file-name eval.txt /*temp-file-name*
88948897
tempfile change.txt /*tempfile*
88958898
template autocmd.txt /*template*
88968899
tempname() eval.txt /*tempname()*
8900+
term++close terminal.txt /*term++close*
8901+
term++open terminal.txt /*term++open*
88978902
term-dependent-settings term.txt /*term-dependent-settings*
88988903
term-list syntax.txt /*term-list*
88998904
term.txt term.txt /*term.txt*
8905+
term_getaltscreen() eval.txt /*term_getaltscreen()*
89008906
term_getattr() eval.txt /*term_getattr()*
89018907
term_getcursor() eval.txt /*term_getcursor()*
89028908
term_getjob() eval.txt /*term_getjob()*
89038909
term_getline() eval.txt /*term_getline()*
8910+
term_getscrolled() eval.txt /*term_getscrolled()*
89048911
term_getsize() eval.txt /*term_getsize()*
89058912
term_getstatus() eval.txt /*term_getstatus()*
89068913
term_gettitle() eval.txt /*term_gettitle()*
8914+
term_gettty() eval.txt /*term_gettty()*
89078915
term_list() eval.txt /*term_list()*
89088916
term_scrape() eval.txt /*term_scrape()*
89098917
term_sendkeys() eval.txt /*term_sendkeys()*

runtime/doc/terminal.txt

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*terminal.txt* For Vim version 8.0. Last change: 2017 Aug 05
1+
*terminal.txt* For Vim version 8.0. Last change: 2017 Aug 10
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -36,7 +36,7 @@ output from the job, also while editing in any other window.
3636

3737
Typing ~
3838

39-
When the keyboard focus is in the terminal window, typed keys will be send to
39+
When the keyboard focus is in the terminal window, typed keys will be sent to
4040
the job. This uses a pty when possible. You can click outside of the
4141
terminal window to move keyboard focus elsewhere.
4242

@@ -47,7 +47,8 @@ See |CTRL-W| for more commands.
4747

4848
Special in the terminal window: *CTRL-W_.* *CTRL-W_N*
4949
CTRL-W . send a CTRL-W to the job in the terminal
50-
CTRL-W N go to Terminal Normal mode, see |Terminal-mode|
50+
CTRL-W N go to Terminal-Normal mode, see |Terminal-mode|
51+
CTRL-\ CTRL-N go to Terminal-Normal mode, see |Terminal-mode|
5152
CTRL-W " {reg} paste register {reg} *CTRL-W_quote*
5253
Also works with the = register to insert the result of
5354
evaluating an expression.
@@ -62,10 +63,8 @@ the job. For example:
6263
'termkey' N go to terminal Normal mode, see below
6364
'termkey' CTRL-N same as CTRL-W N
6465
*t_CTRL-\_CTRL-N*
65-
The special key combination CTRL-\ CTRL-N can be used to prefix one Normal
66-
mode command. This is especially useful for remote commands, when you don't
67-
know whether Vim currently has focus in a terminal window. Note that only one
68-
Normal mode command can be used.
66+
The special key combination CTRL-\ CTRL-N can be used to switch to Normal
67+
mode, just like this works in any other mode.
6968

7069

7170
Size ~
@@ -76,7 +75,7 @@ See option 'termsize' for controlling the size of the terminal window.
7675

7776
Syntax ~
7877

79-
:ter[minal] [command] *:ter* *:terminal*
78+
:[range]ter[minal] [options] [command] *:ter* *:terminal*
8079
Open a new terminal window.
8180

8281
If [command] is provided run it as a job and connect
@@ -86,9 +85,27 @@ Syntax ~
8685
A new buffer will be created, using [command] or
8786
'shell' as the name, prefixed with a "!". If a buffer
8887
by this name already exists a number is added in
89-
parenthesis. E.g. if "gdb" exists the second terminal
88+
parentheses. E.g. if "gdb" exists the second terminal
9089
buffer will use "!gdb (1)".
9190

91+
If [range] is given it is used for the terminal size.
92+
One number specifies the number of rows. Unless the
93+
"vertical" modifier is used, then it is the number of
94+
columns.
95+
96+
Two comma separated numbers are used as "rows,cols".
97+
E.g. `:24,80gdb` opens a terminal with 24 rows and 80
98+
columns. However, if the terminal window spans the
99+
Vim window with, there is no vertical split, the Vim
100+
window width is used.
101+
*term++close* *term++open*
102+
Supported [options] are:
103+
++close The terminal window will close
104+
automatically when the job terminates.
105+
++open When the job terminates and no window
106+
show it, a window will be opened.
107+
Note that this can be interruptive.
108+
92109
When the buffer associated with the terminal is wiped out the job is killed,
93110
similar to calling `job_stop(job, "kill")`
94111

@@ -133,23 +150,26 @@ terminal. |term_setsize()| can be used only when in the first or second mode,
133150
not when 'termsize' is "rowsXcols".
134151

135152

136-
Terminal Normal mode ~
153+
Terminal-Job and Terminal-Normal mode ~
137154
*Terminal-mode*
138155
When the job is running the contents of the terminal is under control of the
139-
job. That includes the cursor position. The terminal contents can change at
140-
any time.
156+
job. That includes the cursor position. Typed keys are sent to the job.
157+
The terminal contents can change at any time. This is called Terminal-Job
158+
mode.
141159

142-
Use CTRL-W N (or 'termkey' N) to go to Terminal Normal mode. Now the contents
143-
of the terminal window is under control of Vim, the job output is suspended.
160+
Use CTRL-W N (or 'termkey' N) to switch to Terminal-Normal mode. Now the
161+
contents of the terminal window is under control of Vim, the job output is
162+
suspended. CTRL-\ CTRL-N does the same.
144163
*E946*
145-
In this mode you can move the cursor around with the usual Vim commands,
146-
Visually mark text, yank text, etc. But you cannot change the contents of the
147-
buffer. The commands that would start insert mode, such as 'i' and 'a',
148-
return control of the window to the job. Any pending output will now be
149-
displayed.
150-
151-
In Terminal mode the statusline and window title show "(Terminal)". If the
152-
job ends while in Terminal mode this changes to "(Terminal-finished)".
164+
In Terminal-Normal mode you can move the cursor around with the usual Vim
165+
commands, Visually mark text, yank text, etc. But you cannot change the
166+
contents of the buffer. The commands that would start insert mode, such as
167+
'i' and 'a', return to Terminal-Job mode. The window will be updated to show
168+
the contents of the terminal.
169+
170+
In Terminal-Normal mode the statusline and window title show "(Terminal)". If
171+
the job ends while in Terminal-Normal mode this changes to
172+
"(Terminal-finished)".
153173

154174

155175
Unix ~

0 commit comments

Comments
 (0)