forked from aniani/vim
patch 8.0.0819: cursor not positioned in terminal window
Problem: After changing current window the cursor position in the terminal
window is not updated.
Solution: Set w_wrow, w_wcol and w_valid.
This commit is contained in:
@@ -857,6 +857,14 @@ send_keys_to_term(term_T *term, int c, int typed)
|
|||||||
return OK;
|
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
|
* Returns TRUE if the current window contains a terminal and we are sending
|
||||||
* keys to the job.
|
* keys to the job.
|
||||||
@@ -887,6 +895,7 @@ terminal_loop(void)
|
|||||||
|
|
||||||
if (*curwin->w_p_tk != NUL)
|
if (*curwin->w_p_tk != NUL)
|
||||||
termkey = string_to_key(curwin->w_p_tk, TRUE);
|
termkey = string_to_key(curwin->w_p_tk, TRUE);
|
||||||
|
position_cursor(curwin, &curbuf->b_term->tl_cursor_pos);
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
@@ -971,13 +980,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
|
static void
|
||||||
may_toggle_cursor(term_T *term)
|
may_toggle_cursor(term_T *term)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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 */
|
||||||
|
/**/
|
||||||
|
819,
|
||||||
/**/
|
/**/
|
||||||
818,
|
818,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user