fix: review fixes for the merged command-line, plugin and font changes

Direct distance entry (#1429) turned every bare number at a point prompt
into a distance, so ROTATE's angle and the values automation types were
read as coordinates. The step reads the token first now — `feed_command`
reports whether it claimed it — and only an unclaimed one becomes a
distance. That also puts the token back on the unified step driver, which
owns the P / L selection keywords and the dimension-snap bookkeeping, and
stops `on_text_input` running twice for the same token. A tracking ray
carries its own base, so it no longer demands an anchor that the first
point of a command does not have yet.

Plugin command execution (#1425) re-implemented the command line inside
the plugin host: it dispatched families directly, skipping the teardown
that starts a command (grip edits, selection gestures, `last_point`, the
accepted snaps), and made every `CmdResult::Dispatch` in the application
skip plugin dispatch to avoid its own re-entrancy. A scripted line now
runs through `run_command_line`, with the trailing Enter left off while
the plugin streams the command, and the re-entrancy is handled by a flag
set for the length of the plugin's call. A pause parks the line's Enter
with the rest of its tokens instead of dropping it.

A font reference (#1432) tried the family lookup before the face-file
index, and that lookup ends in a prefix match a longer file name loses to
(`ISOCPEUI.TTF` would take `ISOCP`). The exact file answers first.

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 5 committed 2026-09-22 13:35:25 +03:00
1 parent 0cbaf18551
commit fcbab57627
6 files changed
+94 -100

No files matched your search

+6 -11
View File
@@ -43,12 +43,7 @@ impl OpenCADStudio {
}
pub(super) fn dispatch_command(&mut self, cmd: &str) -> Task<Message> {
self.dispatch_command_inner(cmd, false, false)
}
/// Dispatch a command skipping external plugin dispatch to prevent reentrant deadlocks.
pub(super) fn dispatch_command_without_plugins(&mut self, cmd: &str) -> Task<Message> {
self.dispatch_command_inner(cmd, false, true)
self.dispatch_command_inner(cmd, false)
}
/// Dispatch a verb typed at the interactive command line, falling back to
@@ -60,10 +55,10 @@ impl OpenCADStudio {
/// callers (ribbon, plugins, headless automation) use `dispatch_command`
/// and never get silent substitution.
pub(super) fn dispatch_command_or_suggest(&mut self, cmd: &str) -> Task<Message> {
self.dispatch_command_inner(cmd, true, false)
self.dispatch_command_inner(cmd, true)
}
fn dispatch_command_inner(&mut self, cmd: &str, allow_suggest: bool, skip_plugins: bool) -> Task<Message> {
fn dispatch_command_inner(&mut self, cmd: &str, allow_suggest: bool) -> Task<Message> {
let i = self.active_tab;
// Expand a command alias ("L" → "LINE") on the leading token before any
// routing, so every path below (Start-tab gate, plugins, all dispatch
@@ -191,7 +186,7 @@ impl OpenCADStudio {
return Task::none();
}
if !skip_plugins && crate::plugin::try_dispatch(self, i, cmd) {
if !self.suppress_plugin_dispatch && crate::plugin::try_dispatch(self, i, cmd) {
// try_dispatch returns true for both finished commands and interactive
// commands that it just installed. If no command is now active, the
// tool was a one-shot and we must turn the ribbon highlight off here —
@@ -230,7 +225,7 @@ impl OpenCADStudio {
.next()
{
if !top.eq_ignore_ascii_case(cmd) {
return self.dispatch_command_inner(&top, false, skip_plugins);
return self.dispatch_command_inner(&top, false);
}
}
}
@@ -244,7 +239,7 @@ impl OpenCADStudio {
/// `Some(task)` for an arm it owns (early-returning or falling through to
/// `finish_dispatch`), or `None` to defer to the next — equivalent to one
/// sequential `match` over all arms.
pub(crate) fn dispatch_families(&mut self, cmd: &str, i: usize) -> Option<Task<Message>> {
fn dispatch_families(&mut self, cmd: &str, i: usize) -> Option<Task<Message>> {
if let Some(t) = self.dispatch_fileops(cmd, i) {
return Some(t);
}