From c404f6799bb748754f91b1d515108706a024dce1 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Tue, 23 Jun 2015 06:27:38 +0100 Subject: *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.) --- content_scripts/mode_visual_edit.coffee | 6 ++++-- 1 file 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 -- cgit v1.2.3