summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/move.c5
-rw-r--r--src/testdir/test_cursor_func.vim2
-rw-r--r--src/version.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/src/move.c b/src/move.c
index b8e8780aa5..f52e4c071e 100644
--- a/src/move.c
+++ b/src/move.c
@@ -1262,12 +1262,15 @@ textpos2screenpos(
if (col >= wp->w_width)
col = -1;
if (col >= 0 && row + rowoff <= wp->w_height)
+ {
coloff = col - scol + wp->w_wincol + 1;
+ row += W_WINROW(wp);
+ }
else
// character is left, right or below of the window
row = rowoff = scol = ccol = ecol = 0;
}
- *rowp = W_WINROW(wp) + row + rowoff;
+ *rowp = row + rowoff;
*scolp = scol + coloff;
*ccolp = ccol + coloff;
*ecolp = ecol + coloff;
diff --git a/src/testdir/test_cursor_func.vim b/src/testdir/test_cursor_func.vim
index 965c704960..bc12511aff 100644
--- a/src/testdir/test_cursor_func.vim
+++ b/src/testdir/test_cursor_func.vim
@@ -124,7 +124,7 @@ func Test_screenpos()
\ 'col': wincol + 7,
\ 'curscol': wincol + 7,
\ 'endcol': wincol + 7}, winid->screenpos(line('$'), 8))
- call assert_equal({'row': winrow - 1, 'col': 0, 'curscol': 0, 'endcol': 0},
+ call assert_equal({'row': 0, 'col': 0, 'curscol': 0, 'endcol': 0},
\ winid->screenpos(line('$'), 22))
close
diff --git a/src/version.c b/src/version.c
index c75fe99375..2208c1c2ad 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 4204,
+/**/
4203,
/**/
4202,