fix(reader): pass a real per-document id to NativeTextViewWrapper
Every document was using the library's literal "default" documentId — never our own viewModel.documentId — meaning undo stacks, content- divergence snapshots, scroll-offset memory, and pending inline replacements were all keyed to the same slot across every document instead of being scoped per-document. That's a real, unambiguous bug regardless of the click/cursor issue: opening a second document could replay or discard the wrong document's undo history. Investigated the click-does-nothing-in-edit-mode report by reading through the library's (vendored, external — swift-markdown-engine) own isEditable/isSelectable wiring in both makeNSView and updateNSView directly; both looked correctly applied on every pass, and a clean- relaunch test ruled out the settings/NavigationSplitView bug from earlier in this session as the cause. Couldn't confirm this documentId fix resolves the click issue without being able to run the app here — worth retesting either way.
This commit is contained in:
@@ -92,6 +92,7 @@ struct DocumentReaderView: View {
|
|||||||
NativeTextViewWrapper(
|
NativeTextViewWrapper(
|
||||||
text: $viewModel.text,
|
text: $viewModel.text,
|
||||||
configuration: .init(heightBehavior: .fitsContent),
|
configuration: .init(heightBehavior: .fitsContent),
|
||||||
|
documentId: viewModel.documentId,
|
||||||
isEditable: viewModel.isEditing
|
isEditable: viewModel.isEditing
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user