small bugfix

--HG--
branch : pmacs2
This commit is contained in:
moculus 2007-08-11 14:16:41 +00:00
parent 91f06f6e0a
commit d056a9b61b
2 changed files with 2 additions and 3 deletions

View File

@ -35,7 +35,7 @@ class ReplaceOne(method.Method):
class SkipReplace(method.Method): class SkipReplace(method.Method):
def execute(self, w, **vargs): def execute(self, w, **vargs):
m = w.buffer.method m = w.buffer.method
_find_next(m, False) _find_next(m, True)
_finish(m, w) _finish(m, w)
class ReplaceAll(method.Method): class ReplaceAll(method.Method):
@ -62,7 +62,6 @@ def _find_next(m, move=False):
(m.p1, m.p2) = (None, None) (m.p1, m.p2) = (None, None)
return False 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)) newc = searchutil.find_next(r, w, move, start=c.add(0, 0))
if newc: if newc:
(m.p1, m.p2) = newc (m.p1, m.p2) = newc

View File

@ -10,7 +10,7 @@ class IllegalPatternError(Exception):
pass pass
def escape_literal(s): 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): def find_ranges(r, w, start=None, end=None):
if not w.buffer.lines: if not w.buffer.lines: