mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-30 05:37:00 -06:00
macro.debug runs a macro one step at a time. start checks the macro as macro.run does (policy, approval, inputs, footprint and output rule) and pauses before the first step; step runs one step; continue runs to the next breakpoint; runTo runs to a chosen step path, stopping at breakpoints on the way; stop ends the run and keeps its changes or rolls them back; state reports where it is. Breakpoints are the steps' own flags plus a list of paths given with any action (breakpointsOnly makes the list replace the flags), and they stop in every pass of a Repeat. The run lives on the session between calls, inside an undo group that spans them (group_begin and group_end), so a debugged run is one undo step "Run Macro: <name>", as a normal run is. A failing step ends the run and rolls it back; so does a Stop step that asks for a rollback. While a macro is being debugged, edits of the workbooks the run touched (its own, and any other a step changed) are refused at the top level with "Finish or stop the macro first"; other workbooks stay editable, and selecting and queries still work. Every answer gives the next step's path, kind, command, parameters as they would run now (tokens resolved), the Repeat pass, the parameters of the step that just ran, the steps executed and the cells changed so far. Each action gets its own time limit. If a command panics while a step runs, the session's panic guard rolls the debugged run back as well, so its undo group never stays open.