From d056a9b61b44d94c246408ea74f9f632a6deb354 Mon Sep 17 00:00:00 2001 From: moculus Date: Sat, 11 Aug 2007 14:16:41 +0000 Subject: [PATCH] small bugfix --HG-- branch : pmacs2 --- mode/replace.py | 3 +-- searchutil.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mode/replace.py b/mode/replace.py index 0db301b..ad523b2 100644 --- a/mode/replace.py +++ b/mode/replace.py @@ -35,7 +35,7 @@ class ReplaceOne(method.Method): class SkipReplace(method.Method): def execute(self, w, **vargs): m = w.buffer.method - _find_next(m, False) + _find_next(m, True) _finish(m, w) class ReplaceAll(method.Method): @@ -62,7 +62,6 @@ def _find_next(m, move=False): (m.p1, m.p2) = (None, None) return False - #newc = searchutil.find_next(r, w, move, start=c.add(1, 0)) newc = searchutil.find_next(r, w, move, start=c.add(0, 0)) if newc: (m.p1, m.p2) = newc diff --git a/searchutil.py b/searchutil.py index 3679645..dc5cd72 100644 --- a/searchutil.py +++ b/searchutil.py @@ -10,7 +10,7 @@ class IllegalPatternError(Exception): pass def escape_literal(s): - return regex.meta_chars.sub(r'\\\1', s) + return re.escape(s) def find_ranges(r, w, start=None, end=None): if not w.buffer.lines: