Skip to content

Commit f545269

Browse files
committed
patch 8.2.2067: cursor position in popup terminal is wrong
Problem: Cursor position in popup terminal is wrong. Solution: Don't check the flags.
1 parent ce2c544 commit f545269

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

src/terminal.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2207,10 +2207,8 @@ position_cursor(win_T *wp, VTermPos *pos)
22072207
#ifdef FEAT_PROP_POPUP
22082208
if (popup_is_popup(wp))
22092209
{
2210-
if ((wp->w_flags & WFLAG_WROW_OFF_ADDED) == 0)
2211-
wp->w_wrow += popup_top_extra(wp);
2212-
if ((wp->w_flags & WFLAG_WCOL_OFF_ADDED) == 0)
2213-
wp->w_wcol += popup_left_extra(wp);
2210+
wp->w_wrow += popup_top_extra(wp);
2211+
wp->w_wcol += popup_left_extra(wp);
22142212
wp->w_flags |= WFLAG_WCOL_OFF_ADDED | WFLAG_WROW_OFF_ADDED;
22152213
}
22162214
else

src/testdir/test_popupwin.vim

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2662,10 +2662,18 @@ func Test_popupwin_terminal_buffer()
26622662
help
26632663

26642664
let termbuf = term_start(&shell, #{hidden: 1})
2665-
let winid = popup_create(termbuf, #{minwidth: 40, minheight: 10})
2666-
" Wait for shell to start
2665+
let winid = popup_create(termbuf, #{minwidth: 40, minheight: 10, border: []})
2666+
" Wait for shell to start and show a prompt
26672667
call WaitForAssert({-> assert_equal("run", job_status(term_getjob(termbuf)))})
2668-
sleep 100m
2668+
sleep 20m
2669+
2670+
" When typing a character, the cursor is after it.
2671+
call feedkeys("x", 'xt')
2672+
sleep 10m
2673+
redraw
2674+
call WaitForAssert({ -> assert_equal('x', screenstring(screenrow(), screencol() - 1))})
2675+
call feedkeys("\<BS>", 'xt')
2676+
26692677
" Check this doesn't crash
26702678
call assert_equal(winnr(), winnr('j'))
26712679
call assert_equal(winnr(), winnr('k'))

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2067,
753755
/**/
754756
2066,
755757
/**/

0 commit comments

Comments
 (0)