mirror of https://github.com/shadowfacts/type.git
Don't allow the cursor to be moved
This commit is contained in:
parent
5d3367ddb4
commit
6fedff4466
13
main.js
13
main.js
|
@ -2,7 +2,13 @@ let editor = new CodeMirror(document.body, {
|
|||
value: "function myScript() {\t\n\treturn 100;\n}",
|
||||
mode: "javascript",
|
||||
readOnly: true,
|
||||
autofocus: true
|
||||
autofocus: true,
|
||||
extraKeys: {
|
||||
Up: () => {},
|
||||
Down: () => {},
|
||||
Left: () => {},
|
||||
Right: () => {}
|
||||
}
|
||||
});
|
||||
|
||||
var incompleteMark = editor.doc.markText({ line: 0, ch: 0 }, getEndPos(), {
|
||||
|
@ -18,6 +24,11 @@ editor.on("blur", (instance, event) => {
|
|||
focused = false;
|
||||
})
|
||||
|
||||
editor.on("mousedown", (instance, event) => {
|
||||
event.preventDefault();
|
||||
editor.focus();
|
||||
});
|
||||
|
||||
let invalids = [];
|
||||
|
||||
document.addEventListener("keypress", (event) => {
|
||||
|
|
Loading…
Reference in New Issue