mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-24 09:46:59 -06:00
ui-egui: surface erase errors in the batched type_text path
Address CodeRabbit review on #3307: the new `Seq::Erase` arm discarded the `tool_key` Result, dropping an erase error silently, whereas the old `route_type_input`/`text_key` path reported it via `app.status`. Mirror that behaviour so a failed Backspace/Delete still surfaces in the status bar. Behaviour otherwise unchanged; fmt/clippy clean and the three IME tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
committed by
bflatastic
co-authored by
Claude Opus 4.8
parent
17952be94a
commit
0782248cff
@@ -272,7 +272,14 @@ fn type_text(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
app.session.tool_text(&t, view)
|
||||
}
|
||||
// While composing (or in a frame that began composing), editing keys belong to the IME.
|
||||
Seq::Erase(tk, m) if !was_composing && !app.session.tool_composing() => app.session.tool_key(tk, m, view),
|
||||
Seq::Erase(tk, m) if !was_composing && !app.session.tool_composing() => {
|
||||
// Mirror `route_type_input`/`text_key`: surface an erase error in the status bar
|
||||
// instead of discarding it.
|
||||
if let Err(e) = app.session.tool_key(tk, m, view) {
|
||||
app.status(e.to_string());
|
||||
}
|
||||
Ok(vec![])
|
||||
}
|
||||
Seq::Erase(..) => Ok(vec![]),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user