mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fix: Fix username tab completion without @ (#4853)
This commit is contained in:
parent
467e36767c
commit
4bb196c644
|
@ -27,7 +27,7 @@
|
||||||
- Dev: Refactor `Image` & Image's `Frames`. (#4773)
|
- Dev: Refactor `Image` & Image's `Frames`. (#4773)
|
||||||
- Dev: Add `WindowManager::getLastSelectedWindow()` to replace `getMainWindow()`. (#4816)
|
- Dev: Add `WindowManager::getLastSelectedWindow()` to replace `getMainWindow()`. (#4816)
|
||||||
- Dev: Clarify signal connection lifetimes where applicable. (#4818)
|
- Dev: Clarify signal connection lifetimes where applicable. (#4818)
|
||||||
- Dev: Laid the groundwork for advanced input completion strategies. (#4639, #4846)
|
- Dev: Laid the groundwork for advanced input completion strategies. (#4639, #4846, #4853)
|
||||||
- Dev: Fixed flickering when running with Direct2D on Windows. (#4851)
|
- Dev: Fixed flickering when running with Direct2D on Windows. (#4851)
|
||||||
|
|
||||||
## 2.4.6
|
## 2.4.6
|
||||||
|
|
|
@ -100,7 +100,7 @@ std::unique_ptr<completion::Source> TabCompletionModel::buildSource(
|
||||||
return this->buildEmoteSource();
|
return this->buildEmoteSource();
|
||||||
}
|
}
|
||||||
case SourceKind::User: {
|
case SourceKind::User: {
|
||||||
return this->buildUserSource();
|
return this->buildUserSource(true); // Completing with @
|
||||||
}
|
}
|
||||||
case SourceKind::Command: {
|
case SourceKind::Command: {
|
||||||
return this->buildCommandSource();
|
return this->buildCommandSource();
|
||||||
|
@ -116,7 +116,8 @@ std::unique_ptr<completion::Source> TabCompletionModel::buildSource(
|
||||||
case SourceKind::EmoteUserCommand: {
|
case SourceKind::EmoteUserCommand: {
|
||||||
std::vector<std::unique_ptr<completion::Source>> sources;
|
std::vector<std::unique_ptr<completion::Source>> sources;
|
||||||
sources.push_back(this->buildEmoteSource());
|
sources.push_back(this->buildEmoteSource());
|
||||||
sources.push_back(this->buildUserSource());
|
sources.push_back(
|
||||||
|
this->buildUserSource(false)); // Not completing with @
|
||||||
sources.push_back(this->buildCommandSource());
|
sources.push_back(this->buildCommandSource());
|
||||||
|
|
||||||
return std::make_unique<completion::UnifiedSource>(
|
return std::make_unique<completion::UnifiedSource>(
|
||||||
|
@ -134,10 +135,12 @@ std::unique_ptr<completion::Source> TabCompletionModel::buildEmoteSource() const
|
||||||
std::make_unique<completion::ClassicTabEmoteStrategy>());
|
std::make_unique<completion::ClassicTabEmoteStrategy>());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<completion::Source> TabCompletionModel::buildUserSource() const
|
std::unique_ptr<completion::Source> TabCompletionModel::buildUserSource(
|
||||||
|
bool prependAt) const
|
||||||
{
|
{
|
||||||
return std::make_unique<completion::UserSource>(
|
return std::make_unique<completion::UserSource>(
|
||||||
&this->channel_, std::make_unique<completion::ClassicUserStrategy>());
|
&this->channel_, std::make_unique<completion::ClassicUserStrategy>(),
|
||||||
|
nullptr, prependAt);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<completion::Source> TabCompletionModel::buildCommandSource()
|
std::unique_ptr<completion::Source> TabCompletionModel::buildCommandSource()
|
||||||
|
|
|
@ -31,10 +31,15 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum class SourceKind {
|
enum class SourceKind {
|
||||||
|
// Known to be an emote, i.e. started with :
|
||||||
Emote,
|
Emote,
|
||||||
|
// Known to be a username, i.e. started with @
|
||||||
User,
|
User,
|
||||||
|
// Known to be a command, i.e. started with / or .
|
||||||
Command,
|
Command,
|
||||||
|
// Emote or command without : or / .
|
||||||
EmoteCommand,
|
EmoteCommand,
|
||||||
|
// Emote, user, or command without :, @, / .
|
||||||
EmoteUserCommand
|
EmoteUserCommand
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -54,7 +59,7 @@ private:
|
||||||
std::unique_ptr<completion::Source> buildSource(SourceKind kind) const;
|
std::unique_ptr<completion::Source> buildSource(SourceKind kind) const;
|
||||||
|
|
||||||
std::unique_ptr<completion::Source> buildEmoteSource() const;
|
std::unique_ptr<completion::Source> buildEmoteSource() const;
|
||||||
std::unique_ptr<completion::Source> buildUserSource() const;
|
std::unique_ptr<completion::Source> buildUserSource(bool prependAt) const;
|
||||||
std::unique_ptr<completion::Source> buildCommandSource() const;
|
std::unique_ptr<completion::Source> buildCommandSource() const;
|
||||||
|
|
||||||
Channel &channel_;
|
Channel &channel_;
|
||||||
|
|
Loading…
Reference in a new issue