fix REPL tab key behaviour

pull/1923/head
Richard Harris 6 years ago
parent bd5ac197c7
commit 519d91a896

2
package-lock.json generated

@ -1,6 +1,6 @@
{ {
"name": "svelte", "name": "svelte",
"version": "3.0.0-alpha6", "version": "3.0.0-alpha12",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

@ -120,7 +120,7 @@
editor.toTextArea(); editor.toTextArea();
} }
editor = CodeMirror.fromTextArea(refs.editor, { const opts = {
lineNumbers, lineNumbers,
lineWrapping: true, lineWrapping: true,
indentWithTabs: true, indentWithTabs: true,
@ -130,12 +130,15 @@
mode: modes[mode] || { mode: modes[mode] || {
name: mode name: mode
}, },
readOnly: readonly, readOnly: readonly
extraKeys: { };
Tab: tab,
'Shift-Tab': tab if (!tab) opts.extraKeys = {
} Tab: tab,
}); 'Shift-Tab': tab
};
editor = CodeMirror.fromTextArea(refs.editor, opts);
editor.on('change', instance => { editor.on('change', instance => {
if (!updating) { if (!updating) {

Loading…
Cancel
Save