#UI_ENHANCEMENT by cg
authorClaus Gittinger <cg@exept.de>
Tue, 25 Apr 2017 12:59:00 +0200
changeset 17501 60c0aff2ee87
parent 17500 7f309137beb8
child 17502 d46156d40277
#UI_ENHANCEMENT by cg class: Tools::CodeView2::TextView comment/format in: #basicMergeLine:removeBlanks: changed: #leftIndentForLine:
Tools__CodeView2.st
--- a/Tools__CodeView2.st	Fri Apr 21 16:07:07 2017 +0200
+++ b/Tools__CodeView2.st	Tue Apr 25 12:59:00 2017 +0200
@@ -3812,11 +3812,13 @@
 !
 
 basicMergeLine:lineNr removeBlanks:removeBlanks
+    "merge line lineNr with line lineNr+1"
 
     super basicMergeLine:lineNr removeBlanks:removeBlanks.
     self notifyLinesDeletedFrom: lineNr + 1 to: lineNr + 1.
 
     "Created: / 28-06-2011 / 09:13:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (comment): / 25-04-2017 / 12:34:30 / cg"
 !
 
 basicSplitLine:lineNr before:colNr
@@ -3927,54 +3929,57 @@
 
 leftIndentForLine:lineNr
 
-    | lang |
-    lang := codeView language.
-    "Bit hacky here, should ask language some language toolbox
-    for formatting helper, that should do it..."
-    (lang notNil and:[lang isSmalltalk]) ifTrue:[
-        | line lineNo indent |
-        lineNo := lineNr.
-        [lineNo ~~ 1] whileTrue:[
-            lineNo  := lineNo - 1.
-            line := self listAt:lineNo.
-
-            line notNil ifTrue:[
-                indent := line indexOfNonSeparatorStartingAt:1.
-                "beggining od block"
-                line notEmptyOrNil ifTrue:[
-                    | lastCharIndex lastChar |
-
-                    lastCharIndex := line size.
-                    lastChar := nil.
-                    [ lastCharIndex > 0 ] whileTrue:[
-                        (lastChar := line at: lastCharIndex) isSeparator ifTrue:[ 
-                            lastCharIndex := lastCharIndex - 1.
-                        ] ifFalse:[ 
-                            lastCharIndex := -2. "/ To terminate the loop.
-                        ].
-                    ].
-                    lastCharIndex == -2 ifTrue:[
-                        lastChar == $[ ifTrue:[
-                            indent := indent + 4.
-                        ] ifFalse:[
-                            "end of block args"
-                            (lastChar == $| and: [line includes: $[]) ifTrue:[
-                                indent := indent + 4.
-                            ]
-                        ].
-                    ].
-                ].
-                indent ~~ 0 ifTrue:[
-                    ^ indent - 1
-                ]
-            ]
-        ].
-        ^0.
-    ].
+"/ cg: the code in EditTextView does it. No need to replicate that code here.
+"/
+"/    | lang |
+"/
+"/    lang := codeView language.
+"/    "Bit hacky here, should ask language some language toolbox
+"/    for formatting helper, that should do it..."
+"/    (lang notNil and:[lang isSmalltalk]) ifTrue:[
+"/        | line lineNo indent |
+"/        lineNo := lineNr.
+"/        [lineNo ~~ 1] whileTrue:[
+"/            lineNo  := lineNo - 1.
+"/            line := self listAt:lineNo.
+"/
+"/            line notEmptyOrNil ifTrue:[
+"/                | lastCharIndex lastChar |
+"/
+"/                indent := line indexOfNonSeparatorStartingAt:1.
+"/                "begining of block"
+"/
+"/                lastCharIndex := line size.
+"/                lastChar := nil.
+"/                [ lastCharIndex > 0 ] whileTrue:[
+"/                    (lastChar := line at: lastCharIndex) isSeparator ifTrue:[ 
+"/                        lastCharIndex := lastCharIndex - 1.
+"/                    ] ifFalse:[ 
+"/                        lastCharIndex := -2. "/ To terminate the loop.
+"/                    ].
+"/                ].
+"/                lastCharIndex == -2 ifTrue:[
+"/                    lastChar == $[ ifTrue:[
+"/                        indent := indent + 4.
+"/                    ] ifFalse:[
+"/                        "end of block args"
+"/                        (lastChar == $| and: [line includes: $[]) ifTrue:[
+"/                            indent := indent + 4.
+"/                        ]
+"/                    ].
+"/                ].
+"/                indent ~~ 0 ifTrue:[
+"/                    ^ indent - 1
+"/                ]
+"/            ]
+"/        ].
+"/        ^0.
+"/    ].
     ^super leftIndentForLine:lineNr
 
     "Created: / 10-12-2011 / 11:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 24-07-2014 / 09:38:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (comment): / 25-04-2017 / 12:58:48 / cg"
 ! !
 
 !CodeView2::TextView methodsFor:'initialization'!