fix(script): repeat last command on blank line when outside active command

This commit is contained in:
yztink committed 2026-10-05 15:35:29 -07:00
1 parent 5f016e1192
commit 2b7a514701
2 files changed
+47 -1

No files matched your search

+7 -1
View File
@@ -1166,7 +1166,13 @@ impl OpenCADStudio {
// 2. Blank line submits Enter to the active command (or repeats last).
if trimmed.is_empty() {
return self.feed_command(StepInput::Enter);
if self.tabs[i].active_cmd.is_some() {
return self.feed_command(StepInput::Enter);
}
if let Some(cmd) = self.tabs[i].last_cmd.clone() {
return self.run_command_line(&cmd);
}
return Task::none();
}
// 3. A command is currently active: route to its prompt handlers.