@@ -276,6 +276,15 @@ const extractVSCodeTheme = (content: string): ThemeName | null => {
276276}
277277
278278const extractJetBrainsTheme = ( content : string ) : ThemeName | null => {
279+ // Check if autodetect is enabled (Sync with OS setting)
280+ const autodetectMatch = content . match (
281+ / < c o m p o n e n t [ ^ > ] + n a m e = " L a f M a n a g e r " [ ^ > ] + a u t o d e t e c t = " ( t r u e | f a l s e ) " / i,
282+ )
283+ if ( autodetectMatch ?. [ 1 ] ?. toLowerCase ( ) === 'true' ) {
284+ // When syncing with OS, return null to trigger platform detection
285+ return null
286+ }
287+
279288 const normalized = content . toLowerCase ( )
280289 if ( normalized . includes ( 'darcula' ) || normalized . includes ( 'dark' ) ) {
281290 return 'dark'
@@ -371,6 +380,15 @@ const detectJetBrainsTheme = (): ThemeName | null => {
371380 if ( theme ) {
372381 return theme
373382 }
383+
384+ // If extractJetBrainsTheme returned null, check if autodetect is enabled
385+ // and fall back to platform detection
386+ const autodetectMatch = content . match (
387+ / < c o m p o n e n t [ ^ > ] + n a m e = " L a f M a n a g e r " [ ^ > ] + a u t o d e t e c t = " ( t r u e | f a l s e ) " / i,
388+ )
389+ if ( autodetectMatch ?. [ 1 ] ?. toLowerCase ( ) === 'true' ) {
390+ return detectPlatformTheme ( )
391+ }
374392 }
375393
376394 return null
@@ -390,6 +408,10 @@ const extractZedTheme = (content: string): ThemeName | null => {
390408 const modeRaw = themeConfig . mode
391409 if ( typeof modeRaw === 'string' ) {
392410 const mode = modeRaw . toLowerCase ( )
411+ // If mode is 'system', return null to trigger platform detection
412+ if ( mode === 'system' ) {
413+ return null
414+ }
393415 if ( mode === 'dark' || mode === 'light' ) {
394416 candidates . push ( mode )
395417 const modeTheme = themeConfig [ mode ]
0 commit comments