summaryrefslogtreecommitdiff
path: root/lib/python/qmk/json_encoders.py
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2022-03-24 20:14:36 +0000
committerQMK Bot <hello@qmk.fm>2022-03-24 20:14:36 +0000
commit2957f60dc10d479d94508263d5741917051ed28d (patch)
treec3ae126c92e78d6f86097c9d44d6ea2d402124af /lib/python/qmk/json_encoders.py
parentdc9eb21332b0fc274cc69358032dc923da6dc306 (diff)
parentefc9c525b19b33c6e09057218ea64f07f45f9555 (diff)
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'lib/python/qmk/json_encoders.py')
-rwxr-xr-xlib/python/qmk/json_encoders.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/python/qmk/json_encoders.py b/lib/python/qmk/json_encoders.py
index 72e91973a3..40a5c1dea8 100755
--- a/lib/python/qmk/json_encoders.py
+++ b/lib/python/qmk/json_encoders.py
@@ -146,7 +146,13 @@ class KeymapJSONEncoder(QMKJSONEncoder):
if key == 'JSON_NEWLINE':
layer.append([])
else:
- layer[-1].append(f'"{key}"')
+ if isinstance(key, dict):
+ # We have a macro
+
+ # TODO: Add proper support for nicely formatting keymap.json macros
+ layer[-1].append(f'{self.encode(key)}')
+ else:
+ layer[-1].append(f'"{key}"')
layer = [f"{self.indent_str*indent_level}{', '.join(row)}" for row in layer]