Workspace.st
changeset 4877 ccea19c1d3ae
parent 4876 bd61d63ca402
child 4883 6eb7b0261532
--- a/Workspace.st	Sun Feb 09 22:41:07 2014 +0100
+++ b/Workspace.st	Sun Feb 09 22:48:14 2014 +0100
@@ -1331,7 +1331,7 @@
      All lines from line1 to line2 get an end-of-line comment
      in the first col."
 
-    |e commentPair opening closing sz1 sz2|
+    |e commentPair opening closing sz1 sz2 l1 l2 c1 c2|
 
     (self checkModificationsAllowed) ifFalse:[ ^ self].
     selectionStartLine isNil ifTrue:[ 
@@ -1366,13 +1366,14 @@
                         from:selectionEndCol - sz2 + 1
                         to:selectionEndCol) = closing ]) ifTrue:[
 
-                        self deleteCharsAtLine:selectionEndLine fromCol:selectionEndCol-sz2+1 toCol:selectionEndCol.
-                        self deleteCharsAtLine:selectionStartLine fromCol:selectionStartCol toCol:selectionStartCol+sz1-1.
+                        l2 := selectionEndLine.   c2 := selectionEndCol.
+                        l1 := selectionStartLine. c1 := selectionStartCol.
+                        self deleteCharsAtLine:l2 fromCol:c2-sz2+1 toCol:c2.
+                        self deleteCharsAtLine:l1 fromCol:c1 toCol:c1+sz1-1.
 
-                        e := selectionEndCol - sz2.
-                        selectionStartLine == selectionEndLine ifTrue:[e := e - sz1].
-                        self selectFromLine:selectionStartLine col:selectionStartCol
-                                     toLine:selectionEndLine col:e.
+                        e := c2 - sz2.
+                        l1 == l2 ifTrue:[e := e - sz1].
+                        self selectFromLine:l1 col:c1 toLine:l2 col:e.
                     ]
                 ]
             ]
@@ -2204,10 +2205,10 @@
 !Workspace class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.311 2014-02-09 21:41:07 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.312 2014-02-09 21:48:14 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.311 2014-02-09 21:41:07 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.312 2014-02-09 21:48:14 cg Exp $'
 ! !