summaryrefslogtreecommitdiff
path: root/src/host/Host.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/host/Host.zig')
-rw-r--r--src/host/Host.zig9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/host/Host.zig b/src/host/Host.zig
index 002c704..93c47c1 100644
--- a/src/host/Host.zig
+++ b/src/host/Host.zig
@@ -727,13 +727,12 @@ pub fn runLine(self: *Host, line: []const u8, now: u64) !void {
}
/// Whether a console line that succeeded may have changed State other than
-/// through `update` (restoring a snapshot is caught apart from this).
+/// through `update` (restoring a snapshot is caught apart from this): a
+/// sketch's command may.
fn movesState(line: []const u8) bool {
var words = std.mem.tokenizeAny(u8, line, " \t");
- const verb = words.next() orelse return false;
- const still = [_][]const u8{ "help", "overlay", "timing", "get", "snapshot", "recording", "diff", "stop", "pause", "save", "quit", "exit", "sessions", "marks", "clips", "export-session", "import" };
- for (still) |w| if (std.mem.eql(u8, verb, w)) return false;
- return true;
+ const verb = std.meta.stringToEnum(Console.Verb, words.next() orelse return false) orelse return true;
+ return Console.verbs.get(verb).moves_state;
}
/// Offers a line to the sketch.