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

fix: Commands now completable when not starting with / #4846

Merged
merged 3 commits into from
Sep 30, 2023

Conversation

dnsge
Copy link
Contributor

@dnsge dnsge commented Sep 29, 2023

Description

Fixes a regression introduced in #4639. When we can't determine the kind of item being tab-completed, we now consider emotes, usernames, and commands.

Fixes #4842

Truthfully I didn't even know you could create a command without a slash 😅

Implementation

This fix was a bit more complicated than I had expected due to the userCompletionOnlyWithAt setting. When we can't deduce the kind of item being completed, depending on this setting, we either:

  1. Complete emotes, usernames, and commands (setting disabled)
  2. Complete emotes and commands (setting enabled)

To reduce code duplication, I modified UnifiedSource to accept a vector of sources to combine instead of being hardcoded to just combine emotes and usernames.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@pajlada pajlada enabled auto-merge (squash) September 30, 2023 10:24
@pajlada pajlada merged commit 4d8b623 into Chatterino:master Sep 30, 2023
17 checks passed
@dnsge dnsge deleted the fix/complete-commands-without-slash branch September 30, 2023 16:07
Felanbird added a commit to Felanbird/chatterino2 that referenced this pull request Oct 9, 2023
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.

Command tab completion no longer works when a command does not start with /
2 participants