forked from qt-creator/qt-creator
Editor: Allow negative folding indent.
Fixing folding issues in the c++ editor if too many closing folding regions were found. Change-Id: I5c3476a6922af07be9b49d396b684a5f3b5a5e33 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -498,7 +498,7 @@ void TextDocumentLayout::setFoldingIndent(const QTextBlock &block, int indent)
|
||||
if (TextBlockUserData *userData = testUserData(block))
|
||||
userData->setFoldingIndent(0);
|
||||
} else {
|
||||
userData(block)->setFoldingIndent(qMax(0,indent));
|
||||
userData(block)->setFoldingIndent(indent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,13 +66,13 @@ class TEXTEDITOR_EXPORT TextBlockUserData : public QTextBlockUserData
|
||||
public:
|
||||
|
||||
inline TextBlockUserData()
|
||||
: m_folded(false),
|
||||
m_ifdefedOut(false),
|
||||
m_foldingIndent(0),
|
||||
m_lexerState(0),
|
||||
m_foldingStartIncluded(false),
|
||||
m_foldingEndIncluded(false),
|
||||
m_codeFormatterData(0)
|
||||
: m_foldingIndent(0)
|
||||
, m_folded(false)
|
||||
, m_ifdefedOut(false)
|
||||
, m_lexerState(0)
|
||||
, m_foldingStartIncluded(false)
|
||||
, m_foldingEndIncluded(false)
|
||||
, m_codeFormatterData(0)
|
||||
{}
|
||||
~TextBlockUserData();
|
||||
|
||||
@@ -138,9 +138,9 @@ public:
|
||||
|
||||
private:
|
||||
TextMarks m_marks;
|
||||
int m_foldingIndent : 16;
|
||||
uint m_folded : 1;
|
||||
uint m_ifdefedOut : 1;
|
||||
uint m_foldingIndent : 16;
|
||||
uint m_lexerState : 8;
|
||||
uint m_foldingStartIncluded : 1;
|
||||
uint m_foldingEndIncluded : 1;
|
||||
|
||||
Reference in New Issue
Block a user