Skip to content

Commit cbdac4c

Browse files
update
1 parent 514a354 commit cbdac4c

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

packages/core/src/diff-file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ export class DiffFile {
13111311
}
13121312

13131313
if (__DEV__ && !data.hasInitRaw) {
1314-
console.error(`there are not a valid bundle data to merge, try to call 'initRaw' function before merge`);
1314+
console.error(`there are not a valid bundle data, try to call 'initRaw' function before merge / getBundle`);
13151315
}
13161316

13171317
if (notifyUpdate) {

packages/react/src/components/DiffView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ const _InternalDiffView = <T extends unknown>(props: Omit<DiffViewProps<T>, "dat
147147
useEffect(() => {
148148
const cb = diffFile.subscribe(() => {
149149
wrapperRef.current?.setAttribute("data-theme", diffFile._getTheme() || "light");
150+
wrapperRef.current?.setAttribute("data-highlighter", diffFile._getHighlighterName());
150151
});
151152

152153
return cb;

packages/vue/src/components/DiffView.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,12 @@ export const DiffView = defineComponent<
159159
instance.notifyAll();
160160
};
161161

162-
const initTheme = (onClean: (cb: () => void) => void) => {
162+
const initAttribute = (onClean: (cb: () => void) => void) => {
163163
if (!isMounted.value || !diffFile.value || !wrapperRef.value) return;
164164
const instance = diffFile.value;
165165
const cb = instance.subscribe(() => {
166166
wrapperRef.value?.setAttribute("data-theme", instance._getTheme() || "light");
167+
wrapperRef.value?.setAttribute("data-highlighter", instance._getHighlighterName());
167168
});
168169
onClean(() => cb());
169170
};
@@ -183,7 +184,7 @@ export const DiffView = defineComponent<
183184

184185
watchEffect((onClean) => initId(onClean));
185186

186-
watchEffect((onClean) => initTheme(onClean));
187+
watchEffect((onClean) => initAttribute(onClean));
187188

188189
provide(idSymbol, id);
189190

packages/vue/src/hooks/useSyncHeight.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ export const useSyncHeight = ({
7070
});
7171

7272
onCancel(() => {
73-
clearTimeout(timer);
7473
clean();
74+
clearTimeout(timer);
7575
})
7676
}
7777
};

0 commit comments

Comments
 (0)