From 54139c11231bf7e7a3a9f4c98fb688d2d0fe22c9 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 2 Oct 2016 12:25:20 +0100 Subject: Better regexp (to match legacy behaviour for '>'. --- background_scripts/commands.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'background_scripts') diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index e1f82b72..7ab09f24 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -44,7 +44,8 @@ Commands = parseKeySequence: (key) -> if key.length == 0 [] - else if 0 == key.search /^<([^<>]+)>(.*)/ # Parse "bcd" as "" and "bcd". + # Parse "bcd" as "" and "bcd". + else if 0 == key.search /^<((?:[acm]-)*(?:.|[a-zA-Z0-9]{2,}))>(.*)/i [modifiers..., keyChar] = RegExp.$1.split "-" keyChar = keyChar.toLowerCase() unless keyChar.length == 1 modifiers = (modifier.toLowerCase() for modifier in modifiers) -- cgit v1.2.3