From a8f52866c2fe3e9d741c12d92e65858794bccb7d Mon Sep 17 00:00:00 2001 From: mtaran-google Date: Mon, 12 Apr 2021 09:57:56 -0700 Subject: [PATCH] [runmode] Export countColumn on the minimal CodeMirror This is needed e.g. for the google-modes to produce correct indentation. --- src/addon/runmode/codemirror-standalone.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/addon/runmode/codemirror-standalone.js b/src/addon/runmode/codemirror-standalone.js index b463a5cf59..f13f32b2f1 100644 --- a/src/addon/runmode/codemirror-standalone.js +++ b/src/addon/runmode/codemirror-standalone.js @@ -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 @@ -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