diff options
| author | Stephen Blott | 2015-06-23 06:27:38 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-06-23 06:27:38 +0100 |
| commit | c404f6799bb748754f91b1d515108706a024dce1 (patch) | |
| tree | d351eb042dfe1ee293ddb6b54211c2f7bf68454b | |
| parent | f9939fdb5b8527c1b0ce92fd990472a4c95b6336 (diff) | |
| download | vimium-c404f6799bb748754f91b1d515108706a024dce1.tar.bz2 | |
*Always* collapse selection on yank.
This only affects the transition from visual mode back to edit mode.
Previously, we were incorrectly leaving the selection in place.
(The comment above was correct, but the implementation wasn't.)
| -rw-r--r-- | content_scripts/mode_visual_edit.coffee | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/content_scripts/mode_visual_edit.coffee b/content_scripts/mode_visual_edit.coffee index 8d1d96cc..58e4f815 100644 --- a/content_scripts/mode_visual_edit.coffee +++ b/content_scripts/mode_visual_edit.coffee @@ -375,8 +375,10 @@ class Movement extends CountPrefix # it. yank: (args = {}) -> @yankedText = @selection.toString() - @selection.deleteFromDocument() if @options.deleteFromDocument or args.deleteFromDocument - @selection.collapseToStart() unless @options.parentMode + if @options.deleteFromDocument or args.deleteFromDocument + @selection.deleteFromDocument() + else + @selection.collapseToStart() message = @yankedText.replace /\s+/g, " " message = message[...12] + "..." if 15 < @yankedText.length |
