LIST OF BUGS/FEATURES FIXED BY THE PATCH
A patch to lib/tk8.5/text.tcl is supplied, and each fix in the patch file is commented. The bugs/features are labeled here by the binding, followed by a short description of how to demonstrate the bug/feature.
(i), (iv) and (vii) are bugfixes to autoseparator placement
(ii), (iii) fix apparent bugs where the real problem is a shaky hand; since they don't break any intended behavior they could be considered improvements
(v), (vi) make <<Clear>> and <<Cut>> atomic operations on the Undo stack.
(i) <Control-1>
Insert text at position 'A'; use <Control-1> to click at 'B'; insert text at 'B'; <<Undo>>
The insertions at both 'A' and 'B' are removed together.
The patch inserts an autoseparator.
General rule (obeyed elsewhere in text.tcl): an operation that moves the insert mark without making it one end of the selection must insert an autoseparator.
(ii) <Double-Control-1>
The patch prevents <Control-1> from becoming <Double-Button-1> if the user accidentally double clicks.
(iii) <Control-B1-Motion>
The patch prevents <Control-1> from becoming <B1-Motion> if the user accidentally makes a slight movement of the mouse.
(iv) <Control-backslash>
Insert text at position 'A'; use <Shift-Right> to create a selection to position 'B'; use <Control-backslash> to clear the selection, leaving the insert mark at 'B'; insert text at 'B'; <<Undo>>
The insertions at both 'A' and 'B' are removed together.
The patch inserts an autoseparator.
General rule (obeyed elsewhere in text.tcl): an operation that clears the selection must insert an autoseparator, because the selection operation may have moved the insert mark.
(v) <<Clear>>
<Delete> a character at position 'A'; use <Shift-Right> to create a selection to position 'B'; use <<Clear>> to delete the selection; <Delete> another character; <<Undo>>
All three deletions are undone.
It might be preferable to make <<Clear>> atomic. The patch does this.
(For testing on non-Mac systems, use
event add <<Clear>> <Key-F6>
to map this binding to the F6 key)
(vi) <<Cut>> (proc ::tk_textCut)
Similar to <<Clear>> above: the patch makes <<Cut>> atomic.
(vii) <<Undo>>
(a) create a widget with -undo 1, and enter some text
(b) click somewhere in the text. Delete a character; type a few characters, without deleting anything or navigating away (i.e. only insert text).
(c) click somewhere else in the text. Insert another character there.
At this point the top operation in the Undo stack is the single inserted character, the operation before that is the group of inserted characters.
(d) <<Undo>> - correctly undoes the last operation, but also removes the separator from the top of the Undo stack
(e) type a character
(f) <<Undo>> - undoes the character (e) _and_ the previous item on the Undo stack.
Patch to lib/tk8.5/text.tcl