Skip to content

Commit 47d9133

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents a9f4184 + a9f8ee0 commit 47d9133

43 files changed

Lines changed: 1518 additions & 557 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

runtime/doc/eval.txt

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4747,6 +4747,8 @@ getwininfo([{winid}]) *getwininfo()*
47474747
{only with the +quickfix feature}
47484748
quickfix 1 if quickfix or location list window
47494749
{only with the +quickfix feature}
4750+
terminal 1 if a terminal window
4751+
{only with the +terminal feature}
47504752
tabnr tab page number
47514753
variables a reference to the dictionary with
47524754
window-local variables
@@ -7023,7 +7025,10 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
70237025
freed.
70247026

70257027
If {action} is not present or is set to ' ', then a new list
7026-
is created.
7028+
is created. The new quickfix list is added after the current
7029+
quickfix list in the stack and all the following lists are
7030+
freed. To add a new quickfix list at the end of the stack,
7031+
set "nr" in {what} to '$'.
70277032

70287033
If the optional {what} dictionary argument is supplied, then
70297034
only the items listed in {what} are set. The first {list}
@@ -7939,13 +7944,19 @@ term_getattr({attr}, {what}) *term_getattr()*
79397944

79407945
term_getcursor({buf}) *term_getcursor()*
79417946
Get the cursor position of terminal {buf}. Returns a list with
7942-
three numbers: [rows, cols, visible]. "rows" and "cols" are
7943-
one based, the first screen cell is row 1, column 1.
7944-
"visible" is one when the cursor is visible, zero when it is
7945-
hidden.
7947+
two numbers and a dictionary: [rows, cols, dict].
79467948

7947-
This is the cursor position of the terminal itself, not of the
7948-
Vim window.
7949+
"rows" and "cols" are one based, the first screen cell is row
7950+
1, column 1. This is the cursor position of the terminal
7951+
itself, not of the Vim window.
7952+
7953+
"dict" can have these members:
7954+
"visible" one when the cursor is visible, zero when it
7955+
is hidden.
7956+
"blink" one when the cursor is visible, zero when it
7957+
is hidden.
7958+
"shape" 1 for a block cursor, 2 for underline and 3
7959+
for a vertical bar.
79497960

79507961
{buf} must be the buffer number of a terminal window. If the
79517962
buffer does not exist or is not a terminal window, an empty
@@ -8035,7 +8046,7 @@ term_scrape({buf}, {row}) *term_scrape()*
80358046
"fg" foreground color as #rrggbb
80368047
"bg" background color as #rrggbb
80378048
"attr" attributes of the cell, use |term_getattr()|
8038-
to get the individual flags
8049+
to get the individual flags
80398050
"width" cell width: 1 or 2
80408051
{only available when compiled with the |+terminal| feature}
80418052

@@ -8075,7 +8086,7 @@ term_start({cmd}, {options}) *term_start()*
80758086
"term_rows" vertical size to use for the terminal,
80768087
instead of using 'termsize'
80778088
"term_cols" horizontal size to use for the terminal,
8078-
instead of using 'termsize'
8089+
instead of using 'termsize'
80798090
"vertical" split the window vertically
80808091
"curwin" use the current window, do not split the
80818092
window; fails if the current buffer
@@ -8085,6 +8096,12 @@ term_start({cmd}, {options}) *term_start()*
80858096
"open": open window if needed
80868097
Note that "open" can be interruptive.
80878098
See |term++close| and |term++open|.
8099+
"term_opencmd" command to use for opening the window when
8100+
"open" is used for "term_finish"; must
8101+
have "%d" where the buffer number goes,
8102+
e.g. "10split|buffer %d"; when not
8103+
specified "botright sbuf %d" is used
8104+
80888105
{only available when compiled with the |+terminal| feature}
80898106

80908107
term_wait({buf} [, {time}]) *term_wait()*
@@ -8159,7 +8176,7 @@ test_override({name}, {val}) *test_override()*
81598176
in a way that the test doesn't work properly.
81608177
When using: >
81618178
call test_override('starting', 1)
8162-
< The value of "starting" is saved. It is restored by: >
8179+
< The value of "starting" is saved. It is restored by: >
81638180
call test_override('starting', 0)
81648181
81658182
test_settime({expr}) *test_settime()*

runtime/doc/syntax.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4689,6 +4689,7 @@ the same syntax file on all terminals, and use the optimal highlighting.
46894689

