From 0a3e97167cbf85cac0f81ffcbd84c6dea240c03d Mon Sep 17 00:00:00 2001 From: Sebastian Morr Date: Sun, 27 Sep 2020 21:50:14 +0200 Subject: [PATCH] Close completions after running a command --- node.gd | 2 +- sandbox.tscn | 1 - terminal.gd | 6 ++++-- terminal.tscn | 5 ++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/node.gd b/node.gd index 6537d88..7db29c1 100644 --- a/node.gd +++ b/node.gd @@ -113,7 +113,7 @@ func _input(event): if event.is_action_pressed("click"): held = true elif event.is_action_pressed("right_click"): - var input = get_tree().get_current_scene().find_node("Terminal").find_node("Control").find_node("Input") + var input = get_tree().get_current_scene().find_node("Input") input.text += id input.caret_position = input.text.length() if event.is_action_released("click"): diff --git a/sandbox.tscn b/sandbox.tscn index f7e34e5..fe1a1f3 100644 --- a/sandbox.tscn +++ b/sandbox.tscn @@ -40,7 +40,6 @@ anchor_bottom = 0.0 margin_right = 949.0 margin_bottom = 1070.0 size_flags_horizontal = 3 -file_browser_active = false [node name="Terminal" parent="HSplitContainer" instance=ExtResource( 1 )] anchor_right = 0.0 diff --git a/terminal.gd b/terminal.gd index 137ce30..a0026ef 100644 --- a/terminal.gd +++ b/terminal.gd @@ -35,7 +35,8 @@ func _ready(): var all_git_commands = repository.shell.run("git help -a | grep \"^ \\+[a-z-]\\+ \" -o | sed -e 's/^[ \t]*//'") git_commands = Array(all_git_commands.split("\n")) git_commands.pop_back() - print(git_commands) + + completions.hide() func _input(event): if history.size() > 0: @@ -62,6 +63,7 @@ func send_command(command): history_position = history.size() input.editable = false + completions.hide() if thread != null: thread.wait_to_finish() @@ -81,7 +83,7 @@ func run_command_in_a_thread(command): input.text = "" input.editable = true output.text = output.text + "$ " + command + "\n" + o - repository.update_everything() + repository.update_everything() func receive_output(text): output.text += text diff --git a/terminal.tscn b/terminal.tscn index 978f2c3..28ec6dc 100644 --- a/terminal.tscn +++ b/terminal.tscn @@ -40,9 +40,8 @@ margin_bottom = 1045.0 size_flags_vertical = 3 [node name="Output" type="RichTextLabel" parent="VBoxContainer/TopHalf"] -margin_top = 4.0 -margin_right = 1920.0 -margin_bottom = 1045.0 +anchor_right = 1.0 +anchor_bottom = 1.0 size_flags_vertical = 3 custom_styles/normal = SubResource( 1 ) custom_fonts/normal_font = ExtResource( 4 )