vanilla-repl-cm6: better theme
This commit is contained in:
parent
d96f3f9dd4
commit
d35bf9591c
7 changed files with 237 additions and 8 deletions
|
|
@ -4,13 +4,14 @@ import { defaultKeymap } from '@codemirror/commands';
|
|||
import { syntaxHighlighting, defaultHighlightStyle } from '@codemirror/language';
|
||||
import { javascript } from '@codemirror/lang-javascript';
|
||||
import { StateField, StateEffect } from '@codemirror/state';
|
||||
import './style.css';
|
||||
import { oneDark } from './one-dark';
|
||||
|
||||
// https://codemirror.net/docs/guide/
|
||||
export function initEditor({ initialCode, onChange, onEvaluate, onStop }) {
|
||||
let state = EditorState.create({
|
||||
doc: initialCode,
|
||||
extensions: [
|
||||
oneDark,
|
||||
javascript(),
|
||||
lineNumbers(),
|
||||
highlightField,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue