Skip to content

Commit

Permalink
Merge pull request #2972 from AndyJinSS/fiex-outline-sync
Browse files Browse the repository at this point in the history
fix(plugin-outline): fix the unsynchronized display of the outline tr…
  • Loading branch information
1ncounter authored Jul 3, 2024
2 parents 9000a87 + cf4675c commit 7ceea19
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/plugin-outline-pane/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export function OutlinePaneContext(props: {
});
}, []);

useEffect(() => {
return props.pluginContext?.project?.currentDocument?.history.onChangeCursor(() => {
setMasterPaneController(new PaneController(props.paneName || MasterPaneName, treeMaster));
});
}, [treeMaster]);
return (
<Pane
treeMaster={treeMaster}
Expand Down Expand Up @@ -77,6 +82,8 @@ export const OutlinePlugin = (ctx: IPublicModelPluginContext, options: any) => {
treeTitleExtra: config.get('treeTitleExtra'),
treeMaster,
paneName: MasterPaneName,
pluginContext: ctx,
options,
},
});

Expand All @@ -91,6 +98,8 @@ export const OutlinePlugin = (ctx: IPublicModelPluginContext, options: any) => {
contentProps: {
paneName: BackupPaneName,
treeMaster,
pluginContext: ctx,
options,
},
index: 1,
});
Expand Down

0 comments on commit 7ceea19

Please sign in to comment.