Tim Peters: made replacement atomic for undo/redo.

This commit is contained in:
Guido van Rossum 1999-06-08 12:54:56 +00:00
parent 0fcd635d41
commit 9745f5a74f
1 changed files with 2 additions and 0 deletions

View File

@ -142,10 +142,12 @@ class ReplaceDialog(SearchDialogBase):
return 0
new = re.pcre_expand(m, self.replvar.get())
text.mark_set("insert", first)
text.undo_block_start()
if m.group():
text.delete(first, last)
if new:
text.insert(first, new)
text.undo_block_stop()
self.show_hit(first, text.index("insert"))
self.ok = 0
return 1