Skip to content

Instantly share code, notes, and snippets.

@TheApeMachine
Created February 16, 2018 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheApeMachine/8be5c7849330c9ac426fbf20237c6cbc to your computer and use it in GitHub Desktop.
Save TheApeMachine/8be5c7849330c9ac426fbf20237c6cbc to your computer and use it in GitHub Desktop.
# This was my initial code, which sets the cursor before the prompt:
func _input(event):
if Input.is_key_pressed(KEY_ENTER):
insert_text_at_cursor(">")
# And this is how I tried to fix it, which seems to just make a mess of things:
func _input(event):
if Input.is_key_pressed(KEY_ENTER):
insert_text_at_cursor("\n")
current_line += 1
cursor_set_line(current_line)
insert_text_at_cursor(">")
cursor_set_column(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment