diff options
Diffstat (limited to 'background_scripts')
| -rw-r--r-- | background_scripts/commands.coffee | 1 | ||||
| -rw-r--r-- | background_scripts/main.coffee | 34 |
2 files changed, 17 insertions, 18 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index c3bc457a..7d2dccd9 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -202,6 +202,7 @@ defaultKeyMappings = # This is a mapping of: commandIdentifier => [description, options]. +# If the noRepeat and repeatLimit options are both specified, then noRepeat takes precedence. commandDescriptions = # Navigating the current page showHelp: ["Show help", { background: true }] diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 33425d90..898f46f1 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -531,7 +531,6 @@ checkKeyQueue = (keysToCheck, tabId, frameId) -> if (Commands.keyToCommandRegistry[command]) registryEntry = Commands.keyToCommandRegistry[command] - runCommand = true if registryEntry.noRepeat @@ -544,24 +543,23 @@ checkKeyQueue = (keysToCheck, tabId, frameId) -> Are you sure you want to continue? """ - if not runCommand - # Do nothing, use has chosen not to execute the command - else if not registryEntry.isBackgroundCommand - chrome.tabs.sendMessage(tabId, - name: "executePageCommand", - command: registryEntry.command, - frameId: frameId, - count: count, - passCountToFunction: registryEntry.passCountToFunction, - completionKeys: generateCompletionKeys("")) - refreshedCompletionKeys = true - else - if registryEntry.passCountToFunction - BackgroundCommands[registryEntry.command](count) - else if registryEntry.noRepeat - BackgroundCommands[registryEntry.command]() + if runCommand + if not registryEntry.isBackgroundCommand + chrome.tabs.sendMessage(tabId, + name: "executePageCommand", + command: registryEntry.command, + frameId: frameId, + count: count, + passCountToFunction: registryEntry.passCountToFunction, + completionKeys: generateCompletionKeys("")) + refreshedCompletionKeys = true else - repeatFunction(BackgroundCommands[registryEntry.command], count, 0, frameId) + if registryEntry.passCountToFunction + BackgroundCommands[registryEntry.command](count) + else if registryEntry.noRepeat + BackgroundCommands[registryEntry.command]() + else + repeatFunction(BackgroundCommands[registryEntry.command], count, 0, frameId) newKeyQueue = "" else if (getActualKeyStrokeLength(command) > 1) |
