#FEATURE by cg
class: EditField
added: #cursorLeft
changed: #makeColVisible:inLine:
--- a/EditField.st Sun Oct 22 01:30:06 2017 +0200
+++ b/EditField.st Mon Oct 23 19:04:44 2017 +0200
@@ -1487,6 +1487,12 @@
]
!
+cursorLeft
+ super cursorLeft
+
+ "Created: / 23-10-2017 / 18:28:38 / cg"
+!
+
cursorLine:line col:col
"catch cursor movement"
@@ -2387,16 +2393,19 @@
colToMakeVisible := col.
lengthLimit notNil ifTrue:[
- (self xOfCol:col inVisibleLine:1) <= innerWidth
- ifTrue:[
- ^ self
- ].
- (self xOfCol:lengthLimit inVisibleLine:1) <= innerWidth
- ifTrue:[
- ^ self
- ].
- (col == cursorCol and:[col > lengthLimit]) ifTrue:[
- colToMakeVisible := lengthLimit
+ (self xOfCol:col-1 inVisibleLine:1) < self viewOrigin x ifTrue:[
+ ] ifFalse:[
+ (self xOfCol:lengthLimit inVisibleLine:1) <= innerWidth
+ ifTrue:[
+ ^ self
+ ].
+ (self xOfCol:col inVisibleLine:1) <= innerWidth
+ ifTrue:[
+ ^ self
+ ].
+ (col == cursorCol and:[col > lengthLimit]) ifTrue:[
+ colToMakeVisible := lengthLimit
+ ].
].
].
@@ -2412,7 +2421,7 @@
]
"Modified: / 06-09-1995 / 13:57:53 / claus"
- "Modified: / 27-09-2017 / 15:47:16 / cg"
+ "Modified: / 23-10-2017 / 18:32:34 / cg"
! !
!EditField methodsFor:'selections'!