summaryrefslogtreecommitdiff
path: root/src/regexp.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-03-23 22:59:57 +0000
committerBram Moolenaar <Bram@vim.org>2006-03-23 22:59:57 +0000
commitdb552d60ec4613d5537d3ebdcc4130f1591c0589 (patch)
tree621685ee2f7bf5e527dfb408d4dda38d8b56cc7d /src/regexp.c
parent7b5f8325ee8ecb93de52128303db5ecc4ffd430e (diff)
downloadvim-git-db552d60ec4613d5537d3ebdcc4130f1591c0589.tar.gz
updated for version 7.0232v7.0232
Diffstat (limited to 'src/regexp.c')
-rw-r--r--src/regexp.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/regexp.c b/src/regexp.c
index dd07ea734..e0bfb0305 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -6854,6 +6854,23 @@ vim_regsub_both(source, dest, copy, magic, backslash)
}
if (no < 0) /* Ordinary character. */
{
+ if (c == K_SPECIAL && src[0] != NUL && src[1] != NUL)
+ {
+ /* Copy a specialy key as-is. */
+ if (copy)
+ {
+ *dst++ = c;
+ *dst++ = *src++;
+ *dst++ = *src++;
+ }
+ else
+ {
+ dst += 3;
+ src += 2;
+ }
+ continue;
+ }
+
if (c == '\\' && *src != NUL)
{
/* Check for abbreviations -- webb */
@@ -6877,13 +6894,12 @@ vim_regsub_both(source, dest, copy, magic, backslash)
c = *src++;
}
}
-
- /* Write to buffer, if copy is set. */
#ifdef FEAT_MBYTE
- if (has_mbyte)
+ else if (has_mbyte)
c = mb_ptr2char(src - 1);
#endif
+ /* Write to buffer, if copy is set. */
if (func == (fptr_T)NULL) /* just copy */
cc = c;
else