Tim Peters: made replacement atomic for undo/redo.
This commit is contained in:
parent
0fcd635d41
commit
9745f5a74f
|
@ -142,10 +142,12 @@ class ReplaceDialog(SearchDialogBase):
|
||||||
return 0
|
return 0
|
||||||
new = re.pcre_expand(m, self.replvar.get())
|
new = re.pcre_expand(m, self.replvar.get())
|
||||||
text.mark_set("insert", first)
|
text.mark_set("insert", first)
|
||||||
|
text.undo_block_start()
|
||||||
if m.group():
|
if m.group():
|
||||||
text.delete(first, last)
|
text.delete(first, last)
|
||||||
if new:
|
if new:
|
||||||
text.insert(first, new)
|
text.insert(first, new)
|
||||||
|
text.undo_block_stop()
|
||||||
self.show_hit(first, text.index("insert"))
|
self.show_hit(first, text.index("insert"))
|
||||||
self.ok = 0
|
self.ok = 0
|
||||||
return 1
|
return 1
|
||||||
|
|
Loading…
Reference in New Issue