patch 8.0.0817: cannot get the terminal line at the cursor

Problem:    Cannot get the line of a terminal window at the cursor.
Solution:   Make the row argunt optionsl. (Yasuhiro Matsumoto, closes #1898)
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 7a2e4aa..f1de7e5 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -833,10 +833,10 @@
 #ifdef FEAT_TERMINAL
     {"term_getattr",	2, 2, f_term_getattr},
     {"term_getjob",	1, 1, f_term_getjob},
-    {"term_getline",	2, 2, f_term_getline},
+    {"term_getline",	1, 2, f_term_getline},
     {"term_getsize",	1, 1, f_term_getsize},
     {"term_list",	0, 0, f_term_list},
-    {"term_scrape",	2, 2, f_term_scrape},
+    {"term_scrape",	1, 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},
diff --git a/src/terminal.c b/src/terminal.c
index f526108..8febb8d 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -53,6 +53,7 @@
  *      :term <24x80> <close> vim notes.txt
  * - To set BS correctly, check get_stty(); Pass the fd of the pty.
  * - do not store terminal window in viminfo.  Or prefix term:// ?
+ * - add term_getcursor() - return cursor position: [row, col, visible]
  * - add a character in :ls output
  * - add 't' to mode()
  * - when closing window and job has not ended, make terminal hidden?
@@ -120,7 +121,7 @@
     garray_T	tl_scrollback;
     int		tl_scrollback_scrolled;
 
-    pos_T	tl_cursor;
+    VTermPos	tl_cursor_pos;
     int		tl_cursor_visible;
 };
 
@@ -1020,20 +1021,16 @@
 {
     term_T	*term = (term_T *)user;
     win_T	*wp;
-    int		is_current = FALSE;
+
+    term->tl_cursor_pos = pos;
+    term->tl_cursor_visible = visible;
 
     FOR_ALL_WINDOWS(wp)
     {
 	if (wp->w_buffer == term->tl_buffer)
-	{
 	    position_cursor(wp, &pos);
-	    if (wp == curwin)
-		is_current = TRUE;
-	}
     }
-
-    term->tl_cursor_visible = visible;
-    if (is_current)
+    if (term->tl_buffer == curbuf)
     {
 	may_toggle_cursor(term);
 	update_cursor(term, TRUE);
@@ -1723,7 +1720,10 @@
     if (buf == NULL)
 	return;
     term = buf->b_term;
-    row = (int)get_tv_number(&argvars[1]);
+    if (argvars[1].v_type == VAR_UNKNOWN)
+	row = term->tl_cursor_pos.row;
+    else
+	row = (int)get_tv_number(&argvars[1]);
 
     if (term->tl_vterm == NULL)
     {
@@ -1814,7 +1814,10 @@
 	screen = vterm_obtain_screen(term->tl_vterm);
 
     l = rettv->vval.v_list;
-    pos.row = (int)get_tv_number(&argvars[1]);
+    if (argvars[1].v_type == VAR_UNKNOWN)
+	pos.row = term->tl_cursor_pos.row;
+    else
+	pos.row = (int)get_tv_number(&argvars[1]);
     for (pos.col = 0; pos.col < term->tl_cols; )
     {
 	dict_T		*dcell;
diff --git a/src/version.c b/src/version.c
index f601bfd..21cd3e2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    817,
+/**/
     816,
 /**/
     815,