aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/mode_visual_edit.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'content_scripts/mode_visual_edit.coffee')
-rw-r--r--content_scripts/mode_visual_edit.coffee8
1 files changed, 4 insertions, 4 deletions
diff --git a/content_scripts/mode_visual_edit.coffee b/content_scripts/mode_visual_edit.coffee
index d9a02cbd..9c599959 100644
--- a/content_scripts/mode_visual_edit.coffee
+++ b/content_scripts/mode_visual_edit.coffee
@@ -361,17 +361,17 @@ class Movement extends CountPrefix
@movements.n = (count) -> executeFind count, false
@movements.N = (count) -> executeFind count, true
@movements["/"] = ->
- @findMode = window.enterFindMode()
+ @findMode = window.enterFindMode returnToViewport: true
@findMode.onExit => @changeMode VisualMode
#
# End of Movement constructor.
- # Yank the selection; always exits; either deletes the selection or removes it; set @yankedText and return
+ # Yank the selection; always exits; either deletes the selection or collapses it; set @yankedText and return
# it.
yank: (args = {}) ->
@yankedText = @selection.toString()
@selection.deleteFromDocument() if @options.deleteFromDocument or args.deleteFromDocument
- @selection.removeAllRanges() unless @options.parentMode
+ @selection.collapseToStart() unless @options.parentMode
message = @yankedText.replace /\s+/g, " "
message = message[...12] + "..." if 15 < @yankedText.length
@@ -384,7 +384,7 @@ class Movement extends CountPrefix
exit: (event, target) ->
unless @options.parentMode or @options.oneMovementOnly
- @selection.removeAllRanges() if event?.type == "keydown" and KeyboardUtils.isEscape event
+ @selection.collapseToStart() if event?.type == "keydown" and KeyboardUtils.isEscape event
# Disabled, pending discussion of fine-tuning the UX. Simpler alternative is implemented above.
# # If we're exiting on escape and there is a range selection, then we leave it in place. However, an