Skip to content

Commit

Permalink
Add macro support
Browse files Browse the repository at this point in the history
  • Loading branch information
caksoylar committed May 22, 2024
1 parent af27578 commit f5d5e1b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion keymap_drawer/parse/kanata.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def _get_aliases_vars(self, nodes: list[pp.ParseResults]) -> None:
except StopIteration:
pass


def _str_to_key( # pylint: disable=too-many-return-statements,too-many-locals,too-many-branches
self,
binding: str | pp.ParseResults,
Expand Down Expand Up @@ -135,6 +134,11 @@ def recurse(new_binding):
if len(binding) > 4:
binds[-1] = "…"
return LayoutKey(tap=" +".join(binds))
if binding[0] == "macro":
binds = [recurse(bind).tap for bind in binding[1:4]]
if len(binding) > 4:
binds[-1] = "…"
return LayoutKey(tap="macro " + " ".join(binds))

return LayoutKey(tap=binding_str)

Expand Down

0 comments on commit f5d5e1b

Please sign in to comment.