Editor: paint indent marker for blocks containing only spaces

Results in a cleaner look since the indent marker are not interrupted on
lines that are for code formatting reasons empty.

Change-Id: I887071715e0224210684d131a93b3799f8504501
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
David Schulz
2022-09-01 08:28:54 +02:00
parent 6f3c03f1f9
commit aebe8da072

View File

@@ -4335,7 +4335,11 @@ void TextEditorWidgetPrivate::paintIndentDepth(PaintEventData &data,
const QString text = data.block.text(); const QString text = data.block.text();
const TabSettings &tabSettings = m_document->tabSettings(); const TabSettings &tabSettings = m_document->tabSettings();
const int currentDepth = tabSettings.indentationColumn(text); int currentDepth = -1;
if (text.simplified().isEmpty())
currentDepth = m_document->indenter()->indentFor(data.block, tabSettings);
if (currentDepth < 0)
currentDepth = tabSettings.indentationColumn(text);
if (currentDepth <= tabSettings.m_indentSize || blockData.layout->lineCount() < 1) if (currentDepth <= tabSettings.m_indentSize || blockData.layout->lineCount() < 1)
return; return;