Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c404f67

Browse files
*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.)
1 parent f9939fd commit c404f67

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

content_scripts/mode_visual_edit.coffee

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,10 @@ class Movement extends CountPrefix
375375
# it.
376376
yank: (args = {}) ->
377377
@yankedText = @selection.toString()
378-
@selection.deleteFromDocument() if @options.deleteFromDocument or args.deleteFromDocument
379-
@selection.collapseToStart() unless @options.parentMode
378+
if @options.deleteFromDocument or args.deleteFromDocument
379+
@selection.deleteFromDocument()
380+
else
381+
@selection.collapseToStart()
380382

381383
message = @yankedText.replace /\s+/g, " "
382384
message = message[...12] + "..." if 15 < @yankedText.length

0 commit comments

Comments
 (0)