[mod] highlightWhitespace
This commit is contained in:
parent
55fef63678
commit
be12f0200c
7 changed files with 347 additions and 338 deletions
|
|
@ -2,7 +2,7 @@
|
|||
import { EditorState, StateEffect, Compartment } from '@codemirror/state';
|
||||
|
||||
import {
|
||||
lineNumbers, highlightActiveLineGutter, highlightSpecialChars,
|
||||
lineNumbers, highlightActiveLineGutter, highlightWhitespace,
|
||||
drawSelection, rectangularSelection, crosshairCursor, highlightActiveLine,
|
||||
keymap, dropCursor, EditorView
|
||||
} from '@codemirror/view';
|
||||
|
|
@ -37,12 +37,14 @@ let create = (v) => {
|
|||
const compartment = new Compartment();
|
||||
let curOpts = {
|
||||
lineWrap: true,
|
||||
minimap: true
|
||||
minimap: true,
|
||||
highlightWhitespace: true
|
||||
}
|
||||
// array of extensions reflecting opts
|
||||
function optExts(opts) {
|
||||
let exts = []
|
||||
if (opts.lineWrap) exts.push(EditorView.lineWrapping)
|
||||
if (opts.highlightWhitespace) exts.push(highlightWhitespace())
|
||||
if (opts.minimap) exts.push(
|
||||
showMinimap.compute(['doc'], (state) => {
|
||||
return {
|
||||
|
|
@ -82,7 +84,6 @@ function simpleWebSocketTransport(uri) {
|
|||
const baseExts = [
|
||||
lineNumbers(),
|
||||
highlightActiveLineGutter(),
|
||||
highlightSpecialChars(),
|
||||
history(),
|
||||
foldGutter(),
|
||||
lintGutter(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue