not sending typing status when working with inline bots

This commit is contained in:
John Preston
2016-01-02 08:58:43 +08:00
parent 4426e2dd78
commit d8b1df875e
5 changed files with 33 additions and 23 deletions
+4 -4
View File
@@ -88,16 +88,16 @@ FlatTextarea::FlatTextarea(QWidget *parent, const style::flatTextarea &st, const
}
}
void FlatTextarea::setTextFast(const QString &text, bool withUndo) {
if (withUndo) {
void FlatTextarea::setTextFast(const QString &text, bool clearUndoHistory) {
if (clearUndoHistory) {
setPlainText(text);
} else {
QTextCursor c(document()->docHandle(), 0);
c.joinPreviousEditBlock();
c.movePosition(QTextCursor::End, QTextCursor::KeepAnchor);
c.insertText(text);
c.movePosition(QTextCursor::End);
c.endEditBlock();
} else {
setPlainText(text);
}
finishPlaceholder();
}