Last active
November 3, 2015 15:00
-
-
Save alexbaumgertner/9a252f45c5f9151674ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // api: fromTextArea | |
| // https://github.com/codemirror/CodeMirror/blob/a11ccbefa281a0e728b7431ba52f550854831ea6/lib/codemirror.js#L5888 | |
| var editor = targetIsTextarea ? CodeMirror.fromTextArea(target, editorOptions) : target; | |
| // api: setCursor | |
| // https://github.com/codemirror/CodeMirror/blob/a11ccbefa281a0e728b7431ba52f550854831ea6/lib/codemirror.js#L7438 | |
| // api: posFromIndex | |
| // https://github.com/codemirror/CodeMirror/blob/a11ccbefa281a0e728b7431ba52f550854831ea6/lib/codemirror.js#L7624 | |
| editor.setCursor(editor.posFromIndex(initialPos)); | |
| // api: getWrapperElement | |
| // https://github.com/codemirror/CodeMirror/blob/master/lib/codemirror.js#L5318 | |
| var wrapper = editor.getWrapperElement(); | |
| // api: https://github.com/codemirror/CodeMirror/blob/master/lib/codemirror.js#L5138 | |
| editor.execCommand('revert'); | |
| // api: https://github.com/codemirror/CodeMirror/blob/master/lib/codemirror.js#L1372 | |
| editor.focus(); | |
| // api: https://github.com/codemirror/CodeMirror/blob/master/lib/codemirror.js#L2184 | |
| editor.setSelection(curPos, curPos); | |
| // api: https://github.com/codemirror/CodeMirror/blob/master/lib/codemirror.js#L7624 | |
| return posObj(editor.posFromIndex(pos)); | |
| // api: https://github.com/codemirror/CodeMirror/blob/master/lib/codemirror.js#L2817 | |
| return sanitizeCaretPos(editor.cursorCoords(true)); | |
| // api: https://github.com/codemirror/CodeMirror/blob/master/lib/codemirror.js#L2809 | |
| return sanitizeCaretPos(editor.charCoords(pos)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment