From 85aa76ec68167ea0ac08cc627b3f12e1077b1b1f Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Thu, 28 May 2015 22:12:08 +0100 Subject: Decide find mode text in the HUD iframe, not in frontend --- content_scripts/vimium_frontend.coffee | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'content_scripts/vimium_frontend.coffee') diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 8c28b4e6..46af3847 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -686,9 +686,6 @@ updateFindModeQuery = -> # default to 'smartcase' mode, unless noIgnoreCase is explicitly specified findModeQuery.ignoreCase = !hasNoIgnoreCaseFlag && !Utils.hasUpperCase(findModeQuery.parsedQuery) - # Don't count matches in the HUD. - HUD.hide(true) - # if we are dealing with a regex, grep for all matches in the text, and then call window.find() on them # sequentially so the browser handles the scrolling / text selection. if findModeQuery.isRegex @@ -993,13 +990,11 @@ window.goNext = -> findAndFollowRel("next") || findAndFollowLink(nextStrings) showFindModeHUDForQuery = -> - if findModeQuery.rawQuery and (findModeQueryHasResults || findModeQuery.parsedQuery.length == 0) - plural = if findModeQuery.matchCount == 1 then "" else "es" - HUD.show("/" + findModeQuery.rawQuery + " (" + findModeQuery.matchCount + " Match#{plural})") - else if findModeQuery.rawQuery - HUD.show("/" + findModeQuery.rawQuery + " (No Matches)") - else - HUD.show("/") + matchCount = if findModeQuery.parsedQuery.length > 0 then findModeQuery.matchCount else 0 + showCount = findModeQuery.rawQuery.length > 0 + + HUD.showFindMode findModeQuery.rawQuery + HUD.updateMatchesCount matchCount, showCount getCurrentRange = -> selection = getSelection() @@ -1027,7 +1022,7 @@ window.enterFindMode = (options = {}) -> findModeSaveSelection() findModeQuery = rawQuery: "" findMode = new FindMode options - HUD.show "/" + HUD.showFindMode() findMode window.showHelpDialog = (html, fid) -> -- cgit v1.2.3