From fedd048fd0ee40cebdb4a8ca1abca868bbbf998b Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 22 Nov 2010 10:46:55 +0100 Subject: [PATCH] Add some comments about code folding I needed to find out how this works the hard way, so add at least some hints on how to work with code folding:-) --- src/plugins/texteditor/basetextdocumentlayout.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/texteditor/basetextdocumentlayout.h b/src/plugins/texteditor/basetextdocumentlayout.h index e70802d009..161eb529db 100644 --- a/src/plugins/texteditor/basetextdocumentlayout.h +++ b/src/plugins/texteditor/basetextdocumentlayout.h @@ -107,10 +107,19 @@ public: static bool findPreviousBlockOpenParenthesis(QTextCursor *cursor, bool checkStartPosition = false); static bool findNextBlockClosingParenthesis(QTextCursor *cursor); + // Get the code folding level inline int foldingIndent() const { return m_foldingIndent; } + /* Set the code folding level. + * + * A code folding marker will appear the line *before* the one where the indention + * level increases. The code folding reagion will end in the last line that has the same + * indention level (or higher). + */ inline void setFoldingIndent(int indent) { m_foldingIndent = indent; } + // Set whether the first charater of the folded region will show when the code is folded. inline void setFoldingStartIncluded(bool included) { m_foldingStartIncluded = included; } inline bool foldingStartIncluded() const { return m_foldingStartIncluded; } + // Set whether the last charater of the folded region will show when the code is folded. inline void setFoldingEndIncluded(bool included) { m_foldingEndIncluded = included; } inline bool foldingEndIncluded() const { return m_foldingEndIncluded; } inline int lexerState() const { return m_lexerState; } -- 2.11.0