Add space after an autocomplete
Adds a space automatically after an autocomplete if the last char isn't one. Implements network/neochat#132
This commit is contained in:
committed by
Tobias Fella
parent
7214936eaa
commit
29816730e4
@@ -204,6 +204,12 @@ void ChatDocumentHandler::replaceAutoComplete(const QString &word)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cursor.insertHtml(word);
|
cursor.insertHtml(word);
|
||||||
|
|
||||||
|
// Add space after autocomplete if not already there
|
||||||
|
if (!cursor.block().text().endsWith(QStringLiteral(" "))) {
|
||||||
|
cursor.insertText(QStringLiteral(" "));
|
||||||
|
}
|
||||||
|
|
||||||
m_lastState = cursor.block().text();
|
m_lastState = cursor.block().text();
|
||||||
cursor.endEditBlock();
|
cursor.endEditBlock();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user