diff options
Diffstat (limited to 'content_scripts')
| -rw-r--r-- | content_scripts/mode_normal.coffee | 8 | ||||
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 11 |
2 files changed, 9 insertions, 10 deletions
diff --git a/content_scripts/mode_normal.coffee b/content_scripts/mode_normal.coffee index a7a8a8b6..652adc3c 100644 --- a/content_scripts/mode_normal.coffee +++ b/content_scripts/mode_normal.coffee @@ -100,6 +100,14 @@ NormalModeCommands = enterVisualLineMode: -> new VisualLineMode userLaunchedMode: true + enterFindMode: -> + Marks.setPreviousPosition() + new FindMode() + + # Find. + performFind: (count) -> FindMode.findNext false for [0...count] by 1 + performBackwardsFind: (count) -> FindMode.findNext true for [0...count] by 1 + root = exports ? (window.root ?= {}) root.NormalMode = NormalMode root.NormalModeCommands = NormalModeCommands diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 11c952ca..e5de01a3 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -438,9 +438,6 @@ selectFoundInputElement = -> DomUtils.isDOMDescendant(findModeAnchorNode, document.activeElement)) DomUtils.simulateSelect(document.activeElement) -performFind = (count) -> FindMode.findNext false for [0...count] by 1 -performBackwardsFind = (count) -> FindMode.findNext true for [0...count] by 1 - getLinkFromSelection = -> node = window.getSelection().anchorNode while (node && node != document.body) @@ -543,11 +540,6 @@ root.goNext = -> nextStrings = nextPatterns.split(",").filter( (s) -> s.trim().length ) findAndFollowRel("next") || findAndFollowLink(nextStrings) -# Enters find mode. Returns the new find-mode instance. -enterFindMode = -> - Marks.setPreviousPosition() - new FindMode() - root.showHelp = (sourceFrameId) -> HelpDialog.toggle {sourceFrameId, showAllCommandDetails: false} @@ -575,8 +567,7 @@ root.Frame = Frame root.windowIsFocused = windowIsFocused root.bgLog = bgLog # These are exported for find mode and link-hints mode. -extend root, {focusFoundLink, selectFoundInputElement, performFind, performBackwardsFind, enterFindMode, - focusThisFrame} +extend root, {focusFoundLink, selectFoundInputElement, focusThisFrame} # These are exported only for the tests. extend root, {installModes} extend window, root unless exports? |
