Completion models are now updated on-demand (whenever user presses Tab)

We might want some dirty-checking here, but for now it's okay
This commit is contained in:
Rasmus Karlsson
2017-12-17 03:06:39 +01:00
parent 266ad36de3
commit 633423640e
3 changed files with 77 additions and 61 deletions
+5
View File
@@ -1,4 +1,5 @@
#include "widgets/helper/resizingtextedit.hpp"
#include "completionmanager.hpp"
ResizingTextEdit::ResizingTextEdit()
{
@@ -86,6 +87,10 @@ void ResizingTextEdit::keyPressEvent(QKeyEvent *event)
return;
}
auto *completionModel =
static_cast<chatterino::CompletionModel *>(this->completer->model());
completionModel->refresh();
if (!this->nextCompletion) {
// first selection
this->completer->setCompletionPrefix(currentCompletionPrefix);