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:
James Graham
2022-05-30 19:17:47 +00:00
committed by Tobias Fella
parent 7214936eaa
commit 29816730e4

View File

@@ -204,6 +204,12 @@ void ChatDocumentHandler::replaceAutoComplete(const QString &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();
cursor.endEditBlock();
}