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
2 changed files with 4 additions and 13 deletions
+3 -13
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),