-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
Add Command Line Tab Complete blacklist #6509
Conversation
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
Thanks for your interesting suggestion! |
…ab complete was initially built, still adding the blacklist and with the open possibility to add a config option to remove the buffer autoadd
A quick update - because 4.17 was delayed, the feature freeze was reset and this improvement will make it into 4.17 should it all work well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I think the fact that this only works local to a single command line is not what is wanted - I'd move this (and someone will have to do the other (QSet<QString> TCommandLine::commandLineSuggestions
) to the TMainConsole
and get the getters/setters work on that...
@@ -121,6 +124,8 @@ public slots: | |||
char** mpSystemSuggestionsList = nullptr; | |||
char** mpUserSuggestionsList = nullptr; | |||
QSet<QString> commandLineSuggestions; | |||
QSet<QString> tabCompleteBlacklist; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unneeded as well. 😉
void TCommandLine::addBlacklist(const QString& word) | ||
{ | ||
tabCompleteBlacklist += word; | ||
} | ||
|
||
void TCommandLine::removeBlacklist(const QString& word) | ||
{ | ||
tabCompleteBlacklist.remove(word); | ||
} | ||
|
||
void TCommandLine::clearBlacklist() | ||
{ | ||
tabCompleteBlacklist.clear(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See other Note A.
QSet<QString> commandLineSuggestions; | ||
QSet<QString> tabCompleteBlacklist; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note A
I don't know if the coder of the commandLineSuggestions
considered this, but it also applies to tabCompleteBlacklist
in that this is local to THIS TCommandLine
instance so if the user has any additional command lines set up for their game then these things are going to be independent for each command line - which is probably NOT what is wanted. TBH If I was using this I might even have a separate "command lines" put aside to enter the names of friends and foes in.
As a separate coding note these are also public
so having dedicated getters and setters introduces pointless calling overheads - the callers could just as easily call the Qt methods in those methods directly.
@SlySven I think it is actually desired that it only works on a single command line. Just because you don't want certain words to be used for auto-completion in the main command line, it doesn't mean that all command lines in a profile should not autocomplete it too. It would be nice if you could make this list be per-command line as well but lets wait if there's player interest in it. |
Well as written it is - let's ask @CorTheWin which they intended? |
Co-authored-by: Stephen Lyons <slysven@virginmedia.com>
Brief overview of PR changes/additions
This changes adds Add/Remove/ClearCmdLineBlacklist which allows a user to blacklist any words from being used in Tab complete.
Motivation for adding to Mudlet
allow for slightly more customized tab completion filtering for words/names in middle of fights. Ex: Allows you to blacklist allied names with similar spellings to enemies names on tab complete.
Other info (issues closed, discussion etc)
none known