EditTextView.st
changeset 6328 d3e900c5526f
parent 6314 ac5b9324a82a
child 6329 d828eeb4f784
--- a/EditTextView.st	Thu May 24 14:31:23 2018 +0200
+++ b/EditTextView.st	Sun May 27 11:39:43 2018 +0200
@@ -6920,25 +6920,31 @@
 !
 
 getTextSelectionFromHistory
-    |sel list box history|
+    "present the copyBufferHistory as a shortened list (first line of each),
+     and let user select from it.
+     Return the corresponding copyBuffer text or nil.
+     Used with 'Paste Previous' menu function"
+     
+    |sel listOfPasteTextLines box history|
 
     history := device getCopyBufferHistory copy.
-    list := history collect:[:entry |
-                |text shown|
-
-                text := entry asString string asCollectionOfLines.
-                shown := text detect:[:line| line notEmptyOrNil] ifNone:['      '].
-                text size > 1 ifTrue:[
-                    shown := shown,(resources string:' ... [%1 lines]' with:text size).
-                ].
-                shown
+    listOfPasteTextLines := 
+        history collect:[:entry |
+            |text shown|
+
+            text := entry asString string asCollectionOfLines.
+            shown := text detect:[:line| line notEmptyOrNil] ifNone:['      '].
+            text size > 1 ifTrue:[
+                shown := shown,(resources string:' ... [%1 lines]' with:text size).
             ].
+            shown
+        ].
 
     box := ListSelectionBox
                 title:(resources string:'Clipboard History')
                 okText:(resources string:'Paste')
                 abortText:(resources string:'Cancel')
-                list:list
+                list:listOfPasteTextLines
                 action:[:idx | idx notNil ifTrue:[sel := history at:idx]].
     box label:(resources string:'Select Previous Copybuffer String').
     box useIndex:true.
@@ -6946,6 +6952,7 @@
     ^ sel.
 
     "Modified: / 25-08-2010 / 22:02:14 / cg"
+    "Modified (format): / 27-05-2018 / 10:24:58 / Claus Gittinger"
 !
 
 getTextSelectionOrTextSelectionFromHistory