plugin: announce DocumentOpened once per load, not per tab switch

The guard remembered only the last announced (tab, generation), so
switching A -> B -> A announced A's load again. Each tab now carries
its own pending flag, set when a document is installed and cleared by
the boundary dispatch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-14 23:49:17 +03:00
1 parent 68330ce39e
commit 4d66a58374
7 files changed
+28 -51

No files matched your search

+2 -2
View File
@@ -466,8 +466,8 @@ impl OpenCADStudio {
self.tabs[i].current_path = None;
self.tabs[i].is_start = false;
self.tabs[i].dirty = true;
// A whole document just became resident in the tab (API v9): mint a
// fresh generation so the boundary announces `DocumentOpened` once.
// A whole document just became resident in the tab (API v9): the
// boundary announces `DocumentOpened` once.
self.tabs[i].note_document_loaded();
Ok(purged)
}