Skip to content

Commit

Permalink
[runmode] Export countColumn on the minimal CodeMirror
Browse files Browse the repository at this point in the history
This is needed e.g. for the google-modes to produce correct indentation.
  • Loading branch information
mtaran-google authored and marijnh committed Apr 13, 2021
1 parent 123c670 commit a8f5286
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/addon/runmode/codemirror-standalone.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import StringStream from "../../util/StringStream.js"
import { countColumn } from "../../util/misc.js"
import * as modeMethods from "../../modes.js"

// declare global: globalThis, CodeMirror
Expand All @@ -17,6 +18,7 @@ CodeMirror.defineMIME("text/plain", "null")

CodeMirror.registerHelper = CodeMirror.registerGlobalHelper = Math.min
CodeMirror.splitLines = function(string) { return string.split(/\r?\n|\r/) }
CodeMirror.countColumn = countColumn

CodeMirror.defaults = { indentUnit: 2 }
export default CodeMirror

0 comments on commit a8f5286

Please sign in to comment.