From c66d56144520ecabeb7773c6d5885a1dca0903de Mon Sep 17 00:00:00 2001 From: Amolith Date: Tue, 28 Apr 2026 17:15:07 -0600 Subject: [PATCH] usage: mention system: reload command --- internal/server/silverbullet.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/server/silverbullet.md b/internal/server/silverbullet.md index f442c859430ed43a4301705612c28569a02bb0cd..0019c19aea600097742a312e00f4d32cc483954f 100644 --- a/internal/server/silverbullet.md +++ b/internal/server/silverbullet.md @@ -99,6 +99,15 @@ end ``` +## Gotchas + +- `System: Reload` via `editor.invokeCommand` is **asynchronous**: it returns before the reload has actually completed. Any verification that must observe the post-reload runtime state should happen in a separate `execute_lua` call a moment later, not immediately after the reload in the same script. + ```lua + local ok, err = pcall(editor.invokeCommand, "System: Reload") + if not ok then return { reload_ok = false, reload_err = tostring(err) } end + return { reload_ok = true } + ``` + ## Notes - Always `return` values from lua_script because `print()` output is not captured