EditTextView.st
changeset 6614 228cd1c3eac9
parent 6613 745a9c495c42
child 6620 d1af1ea90691
--- a/EditTextView.st	Wed Jun 26 23:07:20 2019 +0200
+++ b/EditTextView.st	Wed Jun 26 23:22:21 2019 +0200
@@ -1019,13 +1019,22 @@
 !
 
 autoIndent
-    ^ autoIndent
+    ^ autoIndent value
+
+    "Modified: / 26-06-2019 / 23:16:17 / Claus Gittinger"
 !
 
 autoIndent:aBoolean
-    autoIndent := aBoolean
-
-    "Created: 5.3.1996 / 14:37:50 / cg"
+    autoIndent value: aBoolean
+
+    "Created: / 05-03-1996 / 14:37:50 / cg"
+    "Modified: / 26-06-2019 / 23:19:24 / Claus Gittinger"
+!
+
+autoIndentHolder
+    ^ autoIndent
+
+    "Created: / 26-06-2019 / 23:16:24 / Claus Gittinger"
 !
 
 codeAspectHolder
@@ -3429,7 +3438,7 @@
     list isEmptyOrNil ifTrue:[^ self]. "/ there is nothing to delete.
     
     wasOn := self hideCursor.
-    (autoIndent and:[ (tabPositions includes:cursorCol)]) ifTrue:[
+    (self autoIndent and:[ (tabPositions includes:cursorCol)]) ifTrue:[
         prevTab := (self prevTabBefore:cursorCol) max:1.
         ln := originalLine := (list at:cursorLine ifAbsent:'') ? ''.
         ln size < prevTab ifTrue:[
@@ -3460,7 +3469,7 @@
         ].
     ].
 
-"/        (autoIndent
+"/        (self autoIndent 
 "/    and:[cursorCol  ~~ 1
 "/    and:[cursorLine <= (list size)]])
 "/     ifTrue:[
@@ -3503,7 +3512,7 @@
     wasOn ifTrue:[ self showCursor ]
 
     "Modified: / 16-01-1998 / 22:33:04 / cg"
-    "Modified: / 24-03-2019 / 09:57:57 / Claus Gittinger"
+    "Modified: / 26-06-2019 / 23:19:59 / Claus Gittinger"
 !
 
 deleteCharsAtLine:lineNr fromCol:colNr
@@ -4545,9 +4554,11 @@
 withAutoIndent:aBoolean do:aBlock
     |sav|
 
-    sav := autoIndent.
-    autoIndent := aBoolean.
-    aBlock ensure:[ autoIndent := sav ].
+    sav := self autoIndent.
+    self autoIndent:aBoolean.
+    aBlock ensure:[ self autoIndent:sav ].
+
+    "Modified: / 26-06-2019 / 23:18:17 / Claus Gittinger"
 !
 
 withoutRedrawAt:lineNr put:aString
@@ -4916,7 +4927,7 @@
 
     leftPart isNil ifTrue:[
         leftPart := ''.
-        autoIndent ifTrue:[
+        self autoIndent ifTrue:[
             "/ cg: only do this, if the second line has no indent
             (i := self leftIndentOfLine:(lineNr+1)) == 0 ifTrue:[
                 leftPart := String new:(self leftIndentForLine:lineNr)
@@ -4944,6 +4955,7 @@
 
     "Created: / 09-09-1997 / 09:27:38 / cg"
     "Modified: / 25-04-2017 / 12:41:20 / cg"
+    "Modified: / 26-06-2019 / 23:19:41 / Claus Gittinger"
 !
 
 basicReplace:aCharacter atLine:lineNr col:colNr
@@ -5640,7 +5652,7 @@
     ].
 
     (key == #ToggleAutoIndent) ifTrue:[
-        self autoIndent:(autoIndent not).
+        self autoIndent:(self autoIndent not).
         ^ self.
     ].
 
@@ -5942,7 +5954,7 @@
     "Modified: / 06-02-1998 / 11:59:59 / stefan"
     "Modified: / 26-09-2013 / 17:52:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 28-04-2017 / 09:25:22 / cg"
-    "Modified: / 26-06-2019 / 21:58:48 / Claus Gittinger"
+    "Modified: / 26-06-2019 / 23:17:08 / Claus Gittinger"
 !
 
 executeKeyboardMacro:cmdMacro
@@ -6049,7 +6061,7 @@
     ].
     self isInInsertMode ifFalse:[
         self cursorReturn:true.
-        autoIndent == true ifTrue:[
+        self autoIndent ifTrue:[
             i := self leftIndentForLine:(cursorLine + 1).
             (self listAt:cursorLine) isEmptyOrNil ifTrue:[
                 self cursorCol:(i+1 max:1)
@@ -6086,7 +6098,7 @@
             ].
     ]. 
     
-    autoIndent == true ifTrue:[
+    self autoIndent ifTrue:[
         (rightPart isEmpty and:[cursorCol ~~ 1]) ifTrue:[
             "/ nothing to do.
         ] ifFalse:[
@@ -6134,7 +6146,7 @@
     ].
 
     "Created: / 26-06-2019 / 21:57:50 / Claus Gittinger"
-    "Modified: / 26-06-2019 / 23:01:52 / Claus Gittinger"
+    "Modified: / 26-06-2019 / 23:17:45 / Claus Gittinger"
 !
 
 keyPress:key x:x y:y
@@ -6630,8 +6642,8 @@
     showMatchingParenthesis := false.
     hasKeyboardFocus := false.
     tabMeansNextField := false.
-    "/ autoIndent := UserPreferences current autoIndentInCodeView.
-    autoIndent := false.
+    "/ autoIndent := UserPreferences current autoIndentInCodeView asValue.
+    autoIndent := false asValue.
     editMode := ValueHolder with:EditMode insertMode.
     learnMode := ValueHolder with:false.
     cursorMovementWhenUpdating := #beginOfText.
@@ -6644,6 +6656,7 @@
     codeAspectHolder := ValueHolder with:nil.
 
     "Modified: / 27-09-2013 / 09:41:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (comment): / 26-06-2019 / 23:21:46 / Claus Gittinger"
 !
 
 initializeCompletionSupport
@@ -7017,7 +7030,7 @@
 
     subSubMenu := PopUpMenu itemList:miscItems resources:resources performer:model.
     subSubMenu receiver:self.
-    subSubMenu checkToggleAt:#autoIndent: put:autoIndent.
+    subSubMenu checkToggleAt:#autoIndent: put:(self autoIndent).
     subSubMenu checkToggleAt:#insertMode: put:(self isInInsertMode).
     subSubMenu checkToggleAt:#learnMode: put:(self learnModeHolder value).
 
@@ -7136,7 +7149,7 @@
     ^ m.
 
     "Modified: / 30-11-2017 / 15:06:03 / cg"
-    "Modified: / 06-06-2019 / 11:22:31 / Claus Gittinger"
+    "Modified: / 26-06-2019 / 23:17:26 / Claus Gittinger"
 !
 
 getTextSelectionFromHistory