Skip to content

Commit 321a0c8

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 90a265c + eb44a68 commit 321a0c8

27 files changed

+503
-300
lines changed

runtime/doc/eval.txt

Lines changed: 14 additions & 5 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 01
1+
*eval.txt* For Vim version 8.0. Last change: 2017 Aug 03
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2376,6 +2376,7 @@ term_getline({buf}, {row}) String get a line of text from a terminal
23762376
term_getsize({buf}) List get the size of a terminal
23772377
term_getstatus({buf}) String get the status of a terminal
23782378
term_gettitle({buf}) String get the title of a terminal
2379+
term_gettty({buf}) String get the tty name of a terminal
23792380
term_list() List get the list of terminal buffers
23802381
term_scrape({buf}, {row}) List get row of a terminal screen
23812382
term_sendkeys({buf}, {keys}) none send keystrokes to a terminal
@@ -5192,6 +5193,8 @@ job_info({job}) *job_info()*
51925193
Returns a Dictionary with information about {job}:
51935194
"status" what |job_status()| returns
51945195
"channel" what |job_getchannel()| returns
5196+
"process" process ID
5197+
"tty" controlling terminal name, empty when none
51955198
"exitval" only valid when "status" is "dead"
51965199
"exit_cb" function to be called on exit
51975200
"stoponexit" |job-stoponexit|
@@ -7930,6 +7933,7 @@ term_getcursor({buf}) *term_getcursor()*
79307933
term_getjob({buf}) *term_getjob()*
79317934
Get the Job associated with terminal window {buf}.
79327935
{buf} is used as with |term_getsize()|.
7936+
Returns |v:null| when there is no job.
79337937

79347938
term_getline({buf}, {row}) *term_getline()*
79357939
Get a line of text from the terminal window of {buf}.
@@ -7943,9 +7947,9 @@ term_getsize({buf}) *term_getsize()*
79437947
numbers: [rows, cols]. This is the size of the terminal, not
79447948
the window containing the terminal.
79457949

7946-
{buf} must be the buffer number of a terminal window. If the
7947-
buffer does not exist or is not a terminal window, an empty
7948-
list is returned.
7950+
{buf} must be the buffer number of a terminal window. Use an
7951+
empty string for the current buffer. If the buffer does not
7952+
exist or is not a terminal window, an empty list is returned.
79497953

79507954
term_getstatus({buf}) *term_getstatus()*
79517955
Get the status of terminal {buf}. This returns a comma
@@ -7967,6 +7971,11 @@ term_gettitle({buf}) *term_gettitle()*
79677971
buffer does not exist or is not a terminal window, an empty
79687972
string is returned.
79697973

7974+
term_gettty({buf}) *term_gettty()*
7975+
Get the name of the controlling terminal associated with
7976+
terminal window {buf}.
7977+
{buf} is used as with |term_getsize()|.
7978+
79707979
term_list() *term_list()*
79717980
Return a list with the buffer numbers of all buffers for
79727981
terminal windows.
@@ -7982,7 +7991,7 @@ term_scrape({buf}, {row}) *term_scrape()*
79827991
"chars" character(s) at the cell
79837992
"fg" foreground color as #rrggbb
79847993
"bg" background color as #rrggbb
7985-
"attr" attributes of the cell, use term_getattr()
7994+
"attr" attributes of the cell, use |term_getattr()|
79867995
to get the individual flags
79877996
"width" cell width: 1 or 2
79887997

src/buffer.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,7 @@ set_curbuf(buf_T *buf, int action)
17401740
u_sync(FALSE);
17411741
close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf,
17421742
unload ? action : (action == DOBUF_GOTO
1743-
&& !P_HID(prevbuf)
1743+
&& !buf_hide(prevbuf)
17441744
&& !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE);
17451745
#ifdef FEAT_WINDOWS
17461746
if (curwin != previouswin && win_valid(previouswin))
@@ -4996,12 +4996,12 @@ do_arg_all(
49964996

49974997
if (i == opened_len && !keep_tabs)/* close this window */
49984998
{
4999-
if (P_HID(buf) || forceit || buf->b_nwindows > 1
4999+
if (buf_hide(buf) || forceit || buf->b_nwindows > 1
50005000
|| !bufIsChanged(buf))
50015001
{
50025002
/* If the buffer was changed, and we would like to hide it,
50035003
* try autowriting. */
5004-
if (!P_HID(buf) && buf->b_nwindows <= 1
5004+
if (!buf_hide(buf) && buf->b_nwindows <= 1
50055005
&& bufIsChanged(buf))
50065006
{
50075007
#ifdef FEAT_AUTOCMD
@@ -5028,7 +5028,7 @@ do_arg_all(
50285028
#ifdef FEAT_WINDOWS
50295029
else
50305030
{
5031-
win_close(wp, !P_HID(buf) && !bufIsChanged(buf));
5031+
win_close(wp, !buf_hide(buf) && !bufIsChanged(buf));
50325032
# ifdef FEAT_AUTOCMD
50335033
/* check if autocommands removed the next window */
50345034
if (!win_valid(wpnext))
@@ -5127,7 +5127,7 @@ do_arg_all(
51275127
}
51285128
(void)do_ecmd(0, alist_name(&AARGLIST(alist)[i]), NULL, NULL,
51295129
ECMD_ONE,
5130-
((P_HID(curwin->w_buffer)
5130+
((buf_hide(curwin->w_buffer)
51315131
|| bufIsChanged(curwin->w_buffer)) ? ECMD_HIDE : 0)
51325132
+ ECMD_OLDBUF, curwin);
51335133
#ifdef FEAT_AUTOCMD
@@ -5382,7 +5382,7 @@ ex_buffer_all(exarg_T *eap)
53825382
*/
53835383
for (wp = lastwin; open_wins > count; )
53845384
{
5385-
r = (P_HID(wp->w_buffer) || !bufIsChanged(wp->w_buffer)
5385+
r = (buf_hide(wp->w_buffer) || !bufIsChanged(wp->w_buffer)
53865386
|| autowrite(wp->w_buffer, FALSE) == OK);
53875387
#ifdef FEAT_AUTOCMD
53885388
if (!win_valid(wp))
@@ -5394,7 +5394,7 @@ ex_buffer_all(exarg_T *eap)
53945394
#endif
53955395
if (r)
53965396
{
5397-
win_close(wp, !P_HID(wp->w_buffer));
5397+
win_close(wp, !buf_hide(wp->w_buffer));
53985398
--open_wins;
53995399
wp = lastwin;
54005400
}

0 commit comments

Comments
 (0)