mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fixes #666
This commit is contained in:
parent
c4e3bf1a8c
commit
902fe684c0
|
@ -82,7 +82,8 @@ void CompletionModel::refresh(const QString &prefix)
|
|||
if (prefix.length() < 2) return;
|
||||
|
||||
auto addString = [&](const QString &str, TaggedString::Type type) {
|
||||
if (str.startsWith(prefix)) this->items_.emplace(str + " ", type);
|
||||
if (str.startsWith(prefix, Qt::CaseInsensitive))
|
||||
this->items_.emplace(str + " ", type);
|
||||
};
|
||||
|
||||
if (auto channel = dynamic_cast<TwitchChannel *>(&this->channel_)) {
|
||||
|
|
|
@ -85,8 +85,8 @@ UsernameSet::ConstIterator UsernameSet::Range::end()
|
|||
//
|
||||
|
||||
Prefix::Prefix(const QString &string)
|
||||
: first(string.size() >= 1 ? string[0] : '\0')
|
||||
, second(string.size() >= 2 ? string[1] : '\0')
|
||||
: first(string.size() >= 1 ? string[0].toLower() : '\0')
|
||||
, second(string.size() >= 2 ? string[1].toLower() : '\0')
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -101,9 +101,11 @@ bool Prefix::isStartOf(const QString &string) const
|
|||
if (string.size() == 0) {
|
||||
return this->first == QChar('\0') && this->second == QChar('\0');
|
||||
} else if (string.size() == 1) {
|
||||
return this->first == string[0] && this->second == QChar('\0');
|
||||
return this->first == string[0].toLower() &&
|
||||
this->second == QChar('\0');
|
||||
} else {
|
||||
return this->first == string[0] && this->second == string[1];
|
||||
return this->first == string[0].toLower() &&
|
||||
this->second == string[1].toLower();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue