Merge PR #1584 from yztink/fix/scr-scripts: support .scr scripts, multi-line and single-line formats, and command prefixes

This commit is contained in:
Hakan Seven committed 2026-10-02 10:00:01 +03:00
commit c7df841711
6 files changed
+222 -34

No files matched your search

+4 -7
View File
@@ -982,6 +982,9 @@ impl OpenCADStudio {
.extension()
.map(|e| e.to_string_lossy().to_lowercase())
.unwrap_or_default();
if ext == "scr" {
return self.dispatch_command(&format!("SCRIPT \"{}\"", path.display()));
}
if !matches!(ext.as_str(), "dwg" | "dxf" | "bak" | "sv$") {
self.command_line.push_error(
crate::tf!("Unsupported file type: {}", path.display()).as_ref(),
@@ -2518,13 +2521,7 @@ impl OpenCADStudio {
self.dispatch_command(&cmd)
}
Message::ScriptLine(line) => {
if line.trim().is_empty() {
self.feed_command(crate::command::StepInput::Enter)
} else {
self.run_command_line(&line)
}
}
Message::ScriptLine(line) => self.feed_script_line(&line),
Message::ToggleLayers => {
if self.active_modal == Some(super::ModalKind::Layers) {