diff --git a/keymapviz/__init__.py b/keymapviz/__init__.py index 0b5b126..769d1b8 100644 --- a/keymapviz/__init__.py +++ b/keymapviz/__init__.py @@ -80,7 +80,7 @@ def __parse_keymap_c(self): r'\s*(\w+(?\((?:[^()]|(?&rec))*\))*)\s*,?' ) keymaps = keymap_regexp.findall(src) - keymaps = [_.lstrip('(').rstrip(')') for _ in keymaps] + keymaps = [re.sub(r"^\(?(.*)\)?$", r"\1", _) for _ in keymaps] keymaps = [[__[0] for __ in keycode_regexp.findall(_)] for _ in keymaps] return keymaps