From bd607cf57512580cf5c9c7d81be5b79b93d1ae9f Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 11 Dec 2016 14:59:47 +0000 Subject: Ensure that we get the last for a key. (Because we're scanning backwards throught the mappings, we shouldn't overwrite an existing mapping.) --- background_scripts/commands.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'background_scripts') 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() -- cgit v1.2.3