Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow console command and level filename autocomplete from 1 character #321

Merged
merged 4 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Version 1.9.0 (not released yet)
- Add mod name to main menu
- Make value of `spectate_mode_minimal_ui` persist between game launches
- Add `version` command
- Support autocompleting of level filenames and console commands from only 1 character

[@is-this-c](https://github.com/is-this-c)
- Support `©` in TrueType fonts
Expand Down
4 changes: 2 additions & 2 deletions game_patch/os/autocomplete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void console_auto_complete_level(int offset)
{
std::string level_name;
console_auto_complete_get_component(offset, level_name);
if (level_name.size() < 3)
if (level_name.empty())
return;

bool first = true;
Expand Down Expand Up @@ -144,7 +144,7 @@ void console_auto_complete_command(int offset)
{
std::string cmd_name;
int next_offset = console_auto_complete_get_component(offset, cmd_name);
if (cmd_name.size() < 2)
if (cmd_name.empty())
return;

bool first = true;
Expand Down