Improve slighty code

This commit is contained in:
friebetill 2023-02-02 18:25:10 +08:00
parent e4fbea864f
commit 02ab435744
2 changed files with 4 additions and 7 deletions

View file

@ -2,7 +2,6 @@ import { TFile } from "obsidian";
import { Difference } from "./data/difference";
import { replaceLine } from "./utils/string_utils";
// typedef for a voidcallback
type VoidCallback = () => void;
export class ActionLine {

View file

@ -39,7 +39,7 @@ export class DifferencesView extends ItemView {
this.file1.path,
this.file2.path,
file1Content,
file2Content,
file2Content
)
);
@ -83,11 +83,13 @@ export class DifferencesView extends ItemView {
container: HTMLDivElement,
difference: Difference
) {
const triggerRebuild = () => this.onOpen();
new ActionLine(
difference,
this.file1,
this.file2,
this.triggerRebuild
triggerRebuild
).build(container);
difference.lines.forEach((line) => {
@ -106,8 +108,4 @@ export class DifferencesView extends ItemView {
}
});
}
private triggerRebuild() {
this.onOpen();
}
}