From 97c495ce68eece2aab9e90f92a075dcd4b310b82 Mon Sep 17 00:00:00 2001 From: hobbs Date: Thu, 26 Aug 2004 18:03:28 +0000 Subject: * library/text.tcl (::tk::TextTranspose): Ensure that Transpose is an atomic op to undo. --- ChangeLog | 5 +++++ library/text.tcl | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 95676d1..4d72ae2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-08-26 Jeff Hobbs + + * library/text.tcl (::tk::TextTranspose): Ensure that Transpose is + an atomic op to undo. + 2004-08-25 Don Porter * macosx/tkMacOSXWm.c: Made use of Tcl_WrongNumArgs in a few diff --git a/library/text.tcl b/library/text.tcl index 7b181b1..fde0a16 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -3,7 +3,7 @@ # This file defines the default bindings for Tk text widgets and provides # procedures that help in implementing the bindings. # -# RCS: @(#) $Id: text.tcl,v 1.31 2004/06/04 10:51:18 vincentdarley Exp $ +# RCS: @(#) $Id: text.tcl,v 1.32 2004/08/26 18:03:30 hobbs Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -972,9 +972,19 @@ proc ::tk::TextTranspose w { if {[$w compare "$pos - 1 char" == 1.0]} { return } + # ensure this is seen as an atomic op to undo + set autosep [$w cget -autoseparators] + if {$autosep} { + $w configure -autoseparators 0 + $w edit separator + } $w delete "$pos - 2 char" $pos $w insert insert $new $w see insert + if {$autosep} { + $w edit separator + $w configure -autoseparators $autosep + } } # ::tk_textCopy -- -- cgit v0.12