Skip to content

Commit 4535654

Browse files
committed
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)
1 parent e16b00a commit 4535654

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

runtime/doc/eval.txt

Lines changed: 25 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 05
1+
*eval.txt* For Vim version 8.0. Last change: 2017 Aug 06
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2369,7 +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_getattr({attr}, {what} Number get the value of attribute {what}
2372+
term_getattr({attr}, {what}) Number get the value of attribute {what}
23732373
term_getcursor({buf}) List get the cursor position of a terminal
23742374
term_getjob({buf}) Job get the job associated with a terminal
23752375
term_getline({buf}, {row}) String get a line of text from a terminal
@@ -7916,32 +7916,37 @@ term_getattr({attr}, {what}) *term_getattr()*
79167916
underline
79177917
strike
79187918
reverse
7919+
{only available when compiled with the |+terminal| feature}
79197920

79207921
term_getcursor({buf}) *term_getcursor()*
7921-
Get the cusor position of terminal {buf}. Returns a list with
7922+
Get the cursor position of terminal {buf}. Returns a list with
79227923
three numbers: [rows, cols, visible]. "rows" and "cols" are
7923-
one based, the first sceen cell is row 1, column 1.
7924+
one based, the first screen cell is row 1, column 1.
79247925
"visible" is one when the cursor is visible, zero when it is
79257926
hidden.
7926-
7927+
79277928
This is the cursor position of the terminal itself, not of the
79287929
Vim window.
79297930

79307931
{buf} must be the buffer number of a terminal window. If the
79317932
buffer does not exist or is not a terminal window, an empty
79327933
list is returned.
7934+
{only available when compiled with the |+terminal| feature}
79337935

79347936
term_getjob({buf}) *term_getjob()*
79357937
Get the Job associated with terminal window {buf}.
79367938
{buf} is used as with |term_getsize()|.
79377939
Returns |v:null| when there is no job.
7940+
{only available when compiled with the |+terminal| feature}
79387941

79397942
term_getline({buf}, {row}) *term_getline()*
79407943
Get a line of text from the terminal window of {buf}.
79417944
{buf} is used as with |term_getsize()|.
79427945

7943-
The first line has {row} one. When {row} "." the cursor line
7944-
is used. When {row} is invalid an empty string is returned.
7946+
The first line has {row} one. When {row} is "." the cursor
7947+
line is used. When {row} is invalid an empty string is
7948+
returned.
7949+
{only available when compiled with the |+terminal| feature}
79457950

79467951
term_getsize({buf}) *term_getsize()*
79477952
Get the size of terminal {buf}. Returns a list with two
@@ -7951,18 +7956,20 @@ term_getsize({buf}) *term_getsize()*
79517956
{buf} must be the buffer number of a terminal window. Use an
79527957
empty string for the current buffer. If the buffer does not
79537958
exist or is not a terminal window, an empty list is returned.
7959+
{only available when compiled with the |+terminal| feature}
79547960

79557961
term_getstatus({buf}) *term_getstatus()*
79567962
Get the status of terminal {buf}. This returns a comma
79577963
separated list of these items:
79587964
running job is running
79597965
finished job has finished
7960-
terminal in Terminal-Normal mode
7966+
normal in Terminal-Normal mode
79617967
One of "running" or "finished" is always present.
79627968

79637969
{buf} must be the buffer number of a terminal window. If the
79647970
buffer does not exist or is not a terminal window, an empty
79657971
string is returned.
7972+
{only available when compiled with the |+terminal| feature}
79667973

79677974
term_gettitle({buf}) *term_gettitle()*
79687975
Get the title of terminal {buf}. This is the title that the
@@ -7971,22 +7978,26 @@ term_gettitle({buf}) *term_gettitle()*
79717978
{buf} must be the buffer number of a terminal window. If the
79727979
buffer does not exist or is not a terminal window, an empty
79737980
string is returned.
7981+
{only available when compiled with the |+terminal| feature}
79747982

79757983
term_gettty({buf}) *term_gettty()*
79767984
Get the name of the controlling terminal associated with
79777985
terminal window {buf}.
79787986
{buf} is used as with |term_getsize()|.
7987+
{only available when compiled with the |+terminal| feature}
79797988

79807989
term_list() *term_list()*
79817990
Return a list with the buffer numbers of all buffers for
79827991
terminal windows.
7992+
{only available when compiled with the |+terminal| feature}
79837993

79847994
term_scrape({buf}, {row}) *term_scrape()*
79857995
Get the contents of {row} of terminal screen of {buf}.
79867996
For {buf} see |term_getsize()|.
79877997

7988-
The first line has {row} one. When {row} "." the cursor line
7989-
is used. When {row} is invalid an empty string is returned.
7998+
The first line has {row} one. When {row} is "." the cursor
7999+
line is used. When {row} is invalid an empty string is
8000+
returned.
79908001

79918002
Return a List containing a Dict for each screen cell:
79928003
"chars" character(s) at the cell
@@ -7995,13 +8006,15 @@ term_scrape({buf}, {row}) *term_scrape()*
79958006
"attr" attributes of the cell, use |term_getattr()|
79968007
to get the individual flags
79978008
"width" cell width: 1 or 2
8009+
{only available when compiled with the |+terminal| feature}
79988010

79998011
term_sendkeys({buf}, {keys}) *term_sendkeys()*
80008012
Send keystrokes {keys} to terminal {buf}.
80018013
{buf} is used as with |term_getsize()|.
80028014

80038015
{keys} are translated as key sequences. For example, "\<c-x>"
80048016
means the character CTRL-X.
8017+
{only available when compiled with the |+terminal| feature}
80058018

80068019
term_start({cmd}, {options}) *term_start()*
80078020
Open a terminal window and run {cmd} in it.
@@ -8026,10 +8039,12 @@ term_start({cmd}, {options}) *term_start()*
80268039
There is one extra option:
80278040
"term_name" name to use for the buffer name, instead of
80288041
the command name.
8042+
{only available when compiled with the |+terminal| feature}
80298043

80308044
term_wait({buf}) *term_wait()*
80318045
Wait for pending updates of {buf} to be handled.
80328046
{buf} is used as with |term_getsize()|.
8047+
{only available when compiled with the |+terminal| feature}
80338048

80348049
test_alloc_fail({id}, {countdown}, {repeat}) *test_alloc_fail()*
80358050
This is for testing: If the memory allocation with {id} is

src/evalfunc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,13 +834,13 @@ static struct fst
834834
{"term_getattr", 2, 2, f_term_getattr},
835835
{"term_getcursor", 1, 1, f_term_getcursor},
836836
{"term_getjob", 1, 1, f_term_getjob},
837-
{"term_getline", 1, 2, f_term_getline},
837+
{"term_getline", 2, 2, f_term_getline},
838838
{"term_getsize", 1, 1, f_term_getsize},
839839
{"term_getstatus", 1, 1, f_term_getstatus},
840840
{"term_gettitle", 1, 1, f_term_gettitle},
841841
{"term_gettty", 1, 1, f_term_gettty},
842842
{"term_list", 0, 0, f_term_list},
843-
{"term_scrape", 1, 2, f_term_scrape},
843+
{"term_scrape", 2, 2, f_term_scrape},
844844
{"term_sendkeys", 2, 2, f_term_sendkeys},
845845
{"term_start", 1, 2, f_term_start},
846846
{"term_wait", 1, 1, f_term_wait},

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
882,
772774
/**/
773775
881,
774776
/**/

0 commit comments

Comments
 (0)