46904690
*bold* *underline* *undercurl*
46914691
*inverse* *italic* *standout*
4692+
*nocombine*
46924693
term={attr-list} *attr-list* *highlight-term* *E418*
46934694
attr-list is a comma separated list (without spaces) of the
46944695
following items (in any order):
@@ -4699,6 +4700,7 @@ term={attr-list} *attr-list* *highlight-term* *E418*
46994700
inverse same as reverse
47004701
italic
47014702
standout
4703+
nocombine override attributes instead of combining them
47024704
NONE no attributes used (used to reset it)
47034705

47044706
Note that "bold" can be used here and by using a bold font. They

runtime/doc/terminal.txt

Lines changed: 18 additions & 2 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 10
1+
*terminal.txt* For Vim version 8.0. Last change: 2017 Aug 12
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -103,8 +103,17 @@ Syntax ~
103103
++close The terminal window will close
104104
automatically when the job terminates.
105105
++open When the job terminates and no window
106-
show it, a window will be opened.
106+
shows it, a window will be opened.
107107
Note that this can be interruptive.
108+
++curwin Open the terminal in the current
109+
window, do not split the current
110+
window. Fails if the current buffer
111+
cannot be |abandon|ed.
112+
++hidden Open the terminal in a hidden buffer,
113+
no window will be used.
114+
115+
If you want to use more options use the |term_start()|
116+
function.
108117

109118
When the buffer associated with the terminal is wiped out the job is killed,
110119
similar to calling `job_stop(job, "kill")`
@@ -114,6 +123,13 @@ So long as the job is running: If the window is closed the buffer becomes
114123
hidden. The command will not be stopped. The `:buffer` command can be used
115124
to turn the current window into a terminal window. If there are unsaved
116125
changes this fails, use ! to force, as usual.
126+
127+
To have a background job run without a window, and open the window when it's
128+
done, use options like this: >
129+
:term ++hidden ++open make
130+
Note that the window will open at an unexpected moment, this will interrupt
131+
what you are doing.
132+
117133
*E947*
118134
So long as the job is running, the buffer is considered modified and Vim
119135
cannot be quit easily, see |abandon|.

src/buffer.c

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3038,6 +3038,8 @@ buflist_list(exarg_T *eap)
30383038
buf_T *buf;
30393039
int len;
30403040
int i;
3041+
int ro_char;
3042+
int changed_char;
30413043

30423044
for (buf = firstbuf; buf != NULL && !got_int; buf = buf->b_next)
30433045
{
@@ -3064,6 +3066,21 @@ buflist_list(exarg_T *eap)
30643066
if (message_filtered(NameBuff))
30653067
continue;
30663068

3069+
changed_char = (buf->b_flags & BF_READERR) ? 'x'
3070+
: (bufIsChanged(buf) ? '+' : ' ');
3071+
#ifdef FEAT_TERMINAL
3072+
if (term_job_running(buf->b_term))
3073+
{
3074+
ro_char = 'R';
3075+
changed_char = ' '; /* bufIsChanged() returns TRUE to avoid
3076+
* closing, but it's not actually changed. */
3077+
}
3078+
else if (buf->b_term != NULL)
3079+
ro_char = 'F';
3080+
else
3081+
#endif
3082+
ro_char = !buf->b_p_ma ? '-' : (buf->b_p_ro ? '=' : ' ');
3083+
30673084
msg_putchar('\n');
30683085
len = vim_snprintf((char *)IObuff, IOSIZE - 20, "%3d%c%c%c%c%c \"%s\"",
30693086
buf->b_fnum,
@@ -3072,9 +3089,8 @@ buflist_list(exarg_T *eap)
30723089
(curwin->w_alt_fnum == buf->b_fnum ? '#' : ' '),
30733090
buf->b_ml.ml_mfp == NULL ? ' ' :
30743091
(buf->b_nwindows == 0 ? 'h' : 'a'),
3075-
!buf->b_p_ma ? '-' : (buf->b_p_ro ? '=' : ' '),
3076-
(buf->b_flags & BF_READERR) ? 'x'
3077-
: (bufIsChanged(buf) ? '+' : ' '),
3092+
ro_char,
3093+
changed_char,
30783094
NameBuff);
30793095
if (len > IOSIZE - 20)
30803096
len = IOSIZE - 20;
@@ -5668,6 +5684,9 @@ write_viminfo_bufferlist(FILE *fp)
56685684
|| !buf->b_p_bl
56695685
#ifdef FEAT_QUICKFIX
56705686
|| bt_quickfix(buf)
5687+
#endif
5688+
#ifdef FEAT_TERMINAL
5689+
|| bt_terminal(buf)
56715690
#endif
56725691
|| removable(buf->b_ffname))
56735692
continue;

0 commit comments

Comments
 (0)