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

Refactor Tab completion for Twitch commands #3144

Merged
merged 12 commits into from Dec 26, 2021

Conversation

zneix
Copy link
Collaborator

@zneix zneix commented Aug 7, 2021

Pull request checklist:

  • CHANGELOG.md was updated, if applicable

Description

Refactored the way autocompletion works for Twitch commands. These are now less "hardcoded", as they no longer include / in the command name. As the additional result, Tab autocompletion for commands starting with a dot was also added.

  • Added autocompletion for default Twitch commands starting with the dot. The only change that is visible to end users.
  • Added /delete Twitch command to the list of commands while moving it to TwitchCommon.cpp
  • Added a helper function wrapping QString::{startsWith,contains} methods, so duplication in addString inside of CompletionModel.cpp has been removed
  • Separate default Chatterino commands from default Twitch commands inside CommandController.cpp
  • Add separate types in TaggedString for all different types of commands (custom Chatterino commands, default Chatterino commands, default Twitch commands)
  • Moved twitchDefaultCommands and whisperCommands to TwitchCommon.cpp
  • TWITCH_DEFAULT_COMMANDS were stripped off leading slash. Instead, we just check for either a slash or a dot inside of CompletionModel.cpp (see first dash). That's been done to make it possible to autocomplete Twitch commands starting with a dot
  • Renamed a public member of CommandController (items_ -> items)

Related to/Extends #2999

- Added autocompletion for default Twitch commands starting with the '.'
- Added a helper function wrapping QString::{startsWith,contains} methods, so no duplication in addString inside of CompletionModel.cpp has been removed
- Separate default Chatterino commands from default Twitch commands
- Add separate types in TaggedString for all different types of commands (custom Chatterino commands, default Chatterino commands, default
   Twitch commands)
- Moved twitchDefaultCommands and whisperCommands to TwitchCommon.cpp
- TWITCH_DEFAULT_COMMANDS were stripped off leading slash. Instead, we just check for either a slash or a dot inside of CompletionModel.cpp (see first dash). That's been done to make it possible to autocomplete Twitch commands starting with a dot
Only private class members should have their names end with an underscore
@zneix zneix requested review from Mm2PL and pajlada August 7, 2021 18:46
@zneix zneix changed the title Little refactor of command tab completion Tab completion for Twitch commands starting with a dot Aug 14, 2021
@zneix zneix closed this Oct 12, 2021
@zneix zneix reopened this Oct 16, 2021
@zneix zneix changed the title Tab completion for Twitch commands starting with a dot Refactor Tab completion for Twitch commands Dec 13, 2021
@pajlada pajlada merged commit 1682f0f into master Dec 26, 2021
@pajlada pajlada deleted the zneix/chore/refactor-tab-command-completion branch December 26, 2021 13:21
zneix added a commit to SevenTV/chatterino7 that referenced this pull request Dec 26, 2021
Now we're on commit f64047d; Changes from upstream we've pulled

- Minor: Added clear button to settings search bar. (Chatterino#3403)
- Minor: Added autocompletion for default Twitch commands starting with the dot (e.g. `.mods` which does the same as `/mods`). (Chatterino#3144)
- Bugfix: Fixed character counter changing fonts after going over the limit. (Chatterino#3422)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants