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:
@@ -17,6 +17,7 @@
|
|||||||
- Bugfix: Fixed input in reply thread popup losing focus when dragging. (#4815)
|
- 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 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 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 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 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)
|
- Bugfix: Fixed an issue where reply context didn't render correctly if an emoji was touching text. (#4875)
|
||||||
|
|||||||
@@ -152,10 +152,10 @@ void ResizingTextEdit::keyPressEvent(QKeyEvent *event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString currentCompletionPrefix = this->textUnderCursor();
|
QString currentCompletion = this->textUnderCursor();
|
||||||
|
|
||||||
// check if there is something to complete
|
// check if there is something to complete
|
||||||
if (currentCompletionPrefix.size() <= 1)
|
if (currentCompletion.size() <= 1)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -170,13 +170,12 @@ void ResizingTextEdit::keyPressEvent(QKeyEvent *event)
|
|||||||
// First type pressing tab after modifying a message, we refresh our
|
// First type pressing tab after modifying a message, we refresh our
|
||||||
// completion model
|
// completion model
|
||||||
this->completer_->setModel(completionModel);
|
this->completer_->setModel(completionModel);
|
||||||
completionModel->updateResults(currentCompletionPrefix,
|
completionModel->updateResults(currentCompletion,
|
||||||
this->isFirstWord());
|
this->isFirstWord());
|
||||||
this->completionInProgress_ = true;
|
this->completionInProgress_ = true;
|
||||||
{
|
{
|
||||||
// this blocks cursor movement events from resetting tab completion
|
// this blocks cursor movement events from resetting tab completion
|
||||||
QSignalBlocker dontTriggerCursorMovement(this);
|
QSignalBlocker dontTriggerCursorMovement(this);
|
||||||
this->completer_->setCompletionPrefix(currentCompletionPrefix);
|
|
||||||
this->completer_->complete();
|
this->completer_->complete();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -260,15 +259,6 @@ void ResizingTextEdit::setCompleter(QCompleter *c)
|
|||||||
this->completer_->setCompletionMode(QCompleter::InlineCompletion);
|
this->completer_->setCompletionMode(QCompleter::InlineCompletion);
|
||||||
this->completer_->setCaseSensitivity(Qt::CaseInsensitive);
|
this->completer_->setCaseSensitivity(Qt::CaseInsensitive);
|
||||||
|
|
||||||
if (getSettings()->prefixOnlyEmoteCompletion)
|
|
||||||
{
|
|
||||||
this->completer_->setFilterMode(Qt::MatchStartsWith);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this->completer_->setFilterMode(Qt::MatchContains);
|
|
||||||
}
|
|
||||||
|
|
||||||
QObject::connect(completer_,
|
QObject::connect(completer_,
|
||||||
static_cast<void (QCompleter::*)(const QString &)>(
|
static_cast<void (QCompleter::*)(const QString &)>(
|
||||||
&QCompleter::highlighted),
|
&QCompleter::highlighted),
|
||||||
|
|||||||
Reference in New Issue
Block a user