From 842a50017fe1d3ade19bd0fb0a16ba5d95509fe7 Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Thu, 9 Dec 2010 13:14:58 -0500 Subject: [PATCH] allow newlines as \n in replace --HG-- branch : pmacs2 --- method/search.py | 3 ++- mode/replace.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/method/search.py b/method/search.py index 6388d5a..919bd4b 100644 --- a/method/search.py +++ b/method/search.py @@ -37,7 +37,8 @@ class Replace(Method): def _execute(self, w, **vargs): a = w.application a.last_replace_before = self.before = vargs['before'] - a.last_replace_after = self.after = vargs['after'] + a.last_replace_after = self.after = vargs['after'].replace('\\n', '\n').replace('\\\\', '\\') + # ??? self.old_window = w a.open_mini_buffer('I-Replace: ', lambda x: None, self, None, 'replace') class RegexReplace(Method): diff --git a/mode/replace.py b/mode/replace.py index 2ac9a8d..f8889de 100644 --- a/mode/replace.py +++ b/mode/replace.py @@ -30,6 +30,7 @@ class SkipReplace(Method): class ReplaceAll(Method): 'In a replace command, replace all remaining occurances' + # FIXME: this is super slow def execute(self, w, **vargs): m = w.buffer.method while m.p1 is not None: