Tim Peters writes:

I'm still unsure, but couldn't stand the virtual event trickery so tried a
different sin (adding undo_block_start/stop methods to the Text instance in
EditorWindow.py).  Like it or not, it's efficient and works <wink>.  Better
idea?

Give the attached a whirl.  Even if you hate the implementation, I think
you'll like the results.  Think I caught all the "block edit" cmds,
including Format Paragraph, plus subtler ones involving smart indents and
backspacing.
This commit is contained in:
Guido van Rossum 1999-05-03 15:49:52 +00:00
parent 2d6a568a0f
commit 318a70d976
4 changed files with 123 additions and 38 deletions

View file

@ -147,6 +147,8 @@ class EditorWindow:
self.undo = undo = self.UndoDelegator(); per.insertfilter(undo)
self.io = io = self.IOBinding(self)
text.undo_block_start = undo.undo_block_start
text.undo_block_stop = undo.undo_block_stop
undo.set_saved_change_hook(self.saved_change_hook)
io.set_filename_change_hook(self.filename_change_hook)