Skip to content

Commit 7ceea19

Browse files
authored
Merge pull request #2972 from AndyJinSS/fiex-outline-sync
fix(plugin-outline): fix the unsynchronized display of the outline tr…
2 parents 9000a87 + cf4675c commit 7ceea19

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/plugin-outline-pane/src/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ export function OutlinePaneContext(props: {
2727
});
2828
}, []);
2929

30+
useEffect(() => {
31+
return props.pluginContext?.project?.currentDocument?.history.onChangeCursor(() => {
32+
setMasterPaneController(new PaneController(props.paneName || MasterPaneName, treeMaster));
33+
});
34+
}, [treeMaster]);
3035
return (
3136
<Pane
3237
treeMaster={treeMaster}
@@ -77,6 +82,8 @@ export const OutlinePlugin = (ctx: IPublicModelPluginContext, options: any) => {
7782
treeTitleExtra: config.get('treeTitleExtra'),
7883
treeMaster,
7984
paneName: MasterPaneName,
85+
pluginContext: ctx,
86+
options,
8087
},
8188
});
8289

@@ -91,6 +98,8 @@ export const OutlinePlugin = (ctx: IPublicModelPluginContext, options: any) => {
9198
contentProps: {
9299
paneName: BackupPaneName,
93100
treeMaster,
101+
pluginContext: ctx,
102+
options,
94103
},
95104
index: 1,
96105
});

0 commit comments

Comments
 (0)