[gedit/gnome-2-28] Fixed escaping literals for shell placeholder



commit a9ce9d62b1c5a293a460cb39bab86bd583d2d934
Author: Jesse van den Kieboom <jesse icecrew nl>
Date:   Sun Nov 15 18:35:39 2009 +0100

    Fixed escaping literals for shell placeholder

 plugins/snippets/snippets/Placeholder.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/plugins/snippets/snippets/Placeholder.py b/plugins/snippets/snippets/Placeholder.py
index a294982..14117a8 100644
--- a/plugins/snippets/snippets/Placeholder.py
+++ b/plugins/snippets/snippets/Placeholder.py
@@ -436,8 +436,11 @@ class PlaceholderShell(PlaceholderExpand):
                 self.process_close()
                 return False
         
+        def literal_replace(self, match):
+                return "\\%s" % (match.group(0))
+
         def literal(self, text):
-                return '"' + re.sub('[\\\\"]', '\\\\\\1', text) + '"'
+                return '"' + re.sub('([\\\\"])', self.literal_replace, text) + '"'
         
         def expand(self, text):
                 self.remove_timeout()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]