summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2004-12-06 19:42:02 (GMT)
committerhobbs <hobbs>2004-12-06 19:42:02 (GMT)
commitf842b0ddfdbd3c96c8bc82fdac2b74c59ce68574 (patch)
tree007ced7651c0b4742ab6ed28ca15d998f054a69b
parent81131c6d41f74f8b626d62264c4478d7cb440c64 (diff)
downloadtk-f842b0ddfdbd3c96c8bc82fdac2b74c59ce68574.zip
tk-f842b0ddfdbd3c96c8bc82fdac2b74c59ce68574.tar.gz
tk-f842b0ddfdbd3c96c8bc82fdac2b74c59ce68574.tar.bz2
* library/text.tcl (::tk::TextUpDownLine): revert 2004-11-23 as itcore_8_4_9
prevented scrolling to bottom.
-rw-r--r--ChangeLog9
-rw-r--r--changes5
-rw-r--r--library/text.tcl43
3 files changed, 16 insertions, 41 deletions
diff --git a/ChangeLog b/ChangeLog
index 0a68b56..6e8ec10 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,12 @@
-2004-12-03 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+2004-12-06 Jeff Hobbs <jeffh@ActiveState.com>
*** 8.4.9 TAGGED FOR RELEASE ***
+ * library/text.tcl (::tk::TextUpDownLine): revert 2004-11-23 as it
+ prevented scrolling to bottom.
+
+2004-12-03 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
* generic/tkImgPhoto.c (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock):
Make overlay compositing where the target is empty no longer set
the target to magical gray, and also make sure that the
@@ -29,7 +34,7 @@
2004-11-23 Vince Darley <vincentdarley@users.sourceforge.net>
* library/text.tcl: make up/down cursor keys move by display
- lines, not logical lines [Bug 1011234]
+ lines, not logical lines [Bug 1011234] (REVERTED 2004-12-06)
2004-11-19 Reinhard Max <max@suse.de>
diff --git a/changes b/changes
index 7e1defd..6e354dc 100644
--- a/changes
+++ b/changes
@@ -2,7 +2,7 @@ This file summarizes all changes made to Tk since version 1.0 was
released on March 13, 1991. Changes that aren't backward compatible
are marked specially.
-RCS: @(#) $Id: changes,v 1.64.2.17 2004/12/03 23:01:30 hobbs Exp $
+RCS: @(#) $Id: changes,v 1.64.2.18 2004/12/06 19:42:10 hobbs Exp $
3/16/91 (bug fix) Modified tkWindow.c to remove Tk's Tcl commands from
the interpreter when the main window is deleted (otherwise there will
@@ -5734,9 +5734,6 @@ the CG version of the X drawing emulation layer. (tittle, ingham)
--- Released 8.4.8, November 18, 2004 --- See ChangeLog for details ---
-2004-11-23 (bug fix)[1011234] Make up/down cursor keys move by display
-lines, not logical lines in text widget (darley)
-
2004-12-01 (bug fix)[979239] Fix clipping of partially transparent images
on buttons on unix to avoid X error (hobbs, petasis)
diff --git a/library/text.tcl b/library/text.tcl
index 6a311e7..cf40c38 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.24.2.4 2004/11/23 17:50:02 vincentdarley Exp $
+# RCS: @(#) $Id: text.tcl,v 1.24.2.5 2004/12/06 19:42:11 hobbs Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -842,19 +842,12 @@ proc ::tk::TextInsert {w s} {
}
# ::tk::TextUpDownLine --
-# Returns the index of the character one display line above or below the
+# Returns the index of the character one line above or below the
# insertion cursor. There are two tricky things here. First,
# we want to maintain the original column across repeated operations,
# even though some lines that will get passed through don't have
# enough characters to cover the original column. Second, don't
# try to scroll past the beginning or end of the text.
-#
-# This procedue has side effects, in that it will adjust the widget's
-# current display to show the insert position. This is required to
-# allow correct moving by display lines (when wrapped). All callers
-# of this proc always adjust the display anyway, so the side-effects
-# here are not actually observed by the user of the text widget
-# bindings.
#
# Arguments:
# w - The text window in which the cursor is to move.
@@ -863,36 +856,16 @@ proc ::tk::TextInsert {w s} {
proc ::tk::TextUpDownLine {w n} {
variable ::tk::Priv
-
- $w see insert
- scan [$w bbox insert] {%d %d %*d %d} xpos ypos height
- set weight [$w cget -height]
-
+
set i [$w index insert]
+ scan $i "%d.%d" line char
if {$Priv(prevPos) ne $i} {
- set Priv(pos) $xpos
- }
-
- if {(($n < 0) && ($ypos <= $height)) \
- || (($n > 0) && (($ypos+$height) >= ($weight*$height)))} {
- $w yview scroll $n units
- scan [$w bbox insert] {%*d %d %*d %d} ypos height
- set weight [$w cget -height]
- }
-
- if {(($n < 0) && ($ypos > $height)) \
- || (($n > 0) && (($ypos+$height) < ($weight*$height))) } {
- set new [$w index "@$Priv(pos),[expr {$ypos + $n * $height}]"]
- scan [$w bbox $new] {%d %d %d %*d} newx newy newwidth
- if {$newy eq $ypos} {
- set new $i
- } elseif {$Priv(pos) > [expr {$newx+$newwidth/2}]} {
- set new [$w index "@[expr {$newx + $newwidth + 1}],$newy"]
- }
- } else {
+ set Priv(char) $char
+ }
+ set new [$w index [expr {$line + $n}].$Priv(char)]
+ if {[$w compare $new == end] || [$w compare $new == "insert linestart"]} {
set new $i
}
-
set Priv(prevPos) $new
return $new
}