diff src/getchar.c @ 1081:0e57be57fa49 v7.0.207

updated for version 7.0-207
author vimboss
date Sun, 04 Mar 2007 20:22:01 +0000
parents 183c3187b20d
children 95723058b8ff
line wrap: on
line diff
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -4441,6 +4441,35 @@ vim_strsave_escape_csi(p)
 }
 
 /*
+ * Remove escaping from CSI and K_SPECIAL characters.  Reverse of
+ * vim_strsave_escape_csi().  Works in-place.
+ */
+    void
+vim_unescape_csi(p)
+    char_u *p;
+{
+    char_u	*s = p, *d = p;
+
+    while (*s != NUL)
+    {
+	if (s[0] == K_SPECIAL && s[1] == KS_SPECIAL && s[2] == KE_FILLER)
+	{
+	    *d++ = K_SPECIAL;
+	    s += 3;
+	}
+	else if ((s[0] == K_SPECIAL || s[0] == CSI)
+				   && s[1] == KS_EXTRA && s[2] == (int)KE_CSI)
+	{
+	    *d++ = CSI;
+	    s += 3;
+	}
+	else
+	    *d++ = *s++;
+    }
+    *d = NUL;
+}
+
+/*
  * Write map commands for the current mappings to an .exrc file.
  * Return FAIL on error, OK otherwise.
  */