]> granicus.if.org Git - python/commitdiff
Tim Peters: made replacement atomic for undo/redo.
authorGuido van Rossum <guido@python.org>
Tue, 8 Jun 1999 12:54:56 +0000 (12:54 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 8 Jun 1999 12:54:56 +0000 (12:54 +0000)
Tools/idle/ReplaceDialog.py

index 3bff8b5e6714bacfba2b1eff442f6871688b5438..813de48bfa1941f2c9d0bfaf5c82731e99d8b040 100644 (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