diff options
Diffstat (limited to 'src/Document.h')
-rw-r--r-- | src/Document.h | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/src/Document.h b/src/Document.h index 7858db727..e8dfbabc8 100644 --- a/src/Document.h +++ b/src/Document.h @@ -117,42 +117,41 @@ struct StyledText { class HighlightDelimiter { public: - HighlightDelimiter() { + HighlightDelimiter() : isEnabled(false) { + Clear(); + } + + void Clear() { beginFoldBlock = -1; endFoldBlock = -1; - beginMarginCorrectlyDrawnZone = -1; - endMarginCorrectlyDrawnZone = -1; - isEnabled = false; + firstChangeableLineBefore = -1; + firstChangeableLineAfter = -1; } bool NeedsDrawing(int line) { - return isEnabled && (line <= beginMarginCorrectlyDrawnZone || endMarginCorrectlyDrawnZone <= line); + return isEnabled && (line <= firstChangeableLineBefore || line >= firstChangeableLineAfter); } - bool isCurrentBlockHighlight(int line) { + bool IsFoldBlockHighlighted(int line) { return isEnabled && beginFoldBlock != -1 && beginFoldBlock <= line && line <= endFoldBlock; } - bool isHeadBlockFold(int line) { + bool IsHeadOfFoldBlock(int line) { return beginFoldBlock == line && line < endFoldBlock; } - bool isBodyBlockFold(int line) { + bool IsBodyOfFoldBlock(int line) { return beginFoldBlock != -1 && beginFoldBlock < line && line < endFoldBlock; } - bool isTailBlockFold(int line) { + bool IsTailOfFoldBlock(int line) { return beginFoldBlock != -1 && beginFoldBlock < line && line == endFoldBlock; } - // beginFoldBlock : Begin of current fold block. - // endStartBlock : End of current fold block. - // beginMarginCorrectlyDrawnZone : Begin of zone where margin is correctly drawn. - // endMarginCorrectlyDrawnZone : End of zone where margin is correctly drawn. - int beginFoldBlock; - int endFoldBlock; - int beginMarginCorrectlyDrawnZone; - int endMarginCorrectlyDrawnZone; + int beginFoldBlock; // Begin of current fold block + int endFoldBlock; // End of current fold block + int firstChangeableLineBefore; // First line that triggers repaint before starting line that determined current fold block + int firstChangeableLineAfter; // First line that triggers repaint after starting line that determined current fold block bool isEnabled; }; @@ -339,9 +338,9 @@ public: int SCI_METHOD SetLevel(int line, int level); int SCI_METHOD GetLevel(int line) const; void ClearLevels(); - int GetLastChild(int lineParent, int level=-1); + int GetLastChild(int lineParent, int level=-1, int lastLine=-1); int GetFoldParent(int line); - void GetHighlightDelimiters(HighlightDelimiter &hDelimiter, int line, int topLine, int bottomLine); + void GetHighlightDelimiters(HighlightDelimiter &hDelimiter, int line, int lastLine); void Indent(bool forwards); int ExtendWordSelect(int pos, int delta, bool onlyWordCharacters=false); |