CodeView.st
changeset 136 80d2240b2cdc
parent 132 596439fe4efd
child 174 d80a6cc3f9b2
--- a/CodeView.st	Thu Aug 03 03:35:39 1995 +0200
+++ b/CodeView.st	Tue Aug 08 03:07:33 1995 +0200
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	    All Rights Reserved
 
-$Header: /cvs/stx/stx/libwidg/CodeView.st,v 1.19 1995-07-03 02:32:27 claus Exp $
+$Header: /cvs/stx/stx/libwidg/CodeView.st,v 1.20 1995-08-08 01:06:44 claus Exp $
 '!
 
 !CodeView class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libwidg/CodeView.st,v 1.19 1995-07-03 02:32:27 claus Exp $
+$Header: /cvs/stx/stx/libwidg/CodeView.st,v 1.20 1995-08-08 01:06:44 claus Exp $
 "
 !
 
@@ -146,47 +146,6 @@
 	self at:lineNr put:(('"' , '/') , l)
     ].
     self textChanged.
-!
-
-commentSelection
-    "convenient function to comment out a block.
-     All lines from line1 to line2 get an end-of-line comment
-     in the first col."
-
-    |e|
-
-    (selectionStartCol == 1 and:[selectionEndCol == 0]) ifTrue:[
-	self commentFrom:selectionStartLine to:selectionEndLine-1
-    ] ifFalse:[
-	self insert:$" atLine:selectionStartLine col:selectionStartCol.
-	e := selectionEndCol + 1.
-	selectionStartLine == selectionEndLine ifTrue:[e := e + 1].
-	self insert:$" atLine:selectionEndLine col:e.
-	self selectFromLine:selectionStartLine col:selectionStartCol
-		     toLine:selectionEndLine col:e.
-    ]
-!
-
-uncommentSelection
-    "convenient function to comment out a block.
-     All lines from line1 to line2 get an end-of-line comment
-     in the first col."
-
-    |e|
-
-    (selectionStartCol == 1 and:[selectionEndCol == 0]) ifTrue:[
-	self uncommentFrom:selectionStartLine to:selectionEndLine-1
-    ] ifFalse:[
-	((self characterAtLine:selectionStartLine col:selectionStartCol) == $"
-	and:[(self characterAtLine:selectionEndLine col:selectionEndCol) == $"]) ifTrue:[
-	    self deleteCharAtLine:selectionEndLine col:selectionEndCol.
-	    self deleteCharAtLine:selectionStartLine col:selectionStartCol.
-	    e := selectionEndCol - 1.
-	    selectionStartLine == selectionEndLine ifTrue:[e := e - 1].
-	    self selectFromLine:selectionStartLine col:selectionStartCol
-			 toLine:selectionEndLine col:e.
-	]
-    ]
 ! !
 
 !CodeView methodsFor:'accessing'!
@@ -234,6 +193,47 @@
 	    explainAction value:(self contents) value:(text asString)
 	]
     ]
+!
+
+commentSelection
+    "convenient function to comment out a block.
+     All lines from line1 to line2 get an end-of-line comment
+     in the first col."
+
+    |e|
+
+    (selectionStartCol == 1 and:[selectionEndCol == 0]) ifTrue:[
+	self commentFrom:selectionStartLine to:selectionEndLine-1
+    ] ifFalse:[
+	self insert:$" atLine:selectionStartLine col:selectionStartCol.
+	e := selectionEndCol + 1.
+	selectionStartLine == selectionEndLine ifTrue:[e := e + 1].
+	self insert:$" atLine:selectionEndLine col:e.
+	self selectFromLine:selectionStartLine col:selectionStartCol
+		     toLine:selectionEndLine col:e.
+    ]
+!
+
+uncommentSelection
+    "convenient function to comment out a block.
+     All lines from line1 to line2 get an end-of-line comment
+     in the first col."
+
+    |e|
+
+    (selectionStartCol == 1 and:[selectionEndCol == 0]) ifTrue:[
+	self uncommentFrom:selectionStartLine to:selectionEndLine-1
+    ] ifFalse:[
+	((self characterAtLine:selectionStartLine col:selectionStartCol) == $"
+	and:[(self characterAtLine:selectionEndLine col:selectionEndCol) == $"]) ifTrue:[
+	    self deleteCharAtLine:selectionEndLine col:selectionEndCol.
+	    self deleteCharAtLine:selectionStartLine col:selectionStartCol.
+	    e := selectionEndCol - 1.
+	    selectionStartLine == selectionEndLine ifTrue:[e := e - 1].
+	    self selectFromLine:selectionStartLine col:selectionStartCol
+			 toLine:selectionEndLine col:e.
+	]
+    ]
 ! !
 
 !CodeView methodsFor:'event handling'!