Scripts: palette handlers play the showing run's actions, and a given text stays in its field

- A palette's handler runs take the actions of the run that first showed
  the palette (script.run's actions, or the Actions panel's in the app),
  so app.doScript in a handler plays them after that run ends too.
- An edit field keeps showing the text it gave the script while that
  change waits for a run. The text goes once the session no longer holds
  the change, or the field holds the text; a text the script refuses goes
  back in the field as typed.
This commit is contained in:
dotCooCoo committed 2026-11-30 16:13:14 -08:00
1 parent 77cc99b2bd
commit 95847e92db
6 files changed
+171 -13

No files matched your search

+1 -1
View File
@@ -767,7 +767,7 @@ fn palette_show(host: &Host, args: &[Data]) -> Result<Data, HostError> {
let dialog = described(host, args)?;
let id = palette_id(args.get(1));
let grants = host.disk.borrow().own().to_string();
let shown = host.session.borrow_mut().script_palettes.show(id, &engine, (host.file.clone(), grants), dialog);
let shown = host.session.borrow_mut().script_palettes.show(id, &engine, (host.file.clone(), grants, &host.actions), dialog);
shown.map(|id| Data::Number(id as f64)).map_err(HostError::Range)
}