added exit shortcut for codemirror

This commit is contained in:
Leon van Kammen 2024-12-17 16:05:03 +01:00
parent ef60a24535
commit f69653a0a9
3 changed files with 6 additions and 0 deletions

View File

@ -5,3 +5,4 @@ me="$(dirname $(readlink -f $0))"
file="$(readlink -f "$1")" file="$(readlink -f "$1")"
$me/codemirror.js "$file" $me/codemirror.js "$file"
echo "press ctrl-X to exit editor"

View File

@ -87,6 +87,11 @@ AFRAME.registerComponent('codemirror', {
} }
}) })
this.editor.setOption("theme", "shadowfox") this.editor.setOption("theme", "shadowfox")
this.editor.setOption("extraKeys", {
"Ctrl-X": (cm) => {
this.el.emit('close',true) // window.js will react accordingly
}
})
this.editor.updateFile = AFRAME.utils.throttle( (file,str) => { this.editor.updateFile = AFRAME.utils.throttle( (file,str) => {
this.updateFile(file,str) this.updateFile(file,str)
}, 1500) }, 1500)

BIN
dist/v86-linux.iso vendored

Binary file not shown.