# HG changeset patch # User Claus Gittinger # Date 1493117940 -7200 # Node ID 60c0aff2ee8730ff8f6d9e15cdf94c764931f2d6 # Parent 7f309137beb8e5fc9e7d3cb5a319602553703b71 #UI_ENHANCEMENT by cg class: Tools::CodeView2::TextView comment/format in: #basicMergeLine:removeBlanks: changed: #leftIndentForLine: diff -r 7f309137beb8 -r 60c0aff2ee87 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 " + "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 " "Modified: / 24-07-2014 / 09:38:54 / Jan Vrany " + "Modified (comment): / 25-04-2017 / 12:58:48 / cg" ! ! !CodeView2::TextView methodsFor:'initialization'!