Format .gd files and fix gdformat pre-commit hook

Previously this hook was not being run.
This commit is contained in:
Leroy Hopson 2021-06-19 18:01:08 +07:00
parent 80bcc41855
commit 302bdf0714
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
5 changed files with 32 additions and 16 deletions

View file

@ -39,17 +39,17 @@ func grab_focus():
func _on_Terminal_key_pressed(_data, event: InputEventKey):
if not event:
return
# For some reason, data String is malformed on HTML5, so only use event.unicode.
var data = char(event.unicode)
match event.scancode:
KEY_ENTER:
terminal.write("\r\n")
if line == "q" or line == "quit" or line == "exit":
return emit_signal("exited", 0)
if not _has_js:
var msg := "WebConsole only available in HTML5 build."
push_error(msg)
@ -62,11 +62,11 @@ func _on_Terminal_key_pressed(_data, event: InputEventKey):
_tput.setaf(TPut.ANSIColor.magenta)
terminal.write(str(json))
_tput.sgr0()
line = ""
#_tput.srg0()
prompt("\r\n>> ")
KEY_BACKSPACE:
if line.length() > 0:
terminal.write("\b \b")