aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Document.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Document.h')
-rw-r--r--src/Document.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/Document.h b/src/Document.h
index fd0998260..851c10081 100644
--- a/src/Document.h
+++ b/src/Document.h
@@ -115,6 +115,47 @@ struct StyledText {
}
};
+class HighlightDelimiter {
+public:
+ HighlightDelimiter() {
+ beginFoldBlock = -1;
+ endFoldBlock = -1;
+ beginMarginCorrectlyDrawnZone = -1;
+ endMarginCorrectlyDrawnZone = -1;
+ isEnabled = false;
+ }
+
+ bool NeedsDrawing(int line) {
+ return isEnabled && (line <= beginMarginCorrectlyDrawnZone || endMarginCorrectlyDrawnZone <= line);
+ }
+
+ bool isCurrentBlockHighlight(int line) {
+ return isEnabled && beginFoldBlock <= line && line <= endFoldBlock;
+ }
+
+ bool isHeadBlockFold(int line) {
+ return beginFoldBlock == line && line < endFoldBlock;
+ }
+
+ bool isBodyBlockFold(int line) {
+ return beginFoldBlock < line && line < endFoldBlock;
+ }
+
+ bool isTailBlockFold(int line) {
+ return beginFoldBlock < line && line == endFoldBlock;
+ }
+
+ // beginFoldBlock : Begin of current fold block.
+ // endStartBlock : End of zone where margin is already drawn.
+ // beginMarginCorrectlyDrawnZone : Begin of zone where margin is already drawn.
+ // endMarginCorrectlyDrawnZone : End of current fold block.
+ int beginFoldBlock;
+ int endFoldBlock;
+ int beginMarginCorrectlyDrawnZone;
+ int endMarginCorrectlyDrawnZone;
+ bool isEnabled;
+};
+
class CaseFolder {
public:
virtual ~CaseFolder() {
@@ -299,6 +340,7 @@ public:
void ClearLevels();
int GetLastChild(int lineParent, int level=-1);
int GetFoldParent(int line);
+ void GetHighlightDelimiters(int line, HighlightDelimiter &hDelimiter);
void Indent(bool forwards);
int ExtendWordSelect(int pos, int delta, bool onlyWordCharacters=false);