mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05: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
|
|
}
|