changeset 12003:6889f1f25d6b v8.0.0882

patch 8.0.0882: term_scrape() and term_getline() require two arguments commit https://github.com/vim/vim/commit/4535654246936de13eafd4e049b0a1991521fba4 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 6 17:53:31 2017 +0200 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)
author Christian Brabandt <cb@256bit.org>
date Sun, 06 Aug 2017 18:00:05 +0200
parents b2b8f6c69015
children 2b8cb306954f
files runtime/doc/eval.txt src/evalfunc.c src/version.c
diffstat 3 files changed, 29 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -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
@@ -2369,7 +2369,7 @@ tagfiles()			List	tags files used
 tan({expr})			Float	tangent of {expr}
 tanh({expr})			Float	hyperbolic tangent of {expr}
 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_getjob({buf})		Job	get the job associated with a terminal
 term_getline({buf}, {row})	String	get a line of text from a terminal
@@ -7916,32 +7916,37 @@ term_getattr({attr}, {what})				*term_ge
 			underline
 			strike
 			reverse
+		{only available when compiled with the |+terminal| feature}
 
 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
-		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
 		hidden.
-		
+
 		This is the cursor position of the terminal itself, not of the
 		Vim window.
 
 		{buf} must be the buffer number of a terminal window. If the
 		buffer does not exist or is not a terminal window, an empty
 		list is returned.
+		{only available when compiled with the |+terminal| feature}
 
 term_getjob({buf})					*term_getjob()*
 		Get the Job associated with terminal window {buf}.
 		{buf} is used as with |term_getsize()|.
 		Returns |v:null| when there is no job.
+		{only available when compiled with the |+terminal| feature}
 
 term_getline({buf}, {row})				*term_getline()*
 		Get a line of text from the terminal window of {buf}.
 		{buf} is used as with |term_getsize()|.
 
-		The first line has {row} one.  When {row} "." the cursor line
-		is used.  When {row} is invalid an empty string is returned.
+		The first line has {row} one.  When {row} is "." the cursor
+		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()*
 		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
 		empty string for the current buffer.  If the buffer does not
 		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()*
 		Get the status of terminal {buf}. This returns a comma
 		separated list of these items:
 			running		job is running
 			finished	job has finished
-			terminal	in Terminal-Normal mode
+			normal		in Terminal-Normal mode
 		One of "running" or "finished" is always present.
 
 		{buf} must be the buffer number of a terminal window. If the
 		buffer does not exist or is not a terminal window, an empty
 		string is returned.
+		{only available when compiled with the |+terminal| feature}
 
 term_gettitle({buf})					*term_gettitle()*
 		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
 		buffer does not exist or is not a terminal window, an empty
 		string is returned.
+		{only available when compiled with the |+terminal| feature}
 
 term_gettty({buf})					*term_gettty()*
 		Get the name of the controlling terminal associated with
 		terminal window {buf}.
 		{buf} is used as with |term_getsize()|.
+		{only available when compiled with the |+terminal| feature}
 
 term_list()						*term_list()*
 		Return a list with the buffer numbers of all buffers for
 		terminal windows.
+		{only available when compiled with the |+terminal| feature}
 
 term_scrape({buf}, {row})				*term_scrape()*
 		Get the contents of {row} of terminal screen of {buf}.
 		For {buf} see |term_getsize()|.
 
-		The first line has {row} one.  When {row} "." the cursor line
-		is used.  When {row} is invalid an empty string is returned.
+		The first line has {row} one.  When {row} is "." the cursor
+		line is used.  When {row} is invalid an empty string is
+		returned.
 
 		Return a List containing a Dict for each screen cell: 
 		    "chars"	character(s) at the cell
@@ -7995,6 +8006,7 @@ term_scrape({buf}, {row})				*term_scrap
 		    "attr"	attributes of the cell, use |term_getattr()|
 		    		to get the individual flags
 		    "width"	cell width: 1 or 2
+		{only available when compiled with the |+terminal| feature}
 
 term_sendkeys({buf}, {keys})				*term_sendkeys()*
 		Send keystrokes {keys} to terminal {buf}.
@@ -8002,6 +8014,7 @@ term_sendkeys({buf}, {keys})				*term_se
 
 		{keys} are translated as key sequences. For example, "\<c-x>"
 		means the character CTRL-X.
+		{only available when compiled with the |+terminal| feature}
 
 term_start({cmd}, {options})				*term_start()*
 		Open a terminal window and run {cmd} in it.
@@ -8026,10 +8039,12 @@ term_start({cmd}, {options})				*term_st
 		There is one extra option:
 		   "term_name"   name to use for the buffer name, instead of
 				 the command name.
+		{only available when compiled with the |+terminal| feature}
 
 term_wait({buf})						*term_wait()*
 		Wait for pending updates of {buf} to be handled.
 		{buf} is used as with |term_getsize()|.
+		{only available when compiled with the |+terminal| feature}
 
 test_alloc_fail({id}, {countdown}, {repeat})		*test_alloc_fail()*
 		This is for testing: If the memory allocation with {id} is
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -834,13 +834,13 @@ static struct fst
     {"term_getattr",	2, 2, f_term_getattr},
     {"term_getcursor",	1, 1, f_term_getcursor},
     {"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_getstatus",	1, 1, f_term_getstatus},
     {"term_gettitle",	1, 1, f_term_gettitle},
     {"term_gettty",	1, 1, f_term_gettty},
     {"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_start",	1, 2, f_term_start},
     {"term_wait",	1, 1, f_term_wait},
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    882,
+/**/
     881,
 /**/
     880,