mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
c85e9ba3b1
This allows for tracking changes on individual docs (i.e. files), instead of just changes to the editor. This is similar to how Ace works with sessions
11 lines
216 B
JavaScript
11 lines
216 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
|
|
}
|