diff options
| author | nyamatongwe <unknown> | 2011-04-07 21:26:47 +1000 |
|---|---|---|
| committer | nyamatongwe <unknown> | 2011-04-07 21:26:47 +1000 |
| commit | 0adca4ad14500910cca14a54d7d4c19e740606da (patch) | |
| tree | be10d8a118fb4e5fd92a549d47aa80c1df01a5cf /src/Document.h | |
| parent | e7dea4ff60eba17362902d514ff29ebfbc8ea3a1 (diff) | |
| download | scintilla-mirror-0adca4ad14500910cca14a54d7d4c19e740606da.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.h | 42 |
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); |
