diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-11-15 20:32:58 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-11-15 20:32:58 +0100 |
commit | 6a07644db30cb5f3d0c6dc5eb2c348b6289da553 (patch) | |
tree | 809c5c0da918231439589f9e34b23b86c8f0aac6 /src/popupwin.c | |
parent | 2dfae04f376a58d4c5a801cb652c8eae65900672 (diff) | |
download | vim-git-6a07644db30cb5f3d0c6dc5eb2c348b6289da553.tar.gz |
patch 8.2.1990: cursor position wrong in terminal popup with finished jobv8.2.1990
Problem: Cursor position wrong in terminal popup with finished job.
Solution: Only add the top and left offset when not done already.
(closes #7298)
Diffstat (limited to 'src/popupwin.c')
-rw-r--r-- | src/popupwin.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/popupwin.c b/src/popupwin.c index ab1b6f6b6..90b107eb5 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -3743,13 +3743,17 @@ update_popups(void (*win_update)(win_T *wp)) wp->w_winrow -= top_off; wp->w_wincol -= left_extra; - // cursor position matters in terminal in job mode -#ifdef FEAT_TERMINAL - if (wp != curwin || !term_in_normal_mode()) -#endif + + // Add offset for border and padding if not done already. + if ((wp->w_flags & WFLAG_WCOL_OFF_ADDED) == 0) { - wp->w_wrow += top_off; wp->w_wcol += left_extra; + wp->w_flags |= WFLAG_WCOL_OFF_ADDED; + } + if ((wp->w_flags & WFLAG_WROW_OFF_ADDED) == 0) + { + wp->w_wrow += top_off; + wp->w_flags |= WFLAG_WROW_OFF_ADDED; } total_width = popup_width(wp); |