aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r--src/nvim/ops.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 83e2a85112..6e6f478166 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -3696,8 +3696,11 @@ error:
len = STRLEN(y_array[y_size - 1]);
col = (colnr_T)len - lendiff;
if (col > 1) {
- curbuf->b_op_end.col = col - 1 - utf_head_off(y_array[y_size - 1],
- y_array[y_size - 1] + len - 1);
+ curbuf->b_op_end.col = col - 1;
+ if (len > 0) {
+ curbuf->b_op_end.col -= utf_head_off(y_array[y_size - 1],
+ y_array[y_size - 1] + len - 1);
+ }
} else {
curbuf->b_op_end.col = 0;
}