TextView.st
branchdelegated_gc_text-view-selection-refactoring
changeset 5296 588057883532
parent 5221 d036f1df0408
parent 5295 867e53cc61c6
child 5299 cc8c9190c081
--- a/TextView.st	Wed Dec 31 11:25:27 2014 +0100
+++ b/TextView.st	Mon Feb 16 08:12:24 2015 +0000
@@ -11,6 +11,8 @@
 "
 "{ Package: 'stx:libwidg' }"
 
+"{ NameSpace: Smalltalk }"
+
 ListView subclass:#TextView
 	instanceVariableNames:'selectionStartLine selectionStartCol selectionEndLine
 		selectionEndCol clickPos clickStartLine clickStartCol clickLine
@@ -1193,7 +1195,7 @@
     selection := self selection.
 
     selection size == 0 ifTrue:[^ nil].
-  ^ Array with:(DropObject newText:selection).
+    ^ Array with:(DropObject newText:selection).
 !
 
 dropSource
@@ -2754,9 +2756,9 @@
     selectionEndLine := firstLineShown + nFullLinesShown.
     selectionEndCol := 0.
     prevEndLine to:selectionEndLine do:[:lineNr |
-	self redrawLine:lineNr
+        self redrawLine:lineNr
     ].
-    Processor addTimedBlock:autoScrollBlock afterSeconds:autoScrollDeltaT.
+    autoScrollBlock notNil ifTrue:[ Processor addTimedBlock:autoScrollBlock afterSeconds:autoScrollDeltaT ].
     self selectionChanged.
 !
 
@@ -2774,7 +2776,7 @@
     selectionStartCol := selectionStartCol - 1 max:1.
     self scrollLeft.
 
-    Processor addTimedBlock:autoScrollBlock afterSeconds:autoScrollDeltaT.
+    autoScrollBlock notNil ifTrue:[ Processor addTimedBlock:autoScrollBlock afterSeconds:autoScrollDeltaT ].
     self selectionChanged.
 !
 
@@ -2792,18 +2794,18 @@
 
     endLine := self listLineToVisibleLine:selectionEndLine.
     endLine notNil ifTrue:[
-	firstVisibleCol := self colOfX:1 inVisibleLine:endLine.
-	selectionEndCol < firstVisibleCol ifTrue:[
-	    "/ scrolling faster than selection advances...
-	    selectionEndCol := firstVisibleCol
-	].
+        firstVisibleCol := self colOfX:1 inVisibleLine:endLine.
+        selectionEndCol < firstVisibleCol ifTrue:[
+            "/ scrolling faster than selection advances...
+            selectionEndCol := firstVisibleCol
+        ].
     ].
 
     self selectionChanged.
     self scrollRight.
     "/ self repairDamage.
 
-    Processor addTimedBlock:autoScrollBlock afterSeconds:autoScrollDeltaT.
+    autoScrollBlock notNil ifTrue:[ Processor addTimedBlock:autoScrollBlock afterSeconds:autoScrollDeltaT ].
 
     "Modified: / 05-08-2010 / 21:25:56 / cg"
 !
@@ -2823,9 +2825,9 @@
     selectionStartLine := firstLineShown.
     selectionStartCol := 1.
     selectionStartLine to:prevStartLine do:[:lineNr |
-	self redrawLine:lineNr
+        self redrawLine:lineNr
     ].
-    Processor addTimedBlock:autoScrollBlock afterSeconds:autoScrollDeltaT.
+    autoScrollBlock notNil ifTrue:[ Processor addTimedBlock:autoScrollBlock afterSeconds:autoScrollDeltaT ].
     self selectionChanged.
 !
 
@@ -4280,9 +4282,10 @@
     "set the searchpattern for future searches"
 
     aStringOrNil isEmptyOrNil ifTrue:[
-	lastSearchPattern := nil.
+        lastSearchPattern := nil.
     ] ifFalse:[
-	lastSearchPattern := aStringOrNil asString withoutSeparators string.
+        "/ not withoutSeparators: may want to search for spaces...
+        lastSearchPattern := aStringOrNil asString "withoutSeparators" string.
     ].
 
     "Modified: / 6.3.1999 / 23:47:36 / cg"
@@ -4949,11 +4952,11 @@
 !TextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.384 2014-08-03 12:27:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.388 2015-02-04 23:14:56 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.384 2014-08-03 12:27:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.388 2015-02-04 23:14:56 cg Exp $'
 !
 
 version_HG