#FEATURE
authorClaus Gittinger <cg@exept.de>
Fri, 15 Jan 2016 16:37:55 +0100
changeset 5530 6e888d60be5a
parent 5529 0b33c7ac879d
child 5531 d5ed61031306
#FEATURE class: CodeView added: #cursorReturn: changed: #cursorReturn caller of cursorReturn can control the autoindent behavior.
CodeView.st
--- 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$'
 ! !