diff --git a/octoprint_gcode_macro/__init__.py b/octoprint_gcode_macro/__init__.py index d374ebe..5a5b35a 100644 --- a/octoprint_gcode_macro/__init__.py +++ b/octoprint_gcode_macro/__init__.py @@ -109,7 +109,9 @@ def render_macro(self, command, level=0): for cmd in commands: if cmd.startswith("@"): # Recursively render for each @ command in macro - result += self.render_macro(cmd, level=level + 1) + submacro = self.render_macro(cmd, level=level + 1) + if submacro: + result += submacro else: result += [cmd] else: