summaryrefslogtreecommitdiff
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 9d2bdc798..64c1371bd 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -4625,7 +4625,15 @@ do_sub(eap)
* for a match in this line again. */
skip_match = TRUE;
else
- ++matchcol; /* search for a match at next column */
+ {
+ /* search for a match at next column */
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ matchcol += mb_ptr2len(sub_firstline + matchcol);
+ else
+#endif
+ ++matchcol;
+ }
goto skip;
}