From afd9caea002bd672a01d275922e6b5c5b1de8b82 Mon Sep 17 00:00:00 2001 From: Eric Werner Date: Thu, 14 Mar 2019 23:34:55 +0100 Subject: [PATCH] fixed hotkey_common.parent_modifier_string for empty strings --- ui/a2widget/a2hotkey/hotkey_common.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/a2widget/a2hotkey/hotkey_common.py b/ui/a2widget/a2hotkey/hotkey_common.py index 54c287ab..a25c2878 100644 --- a/ui/a2widget/a2hotkey/hotkey_common.py +++ b/ui/a2widget/a2hotkey/hotkey_common.py @@ -123,8 +123,15 @@ def parent_modifier_string(modifier_string): """ Gets the modifier string without the side variant l/r. - A hotkey with the modifier LWin+J would collide with Win+J. + As a hotkey like "LWin+Shift+J" would still collide with "Win+Shift+J". + This turns a given string like 'LWin+Shift' to 'Win+Shift'. + + :param str modifier_string: Hotkey modifier string with Ls or Rs. + :rtype: str """ + if not modifier_string: + return [] + modifiers = modifier_string.split('+') for i, part in enumerate(modifiers): if part[0].lower() in 'lr':