fix: Don't use QCompleter prefix filter (#4855)

* Invalidate tab completion model when settings change

* Remove true culprit

* Update CHANGELOG.md

* Remove QCompleter setFilterMode call

---------

Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com>
This commit is contained in:
Daniel Sage 2023-10-13 05:22:48 -04:00 committed by GitHub
parent 63b53656b1
commit 653a14c76b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 13 deletions

View file

@ -17,6 +17,7 @@
- Bugfix: Fixed input in reply thread popup losing focus when dragging. (#4815)
- Bugfix: Fixed the Quick Switcher (CTRL+K) from sometimes showing up on the wrong window. (#4819)
- Bugfix: Fixed too much text being copied when copying chat messages. (#4812, #4830, #4839)
- Bugfix: Fixed an issue where the setting `Only search for emote autocompletion at the start of emote names` wouldn't disable if it was enabled when the client started. (#4855)
- Bugfix: Fixed empty page being added when showing out of bounds dialog. (#4849)
- Bugfix: Fixed issue on Windows preventing the title bar from being dragged in the top left corner. (#4873)
- Bugfix: Fixed an issue where reply context didn't render correctly if an emoji was touching text. (#4875)

View file

@ -152,10 +152,10 @@ void ResizingTextEdit::keyPressEvent(QKeyEvent *event)
return;
}
QString currentCompletionPrefix = this->textUnderCursor();
QString currentCompletion = this->textUnderCursor();
// check if there is something to complete
if (currentCompletionPrefix.size() <= 1)
if (currentCompletion.size() <= 1)
{
return;
}
@ -170,13 +170,12 @@ void ResizingTextEdit::keyPressEvent(QKeyEvent *event)
// First type pressing tab after modifying a message, we refresh our
// completion model
this->completer_->setModel(completionModel);
completionModel->updateResults(currentCompletionPrefix,
completionModel->updateResults(currentCompletion,
this->isFirstWord());
this->completionInProgress_ = true;
{
// this blocks cursor movement events from resetting tab completion
QSignalBlocker dontTriggerCursorMovement(this);
this->completer_->setCompletionPrefix(currentCompletionPrefix);
this->completer_->complete();
}
return;
@ -260,15 +259,6 @@ void ResizingTextEdit::setCompleter(QCompleter *c)
this->completer_->setCompletionMode(QCompleter::InlineCompletion);
this->completer_->setCaseSensitivity(Qt::CaseInsensitive);
if (getSettings()->prefixOnlyEmoteCompletion)
{
this->completer_->setFilterMode(Qt::MatchStartsWith);
}
else
{
this->completer_->setFilterMode(Qt::MatchContains);
}
QObject::connect(completer_,
static_cast<void (QCompleter::*)(const QString &)>(
&QCompleter::highlighted),