diff options
author | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-08-29 15:58:13 +0200 |
---|---|---|
committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-09-12 07:59:30 +0000 |
commit | ca84a51f867988cc4a6b3f4058ab6dc9f9badf84 (patch) | |
tree | eaa86c03279048c99281be9046435c5df9d40c4b /src/plugins/glsleditor | |
parent | b95b675e41e6d7bba54733119f5f2e55c7d39133 (diff) | |
download | qt-creator-ca84a51f867988cc4a6b3f4058ab6dc9f9badf84.tar.gz |
Clang: Use clang-format for indentation
This is the new experimental plugin based on LibFormat.
It replaces the default indenter for CppEditorDocument
and applies clang-format after the CR or the set of 'electric'
characters.
Uses the global .clang-format kept in QtC settings or
the one for current project. Both can be configured.
For indentation some style modifications and code manipulations
are done to prevent line shrinking when it's not expected.
Manual indentation uses unmodified style from .clang-format file.
Change-Id: I6279b805e418e1804b553efa615f5c843f395a58
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'src/plugins/glsleditor')
-rw-r--r-- | src/plugins/glsleditor/glslindenter.cpp | 3 | ||||
-rw-r--r-- | src/plugins/glsleditor/glslindenter.h | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/glsleditor/glslindenter.cpp b/src/plugins/glsleditor/glslindenter.cpp index 3b229f0c90..a743d815f9 100644 --- a/src/plugins/glsleditor/glslindenter.cpp +++ b/src/plugins/glsleditor/glslindenter.cpp @@ -84,7 +84,8 @@ void GlslIndenter::indentBlock(QTextDocument *doc, void GlslIndenter::indent(QTextDocument *doc, const QTextCursor &cursor, const QChar &typedChar, - const TextEditor::TabSettings &tabSettings) + const TextEditor::TabSettings &tabSettings, + bool /*autoTriggered*/) { if (cursor.hasSelection()) { QTextBlock block = doc->findBlock(cursor.selectionStart()); diff --git a/src/plugins/glsleditor/glslindenter.h b/src/plugins/glsleditor/glslindenter.h index 42696f0d99..b5b55ccd13 100644 --- a/src/plugins/glsleditor/glslindenter.h +++ b/src/plugins/glsleditor/glslindenter.h @@ -45,7 +45,8 @@ public: virtual void indent(QTextDocument *doc, const QTextCursor &cursor, const QChar &typedChar, - const TextEditor::TabSettings &tabSettings) override; + const TextEditor::TabSettings &tabSettings, + bool autoTriggered = true) override; int indentFor(const QTextBlock &block, const TextEditor::TabSettings &tabSettings) override; TextEditor::IndentationForBlock indentationForBlocks(const QVector<QTextBlock> &blocks, |