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 (
30
30
)
31
31
32
32
const (
33
- version = "v0.0.13 "
33
+ version = "v0.0.14 "
34
34
)
35
35
36
36
var (
Original file line number Diff line number Diff line change 1
1
document . addEventListener ( "DOMContentLoaded" , function ( ) {
2
2
// Function to get the preferred theme (dark, light, or system default)
3
3
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" ;
7
15
}
8
16
9
17
// Function to set the theme based on the initial color scheme or the 'theme' variable
10
18
function setThemeBasedOnColorScheme ( ) {
11
- const preferredTheme = theme || getPreferredTheme ( ) ;
19
+ const preferredTheme = getPreferredTheme ( ) ;
12
20
console . log ( `Setting theme to '${ preferredTheme } '` ) ;
13
-
14
21
editor . setOption ( "theme" , preferredTheme ) ;
15
22
}
16
-
17
23
// Function to update Vim mode display
18
24
function updateVimMode ( vimEvent , vimModeElement ) {
19
25
const { mode, subMode } = vimEvent ;
You can’t perform that action at this time.
0 commit comments