aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Document.h
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2011-04-07 21:26:47 +1000
committernyamatongwe <devnull@localhost>2011-04-07 21:26:47 +1000
commit4012f14e6397f5709586102540df824d8c9ca4a5 (patch)
tree9f1535ca2d7a2690ba79a62d0d96ec58b9c9af96 /src/Document.h
parentc3d271e16f72cad5bf4f669614a78a67c5663037 (diff)
downloadscintilla-mirror-4012f14e6397f5709586102540df824d8c9ca4a5.tar.gz
Add highlighting of current folding block. Feature #3147069.
APIs MarkerEnableHighlight and MarkerSetBackSelected. From Jérôme Laforge.
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);