Clang: Significantly improve ClangFormat plugin usability

What's new:
1. New LibFormat option is used to prevent lines shrink,
   which allows to drop most of tricks used before for that purpose.
2. Cached UTF-8 source code is used to improve performance
3. Improved error handling.
4. Slightly improved UI.

Change-Id: I4605200fa103167369a40650b2e1ad2c61e8133b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-10-11 14:11:43 +02:00
parent 6f73b3b175
commit cafd5ced1a
13 changed files with 396 additions and 339 deletions

View File

@@ -2474,6 +2474,7 @@ void TextEditorWidget::keyPressEvent(QKeyEvent *e)
e->accept();
if (extraBlocks > 0) {
cursor.joinPreviousEditBlock();
const int cursorPosition = cursor.position();
QTextCursor ensureVisible = cursor;
while (extraBlocks > 0) {
@@ -2493,6 +2494,7 @@ void TextEditorWidget::keyPressEvent(QKeyEvent *e)
}
setTextCursor(ensureVisible);
cursor.setPosition(cursorPosition);
cursor.endEditBlock();
}
setTextCursor(cursor);