Commit 0fed004a authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Fixed the {begin,end}EndBlock to be used when inserting autotext

Based on a change by Denis Dzyubenko, done with mae.
parent b7651241
......@@ -1066,7 +1066,9 @@ void BaseTextEditor::keyPressEvent(QKeyEvent *e)
}
}
}
if (!electricChar.isNull())
bool doEditBlock = !(electricChar.isNull() && autoText.isEmpty());
if (doEditBlock)
cursor.beginEditBlock();
cursor.insertText(text);
......@@ -1076,10 +1078,12 @@ void BaseTextEditor::keyPressEvent(QKeyEvent *e)
cursor.insertText(autoText);
cursor.setPosition(pos);
}
if (!electricChar.isNull()) {
if (!electricChar.isNull())
indent(document(), cursor, electricChar);
if (doEditBlock)
cursor.endEditBlock();
}
setTextCursor(cursor);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment