mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-02 16:11:55 +00:00
11 lines
218 B
JavaScript
11 lines
218 B
JavaScript
import CodeMirror, { Doc } from 'codemirror'
|
|
|
|
export function init (rootEl) {
|
|
return CodeMirror(rootEl)
|
|
}
|
|
|
|
export function openDoc (cm, content) {
|
|
const newDoc = Doc(content)
|
|
cm.swapDoc(newDoc)
|
|
return newDoc
|
|
}
|