mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-11 05:38:34 +00:00
Merge pull request #1117 from tidalcycles/strudelmirror-in-scope
add strudelMirror to scope
This commit is contained in:
commit
65856409b6
@ -345,6 +345,17 @@ export class StrudelMirror {
|
|||||||
clear() {
|
clear() {
|
||||||
this.onStartRepl && document.removeEventListener('start-repl', this.onStartRepl);
|
this.onStartRepl && document.removeEventListener('start-repl', this.onStartRepl);
|
||||||
}
|
}
|
||||||
|
getCursorLocation() {
|
||||||
|
return this.editor.state.selection.main.head;
|
||||||
|
}
|
||||||
|
setCursorLocation(col) {
|
||||||
|
return this.editor.dispatch({ selection: { anchor: col } });
|
||||||
|
}
|
||||||
|
appendCode(code) {
|
||||||
|
const cursor = this.getCursorLocation();
|
||||||
|
this.setCode(this.code + code);
|
||||||
|
this.setCursorLocation(cursor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseBooleans(value) {
|
function parseBooleans(value) {
|
||||||
|
|||||||
@ -114,6 +114,7 @@ export function Repl({ embedded = false }) {
|
|||||||
},
|
},
|
||||||
bgFill: false,
|
bgFill: false,
|
||||||
});
|
});
|
||||||
|
window.strudelMirror = editor;
|
||||||
|
|
||||||
// init settings
|
// init settings
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user