bevy-console
bevy-console copied to clipboard
add tab-autocompletion, clear line with ctrl+c, fix minor bug
- Pressing tab completes the rest of the command. Continuing to press tab cycles through other potential completions.
e.g. typing
he
and pressing tab results inhelp
. If there's another command calledheat
, pressing tab again could result inheat
. - Via a new ConsoleConfiguration field, users can manually add autocompletion for command arguments.
e.g. after setting up the config, you could type
set_color tur
and pressing tab results inset_color turquoise
- Pressing Ctrl + C clears the current line
- Fix the bug where an "L" is printed onto the console line when clearing the console history with Ctrl + L
The autocompletion code is functional but a bit verbose and messy. It annoyingly doesn't move the text cursor to the end of the line after autocompleting, I wasn't sure how to fix that, but it didn't bother me enough to try to figure it out.
I don't use github often so I'm unfamiliar with pull request etiquette, sorry if I put too many changes into a single pull request. I can try to make multiple pull requests for the individual changes if needed.