Commit c6f822d 1 parent 0ccae73 commit c6f822d Copy full SHA for c6f822d
File tree 1 file changed +6
-1
lines changed
packages/shikiji-core/src
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ export async function getShikiInternal(options: HighlighterCoreOptions = {}): Pr
47
47
Object . assign ( _registry . alias , options . langAlias )
48
48
await _registry . init ( )
49
49
50
+ let _lastTheme : string | ThemeRegistrationResolved
51
+
50
52
function getLangGrammar ( name : string ) {
51
53
const _lang = _registry . getGrammar ( name )
52
54
if ( ! _lang )
@@ -63,7 +65,10 @@ export async function getShikiInternal(options: HighlighterCoreOptions = {}): Pr
63
65
64
66
function setTheme ( name : string | ThemeRegistrationResolved ) {
65
67
const theme = getTheme ( name )
66
- _registry . setTheme ( theme )
68
+ if ( _lastTheme !== name ) {
69
+ _registry . setTheme ( theme )
70
+ _lastTheme = name
71
+ }
67
72
const colorMap = _registry . getColorMap ( )
68
73
return {
69
74
theme,
You can’t perform that action at this time.
0 commit comments