Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 28 additions & 7 deletions src/editor/lineAuthor/lineAuthorIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,34 @@ export class LineAuthoringFeature {
}

private destroyEventHandlers() {
this.plg.app.workspace.offref(this.gutterContextMenuEvent!);
this.plg.app.workspace.offref(this.refreshOnCssChangeEvent!);
this.plg.app.workspace.offref(this.fileOpenEvent!);
this.plg.app.workspace.offref(this.workspaceLeafChangeEvent!);
this.plg.app.vault.offref(this.fileModificationEvent!);
this.plg.app.workspace.offref(this.headChangeEvent!);
this.plg.app.vault.offref(this.fileRenameEvent!);
if (this.gutterContextMenuEvent) {
this.plg.app.workspace.offref(this.gutterContextMenuEvent);
this.gutterContextMenuEvent = undefined;
}
if (this.refreshOnCssChangeEvent) {
this.plg.app.workspace.offref(this.refreshOnCssChangeEvent);
this.refreshOnCssChangeEvent = undefined;
}
if (this.fileOpenEvent) {
this.plg.app.workspace.offref(this.fileOpenEvent);
this.fileOpenEvent = undefined;
}
if (this.workspaceLeafChangeEvent) {
this.plg.app.workspace.offref(this.workspaceLeafChangeEvent);
this.workspaceLeafChangeEvent = undefined;
}
if (this.fileModificationEvent) {
this.plg.app.vault.offref(this.fileModificationEvent);
this.fileModificationEvent = undefined;
}
if (this.headChangeEvent) {
this.plg.app.workspace.offref(this.headChangeEvent);
this.headChangeEvent = undefined;
}
if (this.fileRenameEvent) {
this.plg.app.vault.offref(this.fileRenameEvent);
this.fileRenameEvent = undefined;
}
}

private handleWorkspaceLeaf = (leaf: WorkspaceLeaf) => {
Expand Down
22 changes: 16 additions & 6 deletions src/editor/signs/signsIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export class SignsFeature {
private fileRenameEvent?: EventRef;
private intervalRefreshEvent?: number;
private pluginRefreshedEvent?: EventRef;
private gutterContextMenuEvent?: EventRef;
private codeMirrorExtensions: Extension[] = [];
public changeStatusBar?: ChangesStatusBar;

Expand Down Expand Up @@ -143,11 +142,22 @@ export class SignsFeature {
}

private destroyEventHandlers() {
this.plg.app.workspace.offref(this.workspaceLeafChangeEvent!);
this.plg.app.vault.offref(this.fileRenameEvent!);
this.plg.app.workspace.offref(this.pluginRefreshedEvent!);
this.plg.app.workspace.offref(this.gutterContextMenuEvent!);
window.clearInterval(this.intervalRefreshEvent);
if (this.workspaceLeafChangeEvent) {
this.plg.app.workspace.offref(this.workspaceLeafChangeEvent);
this.workspaceLeafChangeEvent = undefined;
}
if (this.fileRenameEvent) {
this.plg.app.vault.offref(this.fileRenameEvent);
this.fileRenameEvent = undefined;
}
if (this.pluginRefreshedEvent) {
this.plg.app.workspace.offref(this.pluginRefreshedEvent);
this.pluginRefreshedEvent = undefined;
}
if (this.intervalRefreshEvent !== undefined) {
window.clearInterval(this.intervalRefreshEvent);
this.intervalRefreshEvent = undefined;
}
}

private handleWorkspaceLeaf = (leaf: WorkspaceLeaf) => {
Expand Down