aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content_scripts/mode_find.coffee7
-rw-r--r--content_scripts/vimium_frontend.coffee15
2 files changed, 3 insertions, 19 deletions
diff --git a/content_scripts/mode_find.coffee b/content_scripts/mode_find.coffee
index f19b5db4..5090e4ee 100644
--- a/content_scripts/mode_find.coffee
+++ b/content_scripts/mode_find.coffee
@@ -104,7 +104,6 @@ class FindMode extends Mode
# escape sequences. '\' is the escape character and needs to be escaped itself to be used as a normal
# character. here we grep for the relevant escape sequences.
@query.isRegex = Settings.get 'regexFindMode'
- hasNoIgnoreCaseFlag = false
@query.parsedQuery = @query.rawQuery.replace /(\\{1,2})([rRI]?)/g, (match, slashes, flag) =>
return match if flag == "" or slashes.length != 1
switch (flag)
@@ -112,12 +111,10 @@ class FindMode extends Mode
@query.isRegex = true
when "R"
@query.isRegex = false
- when "I"
- hasNoIgnoreCaseFlag = true
""
- # default to 'smartcase' mode, unless noIgnoreCase is explicitly specified
- @query.ignoreCase = !hasNoIgnoreCaseFlag && !Utils.hasUpperCase(@query.parsedQuery)
+ # Implement smartcase.
+ @query.ignoreCase = not Utils.hasUpperCase(@query.parsedQuery)
regexPattern = if @query.isRegex
@query.parsedQuery
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 594175ab..11310dcf 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -113,19 +113,6 @@ installModes = ->
new GrabBackFocus if isEnabledForUrl
normalMode # Return the normalMode object (for the tests).
-initializeOnEnabledStateKnown = (isEnabledForUrl) ->
- installModes() unless normalMode
- if isEnabledForUrl
- unless Utils.isFirefox() and document.documentElement.namespaceURI != "http://www.w3.org/1999/xhtml"
- # We only initialize (and activate) the Vomnibar in the top frame. Also, we do not initialize the
- # Vomnibar until we know that Vimium is enabled. Thereafter, there's no more initialization to do.
- #
- # NOTE(mrmr1993): In XML documents on Firefox, injecting HTML into the DOM breaks the rendering, so we
- # lazy load the Vomnibar. This comes with the expected issues, but is better than breaking all XML
- # documents.
- DomUtils.documentComplete Vomnibar.init.bind Vomnibar if DomUtils.isTopFrame()
- initializeOnEnabledStateKnown = ->
-
#
# Complete initialization work that should be done prior to DOMReady.
#
@@ -305,7 +292,7 @@ checkIfEnabledForUrl = do ->
Frame.addEventListener "isEnabledForUrl", (response) ->
{isEnabledForUrl, passKeys, frameIsFocused, isFirefox} = response
Utils.isFirefox = -> isFirefox
- initializeOnEnabledStateKnown isEnabledForUrl
+ installModes() unless normalMode
normalMode.setPassKeys passKeys
# Hide the HUD if we're not enabled.
HUD.hide true, false unless isEnabledForUrl