Factor out selection of entire pasteTarget

Change-Id: I9fe66a8c60aacaa09617ff72fb2bf58a151d0652