diff options
| author | Stephen Blott | 2015-01-30 09:08:26 +0000 |
|---|---|---|
| committer | Stephen Blott | 2015-01-30 09:08:26 +0000 |
| commit | 0029863f32be7cb079c43faeb9df84b0718f147d (patch) | |
| tree | 49d95f8bb192d6f7adb0c86bfbba2ef4b942680c | |
| parent | 4fa7870c15ed4abf9196aac9d81c1672c96d0d65 (diff) | |
| download | vimium-0029863f32be7cb079c43faeb9df84b0718f147d.tar.bz2 | |
Visual/edit modes: better find-mode integration.
| -rw-r--r-- | content_scripts/mode_visual_edit.coffee | 7 | ||||
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/content_scripts/mode_visual_edit.coffee b/content_scripts/mode_visual_edit.coffee index f14baff7..842f6c0a 100644 --- a/content_scripts/mode_visual_edit.coffee +++ b/content_scripts/mode_visual_edit.coffee @@ -266,7 +266,7 @@ class Movement extends CountPrefix @continueBubbling - # Install basic bindings for find mode, "n" and "N". We do not install these bindings if the is a + # Install basic bindings for find mode, "n" and "N". We do not install these bindings if this is a # sub-mode of edit mode, because we cannot (yet) guarantee that the selection will remain within the # active element. unless @options.parentMode or options.oneMovementOnly @@ -283,7 +283,9 @@ class Movement extends CountPrefix @movements.n = (count) -> executeFind count, false @movements.N = (count) -> executeFind count, true - @movements["/"] = -> enterFindMode() + @movements["/"] = -> + @findMode = enterFindMode() + @findMode.onExit => new VisualMode # # End of Movement constructor. @@ -361,6 +363,7 @@ class VisualMode extends Movement switch @selection.type when "None" + HUD.showForDuration "No selection, entering caret mode first.", 2500 return @changeMode CaretMode when "Caret" @selection.modify "extend", forward, character unless @options.oneMovementOnly diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index b71d1b18..6b96e929 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -1021,6 +1021,7 @@ findModeRestoreSelection = (range = findModeInitialRange) -> selection.removeAllRanges() selection.addRange range +# Enters find mode. Returns the new find-mode instance. window.enterFindMode = -> # Save the selection, so performFindInPlace can restore it. findModeSaveSelection() |
