aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2016-12-11 14:59:47 +0000
committerStephen Blott2016-12-11 14:59:49 +0000
commitbd607cf57512580cf5c9c7d81be5b79b93d1ae9f (patch)
tree2f6b3bdefc8456d3427684f1a0079f81b86f3fbb
parent96fcc551188a548c565103285701aed9622e5a99 (diff)
downloadvimium-bd607cf57512580cf5c9c7d81be5b79b93d1ae9f.tar.bz2
Ensure that we get the last for a key.
(Because we're scanning backwards throught the mappings, we shouldn't overwrite an existing mapping.)
-rw-r--r--background_scripts/commands.coffee2
1 files changed, 1 insertions, 1 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index 3684304c..aece4bec 100644
--- a/background_scripts/commands.coffee
+++ b/background_scripts/commands.coffee
@@ -39,7 +39,7 @@ Commands =
if tokens.length == 3
fromChar = @parseKeySequence tokens[1]
toChar = @parseKeySequence tokens[2]
- @mapKeyRegistry[fromChar[0]] = toChar[0] if fromChar.length == toChar.length == 1
+ @mapKeyRegistry[fromChar[0]] ?= toChar[0] if fromChar.length == toChar.length == 1
chrome.storage.local.set mapKeyRegistry: @mapKeyRegistry
@installKeyStateMapping()