Merge pull request #1624 from yztink/fix/script-repeat-last-cmd

A blank script line outside a command repeats the last command.
This commit is contained in:
Hakan Seven committed 2026-10-06 20:12:20 +03:00
commit 59b76ada5c
2 files changed
+47 -1

No files matched your search

+7 -1
View File
@@ -1177,7 +1177,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.