package.src.addon.runmode.codemirror.node.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codemirror Show documentation
Show all versions of codemirror Show documentation
Basic configuration for the CodeMirror code editor
The newest version!
import StringStream from "../../util/StringStream.js"
import * as modeMethods from "../../modes.js"
import {countColumn} from "../../util/misc.js"
// Copy StringStream and mode methods into exports (CodeMirror) object.
exports.StringStream = StringStream
exports.countColumn = countColumn
for (var exported in modeMethods) exports[exported] = modeMethods[exported]
// Shim library CodeMirror with the minimal CodeMirror defined above.
require.cache[require.resolve("../../lib/codemirror")] = require.cache[require.resolve("./runmode.node")]
require.cache[require.resolve("../../addon/runmode/runmode")] = require.cache[require.resolve("./runmode.node")]
// Minimal default mode.
exports.defineMode("null", () => ({token: stream => stream.skipToEnd()}))
exports.defineMIME("text/plain", "null")
exports.registerHelper = exports.registerGlobalHelper = Math.min
exports.splitLines = function(string) { return string.split(/\r?\n|\r/) }
exports.defaults = { indentUnit: 2 }
© 2015 - 2025 Weber Informatics LLC | Privacy Policy