mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
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:
parent
2d6a568a0f
commit
318a70d976
4 changed files with 123 additions and 38 deletions
|
|
@ -37,8 +37,10 @@ class FormatParagraph:
|
|||
text.tag_remove("sel", "1.0", "end")
|
||||
if newdata != data:
|
||||
text.mark_set("insert", first)
|
||||
text.undo_block_start()
|
||||
text.delete(first, last)
|
||||
text.insert(first, newdata)
|
||||
text.undo_block_stop()
|
||||
else:
|
||||
text.mark_set("insert", last)
|
||||
text.see("insert")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue