feat: add Tab autocomplete for slash commands in chat input

Pressing Tab while typing a slash command cycles through all matching
commands (e.g. /em<Tab> → /emote, /emote<Tab> → /emote again).
Unambiguous matches append a trailing space. Repeated Tab presses
cycle forward through all matches. History navigation (Up/Down)
resets the autocomplete session.
This commit is contained in:
Kelsi 2026-03-12 06:38:10 -07:00
parent 68251b647d
commit c14b338a92
2 changed files with 69 additions and 1 deletions

View file

@ -54,6 +54,11 @@ private:
std::vector<std::string> chatSentHistory_;
int chatHistoryIdx_ = -1; // -1 = not browsing history
// Tab-completion state for slash commands
std::string chatTabPrefix_; // prefix captured on first Tab press
std::vector<std::string> chatTabMatches_; // matching command list
int chatTabMatchIdx_ = -1; // active match index (-1 = inactive)
// Chat tabs
int activeChatTab_ = 0;
struct ChatTab {