Mercurial > vim
changeset 11878:a83b19a8d7e4 v8.0.0819
patch 8.0.0819: cursor not positioned in terminal window
commit https://github.com/vim/vim/commit/0e23e9c5e74dbf0e5eec710c41c9eaed35794682
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 30 18:47:19 2017 +0200
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 30 Jul 2017 19:00:04 +0200 |
parents | 756b19fccb6a |
children | b4616f82466a |
files | src/terminal.c src/version.c |
diffstat | 2 files changed, 11 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/terminal.c +++ b/src/terminal.c @@ -857,6 +857,14 @@ send_keys_to_term(term_T *term, int c, i 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)