mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-30 05:16:56 -06:00
Tools that act on a document, and the control methods engine.execute, document.inspect, node.get and ui.render, take an optional `document` (an open file's id from doc.list / document.inspect, or its path). The call acts on that file and the tab in front stays in front, so an attached agent keeps editing its own file when the user switches tabs.
This commit is contained in:
@@ -65,6 +65,13 @@ window, with its tabs, panels and canvas: `engine.execute` acts on the file it s
|
||||
last in front (the one the user clicked last, or the last `window.new` / `window.focus`). An
|
||||
unknown id is an error.
|
||||
|
||||
**Documents.** `engine.execute`, `document.inspect`, `node.get` and `ui.render` take an optional
|
||||
`document`: an open file's `id` (from `doc.list`, or `document.inspect`'s `id`) or its path. The
|
||||
request acts on that file without bringing its tab to the front; the tab in front comes back
|
||||
afterwards unless the command opened or switched to another file itself. A file that isn't open is
|
||||
an error, and so is a `document` naming a file behind the tab in front on any other method
|
||||
(`ui.screenshot`, `ui.input`, `ui.key`… act on what the window shows).
|
||||
|
||||
## Confining file access
|
||||
|
||||
```sh
|
||||
|
||||
Reference in New Issue
Block a user