#FEATURE
class: CodeView
added: #cursorReturn:
changed: #cursorReturn
caller of cursorReturn can control the autoindent
behavior.
--- a/CodeView.st Fri Jan 15 16:37:25 2016 +0100
+++ b/CodeView.st Fri Jan 15 16:37:55 2016 +0100
@@ -11,6 +11,8 @@
"
"{ Package: 'stx:libwidg' }"
+"{ NameSpace: Smalltalk }"
+
Workspace subclass:#CodeView
instanceVariableNames:'explainAction formatAction pointerOverWordAction'
classVariableNames:''
@@ -78,7 +80,7 @@
!CodeView class methodsFor:'others'!
version_CVS
- ^ '$Header: /cvs/stx/stx/libwidg/CodeView.st,v 1.66 2014-01-23 16:11:20 stefan Exp $'
+ ^ '$Header$'
! !
!CodeView methodsFor:'accessing'!
@@ -111,6 +113,13 @@
!CodeView methodsFor:'cursor handling'!
cursorReturn
+ self cursorReturn:false
+!
+
+cursorReturn:withPossibleAutoindent
+ "added an argument to disable autoindent, because this method is called from other
+ places as well..."
+
|wasOn line newCol |
"/ make Jan's enhancement dependent on
@@ -122,9 +131,10 @@
"/
"/ and saved/restored with the userPreferences.
- (autoIndent "self st80EditMode" not
+ (withPossibleAutoindent not
+ or:[ autoIndent not
or:[ cursorLine == 1
- or:[ self sensor shiftDown]]) ifTrue:[
+ or:[ self sensor shiftDown]]]) ifTrue:[
super cursorReturn.
^ self.
].
@@ -334,6 +344,6 @@
!CodeView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/CodeView.st,v 1.66 2014-01-23 16:11:20 stefan Exp $'
+ ^ '$Header$'
! !