summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c
index 50e87081f..e6175f6ba 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -11941,7 +11941,8 @@ getpos_both(argvars, rettv, getcurpos)
#endif
(varnumber_T)0);
if (getcurpos)
- list_append_number(l, (varnumber_T)curwin->w_curswant + 1);
+ list_append_number(l, curwin->w_curswant == MAXCOL ?
+ (varnumber_T)MAXCOL : (varnumber_T)curwin->w_curswant + 1);
}
else
rettv->vval.v_number = FALSE;