allow newlines as \n in replace

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2010-12-09 13:14:58 -05:00
parent ebbbd8d819
commit 842a50017f
2 changed files with 3 additions and 1 deletions

View File

@ -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):

View File

@ -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: