Merge pull request #1209 from leon-richardt/emote-autocompletion-fix

Fix Emote Completion Bug
This commit is contained in:
pajlada 2019-08-19 00:12:43 +02:00 committed by GitHub
commit c45657da82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -16,6 +16,11 @@ ResizingTextEdit::ResizingTextEdit()
QObject::connect(this, &QTextEdit::textChanged, this, QObject::connect(this, &QTextEdit::textChanged, this,
&QWidget::updateGeometry); &QWidget::updateGeometry);
// Whenever the setting for emote completion changes, force a
// refresh on the completion model the next time "Tab" is pressed
getSettings()->prefixOnlyEmoteCompletion.connect(
[this] { this->completionInProgress_ = false; });
this->setFocusPolicy(Qt::ClickFocus); this->setFocusPolicy(Qt::ClickFocus);
} }

View file

@ -283,7 +283,9 @@ void GeneralPage::initLayout(SettingsLayout &layout)
{"Don't show", "Always show", "Hold shift"}, s.emotesTooltipPreview, {"Don't show", "Always show", "Hold shift"}, s.emotesTooltipPreview,
[](int index) { return index; }, [](auto args) { return args.index; }, [](int index) { return index; }, [](auto args) { return args.index; },
false); false);
layout.addCheckbox("Only search for emote autocompletion at the start of emote names",
layout.addCheckbox(
"Only search for emote autocompletion at the start of emote names",
s.prefixOnlyEmoteCompletion); s.prefixOnlyEmoteCompletion);
layout.addSpacing(16); layout.addSpacing(16);