summaryrefslogtreecommitdiffstats
path: root/library/text.tcl
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-10-04 09:04:42 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-10-04 09:04:42 (GMT)
commit605af9dd39143e83428df6fd8c1f06955da799fa (patch)
tree3f6de39fa985cc913d002206c7040312f1147baa /library/text.tcl
parent520dc94723941cbb70de8f216cb8dce3868bfa59 (diff)
downloadtk-605af9dd39143e83428df6fd8c1f06955da799fa.zip
tk-605af9dd39143e83428df6fd8c1f06955da799fa.tar.gz
tk-605af9dd39143e83428df6fd8c1f06955da799fa.tar.bz2
Fixed bug [1669632fff] case (v) - <<Clear>> is atomic
Diffstat (limited to 'library/text.tcl')
-rw-r--r--library/text.tcl8
1 files changed, 8 insertions, 0 deletions
diff --git a/library/text.tcl b/library/text.tcl
index f973984..d7c0935 100644
--- a/library/text.tcl
+++ b/library/text.tcl
@@ -262,7 +262,15 @@ bind Text <<Paste>> {
tk_textPaste %W
}
bind Text <<Clear>> {
+ # Make <<Clear>> an atomic operation on the Undo stack,
+ # i.e. separate it from other delete operations on either side
+ if {[%W cget -autoseparators]} {
+ %W edit separator
+ }
catch {%W delete sel.first sel.last}
+ if {[%W cget -autoseparators]} {
+ %W edit separator
+ }
}
bind Text <<PasteSelection>> {
if {$tk_strictMotif || ![info exists tk::Priv(mouseMoved)]