Skip to content

Commit 91f3711

Browse files
committed
Make sure mode option is applied even when a pre-initialized doc is given
Closes codemirror#5483
1 parent f301c1c commit 91f3711

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/edit/CodeMirror.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export function CodeMirror(place, options) {
3737

3838
let doc = options.value
3939
if (typeof doc == "string") doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction)
40+
else if (options.mode) doc.modeOption = options.mode
4041
this.doc = doc
4142

4243
let input = new CodeMirror.inputStyles[options.inputStyle](this)

0 commit comments

Comments
 (0)