[gedit] Fixed escaping literals for shell placeholder



commit 536cb579f3df8ea2f4c16b325f10c1a289d6c3a4
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 7b1656e..d91405d 100644
--- a/plugins/snippets/snippets/Placeholder.py
+++ b/plugins/snippets/snippets/Placeholder.py
@@ -442,8 +442,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]