forked from qt-creator/qt-creator
Editor: improve visual indent depth for empty blocks
Use the indenter based visual indent only for the cpp qt style indenter since it gives accurate results. In all other casess Look for the next and previous not empty lines and use the minimum indent depth of those lines as the visual indent depth for empty lines. Task-number: QTCREATORBUG-28179 Change-Id: Ic456fba5adfb2a12f20e2bd4fc663010c752b65c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -67,6 +67,11 @@ int Indenter::indentFor(const QTextBlock &block,
|
||||
return codeFormatter.indentFor(block);
|
||||
}
|
||||
|
||||
int Indenter::visualIndentFor(const QTextBlock &block, const TextEditor::TabSettings &tabSettings)
|
||||
{
|
||||
return indentFor(block, tabSettings);
|
||||
}
|
||||
|
||||
TextEditor::IndentationForBlock Indenter::indentationForBlocks(
|
||||
const QVector<QTextBlock> &blocks,
|
||||
const TextEditor::TabSettings &tabSettings,
|
||||
|
||||
@@ -26,6 +26,8 @@ public:
|
||||
int indentFor(const QTextBlock &block,
|
||||
const TextEditor::TabSettings &tabSettings,
|
||||
int cursorPositionInEditor = -1) override;
|
||||
int visualIndentFor(const QTextBlock &block,
|
||||
const TextEditor::TabSettings &tabSettings) override;
|
||||
TextEditor::IndentationForBlock indentationForBlocks(const QVector<QTextBlock> &blocks,
|
||||
const TextEditor::TabSettings &tabSettings,
|
||||
int cursorPositionInEditor = -1) override;
|
||||
|
||||
Reference in New Issue
Block a user