mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
change around variables names to make things a bit more clear
This commit is contained in:
parent
ab42a30108
commit
ad12a818b2
3 changed files with 6 additions and 8 deletions
|
@ -17,7 +17,7 @@ CompletionModel::CompletionModel(const QString &_channelName)
|
|||
|
||||
void CompletionModel::refresh()
|
||||
{
|
||||
// debug::Log("[CompletionModel:{}] Refreshing...]", this->channelName);
|
||||
debug::Log("[CompletionModel:{}] Refreshing...]", this->channelName);
|
||||
|
||||
auto &emoteManager = singletons::EmoteManager::getInstance();
|
||||
|
||||
|
|
|
@ -99,12 +99,11 @@ void ResizingTextEdit::keyPressEvent(QKeyEvent *event)
|
|||
auto *completionModel =
|
||||
static_cast<chatterino::singletons::CompletionModel *>(this->completer->model());
|
||||
|
||||
if (!this->nextCompletion) {
|
||||
if (!this->completionInProgress) {
|
||||
// First type pressing tab after modifying a message, we refresh our completion model
|
||||
completionModel->refresh();
|
||||
this->completer->setModel(completionModel);
|
||||
// first selection
|
||||
this->completionInProgress = true;
|
||||
this->completer->setCompletionPrefix(currentCompletionPrefix);
|
||||
this->nextCompletion = true;
|
||||
this->completer->complete();
|
||||
return;
|
||||
}
|
||||
|
@ -122,7 +121,7 @@ void ResizingTextEdit::keyPressEvent(QKeyEvent *event)
|
|||
// (hemirt)
|
||||
// this resets the selection in the completion list, it should probably only trigger on actual
|
||||
// chat input (space, character) and not on every key input (pressing alt for example)
|
||||
this->nextCompletion = false;
|
||||
this->completionInProgress = false;
|
||||
|
||||
if (!event->isAccepted()) {
|
||||
QTextEdit::keyPressEvent(event);
|
||||
|
|
|
@ -25,12 +25,11 @@ protected:
|
|||
|
||||
private:
|
||||
QCompleter *completer = nullptr;
|
||||
bool completionInProgress = false;
|
||||
|
||||
// hadSpace is set to true in case the "textUnderCursor" word was after a space
|
||||
QString textUnderCursor(bool *hadSpace = nullptr) const;
|
||||
|
||||
bool nextCompletion = false;
|
||||
|
||||
private slots:
|
||||
void insertCompletion(const QString &completion);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue