diff --git a/src/chatdocumenthandler.cpp b/src/chatdocumenthandler.cpp index c9a64533a..c33cd9a8a 100644 --- a/src/chatdocumenthandler.cpp +++ b/src/chatdocumenthandler.cpp @@ -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(); }