aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/charset.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-03-24 09:36:09 -0400
committerJames McCoy <jamessan@jamessan.com>2017-03-24 15:11:51 -0400
commit2a6d44ca5232d5fbfa0401451b3ebce60e93ed4d (patch)
treef404371640c379af050b53c5e59a037fc9d6cfca /src/nvim/charset.c
parent38274051c066ff0a28582aae5c2edf47825d9f57 (diff)
downloadrneovim-2a6d44ca5232d5fbfa0401451b3ebce60e93ed4d.tar.gz
rneovim-2a6d44ca5232d5fbfa0401451b3ebce60e93ed4d.tar.bz2
rneovim-2a6d44ca5232d5fbfa0401451b3ebce60e93ed4d.zip
vim-patch:8.0.0250
Problem: When virtcol() gets a column that is not the first byte of a multi-byte character the result is unpredictable. (Christian Ludwig) Solution: Correct the column to the first byte of a multi-byte character. Change the utf-8 test to new style. https://github.com/vim/vim/commit/0c0590d9827cb07a33c1552cb3558b94bddcb4dc Closes #6269
Diffstat (limited to 'src/nvim/charset.c')
-rw-r--r--src/nvim/charset.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c
index f31cef5886..efe32b915f 100644
--- a/src/nvim/charset.c
+++ b/src/nvim/charset.c
@@ -1166,6 +1166,7 @@ void getvcol(win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor,
pos->col = 0;
}
posptr = ptr + pos->col;
+ posptr -= utf_head_off(line, posptr);
}
// This function is used very often, do some speed optimizations.