codemirror-typewriter-scrolling
CodeMirror addon adding typwritter scrolling feature
- Typewriter Scrolling keeps the view centered on the editor.
Installation
npm install codemirror-typewriter-scrolling
Usage
typewriterScrolling
option
You can set typewriterScrolling
to option.
var editor = CodeMirror.fromTextArea(document.getElementById("editor"), {
lineNumbers: true,
mode: "markdown",
typewriterScrolling: true // setOption
});
// empty line
editor.setValue((new Array(100)).join("\n"));
scrollSelectionToCenter
command
You can use scrollSelectionToCenter
command.
editor.execCommand("scrollSelectionToCenter");
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
License
MIT