diff --git a/src/plugins/texteditor/textdocument.cpp b/src/plugins/texteditor/textdocument.cpp index 7fcfe5c86c2..63cd2b170e9 100644 --- a/src/plugins/texteditor/textdocument.cpp +++ b/src/plugins/texteditor/textdocument.cpp @@ -10,6 +10,7 @@ #include "tabsettings.h" #include "textdocumentlayout.h" #include "texteditor.h" +#include "texteditorconstants.h" #include "texteditorsettings.h" #include "texteditortr.h" #include "textindenter.h" @@ -573,6 +574,9 @@ void TextDocument::setIfdefedOutBlocks(const QList &blocks) } if (braceDepthDelta) { + qCDebug(Internal::foldingLog) + << "changing brace depth and folding indent by" << braceDepthDelta << "for line" + << (block.blockNumber() + 1) << "due to ifdefed out code"; TextDocumentLayout::changeBraceDepth(block,braceDepthDelta); TextDocumentLayout::changeFoldingIndent(block, braceDepthDelta); // ### C++ only, refactor! } diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index d75db87a166..d865fcebe98 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -6339,6 +6339,13 @@ void TextEditorWidgetPrivate::paintCodeFolding(QPainter &painter, bool drawBox = nextBlockUserData && TextDocumentLayout::foldingIndent(data.block) < nextBlockUserData->foldingIndent(); + if (drawBox) { + qCDebug(foldingLog) << "need to paint folding marker"; + qCDebug(foldingLog) << "folding indent for line" << (data.block.blockNumber() + 1) << "is" + << TextDocumentLayout::foldingIndent(data.block); + qCDebug(foldingLog) << "folding indent for line" << (nextBlock.blockNumber() + 1) << "is" + << nextBlockUserData->foldingIndent(); + } const int blockNumber = data.block.blockNumber(); bool active = blockNumber == extraAreaHighlightFoldBlockNumber; diff --git a/src/plugins/texteditor/texteditorconstants.cpp b/src/plugins/texteditor/texteditorconstants.cpp index e6d157adca9..689669a91a6 100644 --- a/src/plugins/texteditor/texteditorconstants.cpp +++ b/src/plugins/texteditor/texteditorconstants.cpp @@ -125,4 +125,9 @@ TextStyle styleFromName(const char *name) } } // namespace Constants + +namespace Internal { +Q_LOGGING_CATEGORY(foldingLog, "qtc.editor.folding", QtWarningMsg) +} // namespace Internal + } // namespace TextEditor diff --git a/src/plugins/texteditor/texteditorconstants.h b/src/plugins/texteditor/texteditorconstants.h index 2597deb6bba..04405438395 100644 --- a/src/plugins/texteditor/texteditorconstants.h +++ b/src/plugins/texteditor/texteditorconstants.h @@ -5,7 +5,7 @@ #include "texteditor_global.h" -#include +#include namespace TextEditor { @@ -250,4 +250,7 @@ const char BOOKMARKS_NEXT_ACTION[] = "Bookmarks.Next"; const unsigned COMPLETION_ASSIST_TOOLTIP_DELAY = 100; } // namespace Constants + +namespace Internal { Q_DECLARE_LOGGING_CATEGORY(foldingLog) } + } // namespace TextEditor