summaryrefslogtreecommitdiff
path: root/src/plugins/qmljstools/qmljsindenter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/qmljstools/qmljsindenter.cpp')
-rw-r--r--src/plugins/qmljstools/qmljsindenter.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/qmljstools/qmljsindenter.cpp b/src/plugins/qmljstools/qmljsindenter.cpp
index 71abf832b9..bcbff019b4 100644
--- a/src/plugins/qmljstools/qmljsindenter.cpp
+++ b/src/plugins/qmljstools/qmljsindenter.cpp
@@ -90,3 +90,19 @@ int Indenter::indentFor(const QTextBlock &block,
codeFormatter.updateStateUntil(block);
return codeFormatter.indentFor(block);
}
+
+
+TextEditor::IndentationForBlock
+Indenter::indentationForBlocks(const QVector<QTextBlock> &blocks,
+ const TextEditor::TabSettings &tabSettings)
+{
+ QmlJSTools::CreatorCodeFormatter codeFormatter(tabSettings);
+
+
+ codeFormatter.updateStateUntil(blocks.last());
+
+ TextEditor::IndentationForBlock ret;
+ foreach (QTextBlock block, blocks)
+ ret.insert(block.blockNumber(), codeFormatter.indentFor(block));
+ return ret;
+}