makeCursorVisible-fix
authorClaus Gittinger <cg@exept.de>
Tue, 13 May 2003 18:00:59 +0200
changeset 2759 c7cdd64a930f
parent 2758 a91d29f612b5
child 2760 0bcd8637e70e
makeCursorVisible-fix
EditField.st
--- a/EditField.st	Mon May 12 16:45:50 2003 +0200
+++ b/EditField.st	Tue May 13 18:00:59 2003 +0200
@@ -2060,10 +2060,11 @@
     "dont scroll for the cursor, if its beyond the text and a lengthLimit
      is present."
 
-    |wText innerWidth|
+    |wText innerWidth colToMakeVisible|
 
 
     innerWidth := self innerWidth.
+    colToMakeVisible := col.
 
     lengthLimit notNil ifTrue:[
         (self xOfCol:col inVisibleLine:1) <= innerWidth
@@ -2074,14 +2075,13 @@
         ifTrue:[
             ^ self
         ].
-        (col == cursorCol 
-        and:[col > lengthLimit]) ifTrue:[
-            super makeColVisible:lengthLimit inLine:lineNr
-        ] ifFalse:[
-            super makeColVisible:col inLine:lineNr
+        (col == cursorCol and:[col > lengthLimit]) ifTrue:[
+            colToMakeVisible := lengthLimit
         ].
     ].
 
+    super makeColVisible:colToMakeVisible inLine:lineNr.
+
     "/ new:
     "/ care to make the most possible visible
     viewOrigin x > 0 ifTrue:[
@@ -2092,6 +2092,12 @@
     ]
 
     "Modified: 6.9.1995 / 13:57:53 / claus"
+!
+
+makeCursorVisible
+
+self contents size > 10 ifTrue:[self halt.].
+    super makeCursorVisible
 ! !
 
 !EditField methodsFor:'selections'!
@@ -2129,5 +2135,5 @@
 !EditField class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.167 2003-05-07 14:56:32 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.168 2003-05-13 16:00:59 cg Exp $'
 ! !