diff options
author | David Schulz <david.schulz@theqtcompany.com> | 2016-01-13 14:32:23 +0100 |
---|---|---|
committer | David Schulz <david.schulz@theqtcompany.com> | 2016-02-24 12:03:12 +0000 |
commit | 9aa51d4857702c22d359014356d06c9d92677904 (patch) | |
tree | 79d73774ac0541e65fbe03e44592a43fc95ba152 /src/plugins/glsleditor | |
parent | bc921b46a2946294b467e1d2bcafb147ee77361a (diff) |
Editor: Fix whitespace cleaning.
Task-number: QTCREATORBUG-7994
Change-Id: I6c197ccc3a148555018e8f8184d116c88d7ea400
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/plugins/glsleditor')
-rw-r--r-- | src/plugins/glsleditor/glslindenter.cpp | 13 | ||||
-rw-r--r-- | src/plugins/glsleditor/glslindenter.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/glsleditor/glslindenter.cpp b/src/plugins/glsleditor/glslindenter.cpp index fd4698ac6c..33aa847064 100644 --- a/src/plugins/glsleditor/glslindenter.cpp +++ b/src/plugins/glsleditor/glslindenter.cpp @@ -111,5 +111,18 @@ void GlslIndenter::indent(QTextDocument *doc, } } +int GlslIndenter::indentFor(const QTextBlock &block, const TextEditor::TabSettings &tabSettings) +{ + CppTools::QtStyleCodeFormatter codeFormatter(tabSettings, + CppTools::CppToolsSettings::instance()->cppCodeStyle()->codeStyleSettings()); + + codeFormatter.updateStateUntil(block); + int indent; + int padding; + codeFormatter.indentFor(block, &indent, &padding); + + return indent; +} + } // namespace Internal } // namespace GlslEditor diff --git a/src/plugins/glsleditor/glslindenter.h b/src/plugins/glsleditor/glslindenter.h index 98f93feebf..98ba0002ca 100644 --- a/src/plugins/glsleditor/glslindenter.h +++ b/src/plugins/glsleditor/glslindenter.h @@ -47,6 +47,8 @@ public: const QTextCursor &cursor, const QChar &typedChar, const TextEditor::TabSettings &tabSettings); + + int indentFor(const QTextBlock &block, const TextEditor::TabSettings &tabSettings) override; }; } // namespace Internal |