Wednesday, June 18, 2008

Extending cut-and-paste: split copy

A document might contain a line of text like

     13491, Orange, 2, $50

which can be considered as a sequence of items delimited by ', '.

You could select that text and, with a 'split copy' that specifies the ', ' delimiter, copy each item onto the clipboard as a separate item (in the following, an underscore is used to represent a space):

     CTRL(+SHIFT)+C,S,,_

The clipboard would end up containing four items:

     1) 13491
     2) Orange
     3) 2
     4) $50

Remember that by default when you copy something to the clipboard it replaces the last item on the clipboard list. When you're copying multiple items on the clipboard with a split copy, the first of those items would replace the item currently at the end of the list, and the other items would be inserted after it.

If there were three space separated words in the document and you wanted to copy them as new items at the end of the clipboard list, following what was already there, you could use '+' to do so (again with a space represented by an underscore):

     CTRL(+SHIFT)+C,+,S,_

If you wanted to insert the new items starting at a specific position in the clipboard list, like at position 3:

     CTRL(+SHIFT)+C,3,+,S,_

(At this stage I think it should probably be possible for the user to list the position specifier '3' and the '+' in any order - the previous command could also be written as:

     CTRL(+SHIFT)+C,+,3,S,_

but this is something I'll come back to).

If you specified a delimiter that wasn't contained in the selected text, I think the most sensible behavior would be for nothing to be copied to the clipboard (perhaps with a subtle auditory or visual indication of the failure). The most obvious alternative would be for the entire selection to be copied as a single item.

No comments:

Post a Comment