aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/move.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c
index 12fb7d1f82..bbc3d792c0 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -1125,6 +1125,9 @@ void f_screenpos(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
semsg(_(e_invalid_line_number_nr), pos.lnum);
return;
}
+ if (pos.col < 0) {
+ pos.col = 0;
+ }
int row = 0;
int scol = 0, ccol = 0, ecol = 0;
textpos2screenpos(wp, &pos, &row, &scol, &ccol, &ecol, false);