From aebe8da072ef0e10422e6344a028e5d0cce21a1a Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 1 Sep 2022 08:28:54 +0200 Subject: [PATCH] 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 Reviewed-by: --- src/plugins/texteditor/texteditor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 064ea1ceead..953a460aa08 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -4335,7 +4335,11 @@ void TextEditorWidgetPrivate::paintIndentDepth(PaintEventData &data, const QString text = data.block.text(); 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) return;