mirror of
https://github.com/friebetill/obsidian-file-diff.git
synced 2026-07-22 07:40:25 +00:00
Improve slighty code
This commit is contained in:
parent
e4fbea864f
commit
02ab435744
2 changed files with 4 additions and 7 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue