File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ import (
3030)
3131
3232const (
33- version = "v0.0.13 "
33+ version = "v0.0.14 "
3434)
3535
3636var (
Original file line number Diff line number Diff line change 11document . addEventListener ( "DOMContentLoaded" , function ( ) {
22 // Function to get the preferred theme (dark, light, or system default)
33 function getPreferredTheme ( ) {
4- return window . matchMedia ?. ( "(prefers-color-scheme: dark)" ) ?. matches
5- ? "catppuccin"
6- : "default" ;
4+ const prefersDarkMode = window . matchMedia ?. (
5+ "(prefers-color-scheme: dark)" ,
6+ ) ?. matches ;
7+
8+ // If theme is set to "dark" or "auto" and the user prefers dark mode, return "catppuccino"
9+ if ( ( theme === "auto" || theme === "dark" ) && prefersDarkMode ) {
10+ return "catppuccin" ;
11+ }
12+
13+ // For any other case, return "light"
14+ return "light" ;
715 }
816
917 // Function to set the theme based on the initial color scheme or the 'theme' variable
1018 function setThemeBasedOnColorScheme ( ) {
11- const preferredTheme = theme || getPreferredTheme ( ) ;
19+ const preferredTheme = getPreferredTheme ( ) ;
1220 console . log ( `Setting theme to '${ preferredTheme } '` ) ;
13-
1421 editor . setOption ( "theme" , preferredTheme ) ;
1522 }
16-
1723 // Function to update Vim mode display
1824 function updateVimMode ( vimEvent , vimModeElement ) {
1925 const { mode, subMode } = vimEvent ;
You can’t perform that action at this time.
0 commit comments