From f83ef9ff332e37b8e12d8ca608b1e193003669e1 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Tue, 26 Jan 2016 15:39:59 +0000 Subject: Collapse selection on exiting visual mode. This applies only to the case where visual mode is run under edit mode. Previously, we were leaving the selection in place ... which is weird and not vim-like. --- content_scripts/mode_visual_edit.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content_scripts/mode_visual_edit.coffee b/content_scripts/mode_visual_edit.coffee index 9e597cca..8bcde6cb 100644 --- a/content_scripts/mode_visual_edit.coffee +++ b/content_scripts/mode_visual_edit.coffee @@ -554,6 +554,10 @@ class VisualMode extends Movement if document.activeElement and DomUtils.isEditable document.activeElement document.activeElement.blur() unless event?.type == "click" + if @options.parentMode + # E.g. when exiting visual mode under edit mode, we no longer want the selection. + @collapseSelectionToFocus() + super event, target if @yankedText? unless @options.noCopyToClipboard -- cgit v1.2.3