Skip to content

Commit 061d1b0

Browse files
committed
Disable repeated tab closing. Refs philc#555.
1 parent a83d619 commit 061d1b0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

background_scripts/commands.coffee

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Commands =
2121
description: description
2222
isBackgroundCommand: options.background
2323
passCountToFunction: options.passCountToFunction
24+
noRepeat: options.noRepeat
2425

2526
mapKeyToCommand: (key, command) ->
2627
unless @availableCommands[command]
@@ -31,6 +32,7 @@ Commands =
3132
command: command
3233
isBackgroundCommand: @availableCommands[command].isBackgroundCommand
3334
passCountToFunction: @availableCommands[command].passCountToFunction
35+
noRepeat: @availableCommands[command].noRepeat
3436

3537
unmapKey: (key) -> delete @keyToCommandRegistry[key]
3638

@@ -63,7 +65,7 @@ Commands =
6365

6466
continue unless @availableCommands[vimiumCommand]
6567

66-
console.log("Mapping", key, "to", vimiumCommand)
68+
konsole.log("Mapping", key, "to", vimiumCommand)
6769
@mapKeyToCommand(key, vimiumCommand)
6870
else if (lineCommand == "unmap")
6971
continue if (splitLine.length != 2)
@@ -236,7 +238,7 @@ commandDescriptions =
236238
lastTab: ["Go to the last tab", { background: true }]
237239
createTab: ["Create new tab", { background: true }]
238240
duplicateTab: ["Duplicate current tab", { background: true }]
239-
removeTab: ["Close current tab", { background: true }]
241+
removeTab: ["Close current tab", { background: true, noRepeat: true }]
240242
restoreTab: ["Restore closed tab", { background: true }]
241243

242244
"Vomnibar.activate": ["Open URL, bookmark, or history entry"]

background_scripts/main.coffee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,8 @@ checkKeyQueue = (keysToCheck, tabId, frameId) ->
478478
else
479479
if registryEntry.passCountToFunction
480480
BackgroundCommands[registryEntry.command](count)
481+
else if registryEntry.noRepeat
482+
BackgroundCommands[registryEntry.command]()
481483
else
482484
repeatFunction(BackgroundCommands[registryEntry.command], count, 0, frameId)
483485

0 commit comments

Comments
 (0)