diff src/ex_cmds.c @ 2837:8470ac4679c1 v7.3.192

updated for version 7.3.192 Problem: Ex command ":s/ \?/ /g" splits multi-byte characters into bytes. (Dominique Pelle) Solution: Advance over whole character instead of one byte.
author Bram Moolenaar <bram@vim.org>
date Thu, 19 May 2011 14:30:16 +0200
parents 8bd38abda314
children d84a564f28c9
line wrap: on
line diff
--- 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;
 		}