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 740b8dd41..ca9e2dcc1 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -10388,7 +10388,8 @@ f_getpos(argvars, rettv)
list_append_number(l, (varnumber_T)0);
list_append_number(l, (fp != NULL) ? (varnumber_T)fp->lnum
: (varnumber_T)0);
- list_append_number(l, (fp != NULL) ? (varnumber_T)fp->col + 1
+ list_append_number(l, (fp != NULL)
+ ? (varnumber_T)(fp->col == MAXCOL ? MAXCOL : fp->col + 1)
: (varnumber_T)0);
list_append_number(l,
#ifdef FEAT_VIRTUALEDIT