aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/regexp.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index 9d16ecb46c..98d737c9a9 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -4921,16 +4921,13 @@ regmatch (
(colnr_T)STRLEN(regline);
}
} else {
- if (has_mbyte) {
- const char_u *const line =
- reg_getline(behind_pos.rs_u.pos.lnum);
+ const char_u *const line =
+ reg_getline(behind_pos.rs_u.pos.lnum);
- rp->rs_un.regsave.rs_u.pos.col -=
- (*mb_head_off)(line, line
- + rp->rs_un.regsave.rs_u.pos.col - 1) + 1;
- } else {
- rp->rs_un.regsave.rs_u.pos.col--;
- }
+ rp->rs_un.regsave.rs_u.pos.col -=
+ utf_head_off(line,
+ line + rp->rs_un.regsave.rs_u.pos.col - 1)
+ + 1;
}
} else {
if (rp->rs_un.regsave.rs_u.ptr == regline) {