summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-07-30 18:47:19 +0200
committerBram Moolenaar <Bram@vim.org>2017-07-30 18:47:19 +0200
commit0e23e9c5e74dbf0e5eec710c41c9eaed35794682 (patch)
treeb6d2b29dba71f64dd49240e5f4cc942eda8cc142
parent97870002d30a9846374d1ff7d73fbef351046f20 (diff)
patch 8.0.0819: cursor not positioned in terminal windowv8.0.0819
Problem: After changing current window the cursor position in the terminal window is not updated. Solution: Set w_wrow, w_wcol and w_valid.
-rw-r--r--src/terminal.c16
-rw-r--r--src/version.c2
2 files changed, 11 insertions, 7 deletions
diff --git a/src/terminal.c b/src/terminal.c
index 45c6175708..be76161e51 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -857,6 +857,14 @@ send_keys_to_term(term_T *term, int c, int typed)
return OK;
}
+ static void
+position_cursor(win_T *wp, VTermPos *pos)
+{
+ wp->w_wrow = MIN(pos->row, MAX(0, wp->w_height - 1));
+ wp->w_wcol = MIN(pos->col, MAX(0, wp->w_width - 1));
+ wp->w_valid |= (VALID_WCOL|VALID_WROW);
+}
+
/*
* Returns TRUE if the current window contains a terminal and we are sending
* keys to the job.
@@ -887,6 +895,7 @@ terminal_loop(void)
if (*curwin->w_p_tk != NUL)
termkey = string_to_key(curwin->w_p_tk, TRUE);
+ position_cursor(curwin, &curbuf->b_term->tl_cursor_pos);
for (;;)
{
@@ -972,13 +981,6 @@ term_job_ended(job_T *job)
}
static void
-position_cursor(win_T *wp, VTermPos *pos)
-{
- wp->w_wrow = MIN(pos->row, MAX(0, wp->w_height - 1));
- wp->w_wcol = MIN(pos->col, MAX(0, wp->w_width - 1));
-}
-
- static void
may_toggle_cursor(term_T *term)
{
if (curbuf == term->tl_buffer)
diff --git a/src/version.c b/src/version.c
index 5b831d4187..2d4c50e0ef 100644
--- 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 */
/**/
+ 819,
+/**/
818,
/**/
817,