parent
9c490a686d
commit
88726de97e
|
@ -50,6 +50,6 @@ class RegexReplace(Method):
|
||||||
def _execute(self, w, **vargs):
|
def _execute(self, w, **vargs):
|
||||||
w.application.last_replace_before = self.before = vargs['before']
|
w.application.last_replace_before = self.before = vargs['before']
|
||||||
w.application.last_replace_after = self.after = vargs['after']
|
w.application.last_replace_after = self.after = vargs['after']
|
||||||
self.old_window = w
|
self.old_window = w
|
||||||
f = lambda x: None
|
f = lambda x: None
|
||||||
w.application.open_mini_buffer('I-RegexReplace: ', f, self, None, 'replace')
|
w.application.open_mini_buffer('I-RegexReplace: ', f, self, None, 'replace')
|
||||||
|
|
|
@ -34,7 +34,7 @@ def find_ranges(r, w, start=None, end=None):
|
||||||
for m in r.finditer(w.buffer.lines[y], x, limit):
|
for m in r.finditer(w.buffer.lines[y], x, limit):
|
||||||
if len(m.group(0)) == 0:
|
if len(m.group(0)) == 0:
|
||||||
raise IllegalPatternError, "zero-width match found"
|
raise IllegalPatternError, "zero-width match found"
|
||||||
ranges.append([Point(m.start(), y), Point(m.end(), y), bg_color, unselected_color])
|
ranges.append([Point(m.start(), y), Point(m.end(), y), bg_color, unselected_color, m])
|
||||||
x = 0
|
x = 0
|
||||||
y += 1
|
y += 1
|
||||||
return ranges
|
return ranges
|
||||||
|
@ -76,7 +76,7 @@ def find(r, w, move=False, direction='next', start=None, end=None):
|
||||||
app.clear_highlighted_ranges()
|
app.clear_highlighted_ranges()
|
||||||
if newc:
|
if newc:
|
||||||
w.goto(newc[0])
|
w.goto(newc[0])
|
||||||
for (p1, p2, fg, bg) in ranges:
|
for (p1, p2, fg, bg, m) in ranges:
|
||||||
if p1 < w.first:
|
if p1 < w.first:
|
||||||
continue
|
continue
|
||||||
elif p2 > w.last:
|
elif p2 > w.last:
|
||||||
|
|
Loading…
Reference in New Issue