Skip to content

Commit ba913b7

Browse files
daiyamRokt33r
authored andcommitted
use constants and fix cursor color
1 parent 6012fc9 commit ba913b7

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

browser/lib/consts.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ const fs = require('sander')
33
const { remote } = require('electron')
44
const { app } = remote
55

6+
const CODEMIRROR_THEME_PATH = 'node_modules/codemirror/theme'
7+
const CODEMIRROR_EXTRA_THEME_PATH = 'extra_scripts/codemirror/theme'
8+
69
const isProduction = process.env.NODE_ENV === 'production'
710
const paths = [
8-
isProduction ? path.join(app.getAppPath(), './node_modules/codemirror/theme') : path.resolve('./node_modules/codemirror/theme'),
9-
isProduction ? path.join(app.getAppPath(), './extra_scripts/codemirror/theme') : path.resolve('./extra_scripts/codemirror/theme')
11+
isProduction ? path.join(app.getAppPath(), CODEMIRROR_THEME_PATH) : path.resolve(CODEMIRROR_THEME_PATH),
12+
isProduction ? path.join(app.getAppPath(), CODEMIRROR_EXTRA_THEME_PATH) : path.resolve(CODEMIRROR_EXTRA_THEME_PATH)
1013
]
1114

1215
const themes = paths
@@ -24,17 +27,17 @@ const themes = paths
2427

2528
themes.splice(themes.findIndex(({ name }) => name === 'solarized'), 1, {
2629
name: 'solarized dark',
27-
path: 'node_modules/codemirror/theme/solarized.css',
30+
path: `${CODEMIRROR_THEME_PATH}/solarized.css`,
2831
className: `cm-s-solarized cm-s-dark`
2932
}, {
3033
name: 'solarized light',
31-
path: 'node_modules/codemirror/theme/solarized.css',
34+
path: `${CODEMIRROR_THEME_PATH}/solarized.css`,
3235
className: `cm-s-solarized cm-s-light`
3336
})
3437

3538
themes.splice(0, 0, {
3639
name: 'default',
37-
path: '/node_modules/codemirror/theme/elegant.css',
40+
path: `${CODEMIRROR_THEME_PATH}/elegant.css`,
3841
className: `cm-s-default`
3942
})
4043

extra_scripts/codemirror/theme/nord.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
.cm-s-nord.CodeMirror { color: #d8dee9; }
44
.cm-s-nord.CodeMirror { background: #2e3440; }
5-
.cm-s-nord .CodeMirror-cursor { color: #d8dee9; }
5+
.cm-s-nord .CodeMirror-cursor { color: #d8dee9; border-color: #d8dee9; }
66
.cm-s-nord .CodeMirror-activeline-background { background: #434c5e52 !important; }
77
.cm-s-nord .CodeMirror-selected { background: undefined; }
88
.cm-s-nord .cm-comment { color: #4c566a; }

0 commit comments

Comments
 (0)