forked from qt-creator/qt-creator
ClangTools: Apply indention/formatting after fix-its
Fix-its do not follow the current formatting style therefore apply indention/formatting by using indenter. This change will work best when ClangFormat plugin is enabled to not only reindent line but also format it. Task-number: QTCREATORBUG-21448 Change-Id: I8bcafcf49f3118aff7840326547e7a24052469b2 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -384,14 +384,10 @@ void ClangFormatIndenter::indent(QTextDocument *doc,
|
||||
}
|
||||
|
||||
QtReplacements ClangFormatIndenter::format(QTextDocument *doc,
|
||||
const Utils::FileName &fileName,
|
||||
const QTextCursor &cursor,
|
||||
const TextEditor::TabSettings & /*tabSettings*/)
|
||||
{
|
||||
TextEditorWidget *editor = TextEditorWidget::currentTextEditorWidget();
|
||||
if (!editor)
|
||||
return QtReplacements();
|
||||
|
||||
const Utils::FileName fileName = editor->textDocument()->filePath();
|
||||
int utf8Offset;
|
||||
int utf8Length;
|
||||
const QByteArray buffer = doc->toPlainText().toUtf8();
|
||||
|
||||
Reference in New Issue
Block a user