From 5ead8f9a8a9c1df902da03a5abd29c1a36b8e2ee Mon Sep 17 00:00:00 2001 From: vincentdarley Date: Mon, 18 Apr 2005 11:34:40 +0000 Subject: fix to Home/End and display lines --- ChangeLog | 7 +++++++ doc/text.n | 12 ++++++------ library/text.tcl | 18 +++++++++--------- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index fcf93f8..5be9374 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-04-18 Vince Darley + + * library/text.tcl + * doc/text.n: corrected 'Home' and 'End' and Control-a/e handling + to work with display lines. This was an ommission of the previous + tip155 patch. Clarified the documentation on this point. + 2005-04-14 Jeff Hobbs * unix/tkUnixFont.c (FontMapLoadPage): reorder char[] decls to diff --git a/doc/text.n b/doc/text.n index c294f27..4b2c933 100644 --- a/doc/text.n +++ b/doc/text.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: text.n,v 1.35 2005/02/14 23:02:52 vincentdarley Exp $ +'\" RCS: @(#) $Id: text.n,v 1.36 2005/04/18 11:34:41 vincentdarley Exp $ '\" .so man.macros .TH text n 8.5 Tk "Tk Built-In Commands" @@ -2026,14 +2026,14 @@ Control-Next and Control-Prior scroll the view right or left by one page without moving the insertion cursor or affecting the selection. .IP [13] Home and Control-a move the insertion cursor to the -beginning of its line and clear any selection in the widget. -Shift-Home moves the insertion cursor to the beginning of the line +beginning of its display line and clear any selection in the widget. +Shift-Home moves the insertion cursor to the beginning of the display line and also extends the selection to that point. .IP [14] End and Control-e move the insertion cursor to the -end of the line and clear any selection in the widget. -Shift-End moves the cursor to the end of the line and extends the selection -to that point. +end of the display line and clear any selection in the widget. +Shift-End moves the cursor to the end of the display line and extends +the selection to that point. .IP [15] Control-Home and Meta-< move the insertion cursor to the beginning of the text and clear any selection in the widget. diff --git a/library/text.tcl b/library/text.tcl index f630149..40973e7 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.35 2004/10/18 13:40:56 vincentdarley Exp $ +# RCS: @(#) $Id: text.tcl,v 1.36 2005/04/18 11:34:41 vincentdarley Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -155,16 +155,16 @@ bind Text { } bind Text { - tk::TextSetCursor %W {insert linestart} + tk::TextSetCursor %W {insert display linestart} } bind Text { - tk::TextKeySelect %W {insert linestart} + tk::TextKeySelect %W {insert display linestart} } bind Text { - tk::TextSetCursor %W {insert lineend} + tk::TextSetCursor %W {insert display lineend} } bind Text { - tk::TextKeySelect %W {insert lineend} + tk::TextKeySelect %W {insert display lineend} } bind Text { tk::TextSetCursor %W 1.0 @@ -173,10 +173,10 @@ bind Text { tk::TextKeySelect %W 1.0 } bind Text { - tk::TextSetCursor %W {end - 1 char} + tk::TextSetCursor %W {end - 1 indices} } bind Text { - tk::TextKeySelect %W {end - 1 char} + tk::TextKeySelect %W {end - 1 indices} } bind Text { @@ -284,7 +284,7 @@ if {[string equal [tk windowingsystem] "aqua"]} { bind Text { if {!$tk_strictMotif} { - tk::TextSetCursor %W {insert linestart} + tk::TextSetCursor %W {insert display linestart} } } bind Text { @@ -299,7 +299,7 @@ bind Text { } bind Text { if {!$tk_strictMotif} { - tk::TextSetCursor %W {insert lineend} + tk::TextSetCursor %W {insert display lineend} } } bind Text { -- cgit v0.12