1
0
forked from aniani/vim

patch 8.0.0882: term_scrape() and term_getline() require two arguments

Problem:    term_scrape() and term_getline() require two arguments but it is
            not enforced.
Solution:   Correct minimal number of arguments. (Hirohito Higashi)  Update
            documentation. (Ken Takata)
This commit is contained in:
Bram Moolenaar
2017-08-06 17:53:31 +02:00
parent e16b00a158
commit 4535654246
3 changed files with 29 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.0. Last change: 2017 Aug 05 *eval.txt* For Vim version 8.0. Last change: 2017 Aug 06
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2369,7 +2369,7 @@ tagfiles() List tags files used
tan({expr}) Float tangent of {expr} tan({expr}) Float tangent of {expr}
tanh({expr}) Float hyperbolic tangent of {expr} tanh({expr}) Float hyperbolic tangent of {expr}
tempname() String name for a temporary file tempname() String name for a temporary file
term_getattr({attr}, {what} Number get the value of attribute {what} term_getattr({attr}, {what}) Number get the value of attribute {what}
term_getcursor({buf}) List get the cursor position of a terminal term_getcursor({buf}) List get the cursor position of a terminal
term_getjob({buf}) Job get the job associated with 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_getline({buf}, {row}) String get a line of text from a terminal
@@ -7916,32 +7916,37 @@ term_getattr({attr}, {what}) *term_getattr()*
underline underline
strike strike
reverse reverse
{only available when compiled with the |+terminal| feature}
term_getcursor({buf}) *term_getcursor()* term_getcursor({buf}) *term_getcursor()*
Get the cusor position of terminal {buf}. Returns a list with Get the cursor position of terminal {buf}. Returns a list with
three numbers: [rows, cols, visible]. "rows" and "cols" are three numbers: [rows, cols, visible]. "rows" and "cols" are
one based, the first sceen cell is row 1, column 1. one based, the first screen cell is row 1, column 1.
"visible" is one when the cursor is visible, zero when it is "visible" is one when the cursor is visible, zero when it is
hidden. hidden.
This is the cursor position of the terminal itself, not of the This is the cursor position of the terminal itself, not of the
Vim window. Vim window.
{buf} must be the buffer number of a terminal window. If the {buf} must be the buffer number of a terminal window. If the
buffer does not exist or is not a terminal window, an empty buffer does not exist or is not a terminal window, an empty
list is returned. list is returned.
{only available when compiled with the |+terminal| feature}
term_getjob({buf}) *term_getjob()* term_getjob({buf}) *term_getjob()*
Get the Job associated with terminal window {buf}. Get the Job associated with terminal window {buf}.
{buf} is used as with |term_getsize()|. {buf} is used as with |term_getsize()|.
Returns |v:null| when there is no job. Returns |v:null| when there is no job.
{only available when compiled with the |+terminal| feature}
term_getline({buf}, {row}) *term_getline()* term_getline({buf}, {row}) *term_getline()*
Get a line of text from the terminal window of {buf}. Get a line of text from the terminal window of {buf}.
{buf} is used as with |term_getsize()|. {buf} is used as with |term_getsize()|.
The first line has {row} one. When {row} "." the cursor line The first line has {row} one. When {row} is "." the cursor
is used. When {row} is invalid an empty string is returned. 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()* term_getsize({buf}) *term_getsize()*
Get the size of terminal {buf}. Returns a list with two Get the size of terminal {buf}. Returns a list with two
@@ -7951,18 +7956,20 @@ term_getsize({buf}) *term_getsize()*
{buf} must be the buffer number of a terminal window. Use an {buf} must be the buffer number of a terminal window. Use an
empty string for the current buffer. If the buffer does not empty string for the current buffer. If the buffer does not
exist or is not a terminal window, an empty list is returned. 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()* term_getstatus({buf}) *term_getstatus()*
Get the status of terminal {buf}. This returns a comma Get the status of terminal {buf}. This returns a comma
separated list of these items: separated list of these items:
running job is running running job is running
finished job has finished finished job has finished
terminal in Terminal-Normal mode normal in Terminal-Normal mode
One of "running" or "finished" is always present. One of "running" or "finished" is always present.
{buf} must be the buffer number of a terminal window. If the {buf} must be the buffer number of a terminal window. If the
buffer does not exist or is not a terminal window, an empty buffer does not exist or is not a terminal window, an empty
string is returned. string is returned.
{only available when compiled with the |+terminal| feature}
term_gettitle({buf}) *term_gettitle()* term_gettitle({buf}) *term_gettitle()*
Get the title of terminal {buf}. This is the title that the Get the title of terminal {buf}. This is the title that the
@@ -7971,22 +7978,26 @@ term_gettitle({buf}) *term_gettitle()*
{buf} must be the buffer number of a terminal window. If the {buf} must be the buffer number of a terminal window. If the
buffer does not exist or is not a terminal window, an empty buffer does not exist or is not a terminal window, an empty
string is returned. string is returned.
{only available when compiled with the |+terminal| feature}
term_gettty({buf}) *term_gettty()* term_gettty({buf}) *term_gettty()*
Get the name of the controlling terminal associated with Get the name of the controlling terminal associated with
terminal window {buf}. terminal window {buf}.
{buf} is used as with |term_getsize()|. {buf} is used as with |term_getsize()|.
{only available when compiled with the |+terminal| feature}
term_list() *term_list()* term_list() *term_list()*
Return a list with the buffer numbers of all buffers for Return a list with the buffer numbers of all buffers for
terminal windows. terminal windows.
{only available when compiled with the |+terminal| feature}
term_scrape({buf}, {row}) *term_scrape()* term_scrape({buf}, {row}) *term_scrape()*
Get the contents of {row} of terminal screen of {buf}. Get the contents of {row} of terminal screen of {buf}.
For {buf} see |term_getsize()|. For {buf} see |term_getsize()|.
The first line has {row} one. When {row} "." the cursor line The first line has {row} one. When {row} is "." the cursor
is used. When {row} is invalid an empty string is returned. line is used. When {row} is invalid an empty string is
returned.
Return a List containing a Dict for each screen cell: Return a List containing a Dict for each screen cell:
"chars" character(s) at the cell "chars" character(s) at the cell
@@ -7995,6 +8006,7 @@ term_scrape({buf}, {row}) *term_scrape()*
"attr" attributes of the cell, use |term_getattr()| "attr" attributes of the cell, use |term_getattr()|
to get the individual flags to get the individual flags
"width" cell width: 1 or 2 "width" cell width: 1 or 2
{only available when compiled with the |+terminal| feature}
term_sendkeys({buf}, {keys}) *term_sendkeys()* term_sendkeys({buf}, {keys}) *term_sendkeys()*
Send keystrokes {keys} to terminal {buf}. Send keystrokes {keys} to terminal {buf}.
@@ -8002,6 +8014,7 @@ term_sendkeys({buf}, {keys}) *term_sendkeys()*
{keys} are translated as key sequences. For example, "\<c-x>" {keys} are translated as key sequences. For example, "\<c-x>"
means the character CTRL-X. means the character CTRL-X.
{only available when compiled with the |+terminal| feature}
term_start({cmd}, {options}) *term_start()* term_start({cmd}, {options}) *term_start()*
Open a terminal window and run {cmd} in it. Open a terminal window and run {cmd} in it.
@@ -8026,10 +8039,12 @@ term_start({cmd}, {options}) *term_start()*
There is one extra option: There is one extra option:
"term_name" name to use for the buffer name, instead of "term_name" name to use for the buffer name, instead of
the command name. the command name.
{only available when compiled with the |+terminal| feature}
term_wait({buf}) *term_wait()* term_wait({buf}) *term_wait()*
Wait for pending updates of {buf} to be handled. Wait for pending updates of {buf} to be handled.
{buf} is used as with |term_getsize()|. {buf} is used as with |term_getsize()|.
{only available when compiled with the |+terminal| feature}
test_alloc_fail({id}, {countdown}, {repeat}) *test_alloc_fail()* test_alloc_fail({id}, {countdown}, {repeat}) *test_alloc_fail()*
This is for testing: If the memory allocation with {id} is This is for testing: If the memory allocation with {id} is

View File

@@ -834,13 +834,13 @@ static struct fst
{"term_getattr", 2, 2, f_term_getattr}, {"term_getattr", 2, 2, f_term_getattr},
{"term_getcursor", 1, 1, f_term_getcursor}, {"term_getcursor", 1, 1, f_term_getcursor},
{"term_getjob", 1, 1, f_term_getjob}, {"term_getjob", 1, 1, f_term_getjob},
{"term_getline", 1, 2, f_term_getline}, {"term_getline", 2, 2, f_term_getline},
{"term_getsize", 1, 1, f_term_getsize}, {"term_getsize", 1, 1, f_term_getsize},
{"term_getstatus", 1, 1, f_term_getstatus}, {"term_getstatus", 1, 1, f_term_getstatus},
{"term_gettitle", 1, 1, f_term_gettitle}, {"term_gettitle", 1, 1, f_term_gettitle},
{"term_gettty", 1, 1, f_term_gettty}, {"term_gettty", 1, 1, f_term_gettty},
{"term_list", 0, 0, f_term_list}, {"term_list", 0, 0, f_term_list},
{"term_scrape", 1, 2, f_term_scrape}, {"term_scrape", 2, 2, f_term_scrape},
{"term_sendkeys", 2, 2, f_term_sendkeys}, {"term_sendkeys", 2, 2, f_term_sendkeys},
{"term_start", 1, 2, f_term_start}, {"term_start", 1, 2, f_term_start},
{"term_wait", 1, 1, f_term_wait}, {"term_wait", 1, 1, f_term_wait},

View File

@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
882,
/**/ /**/
881, 881,
/**/ /**/