aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexlib/StyleContext.h
diff options
context:
space:
mode:
authornyamatongwe <unknown>2013-04-25 09:38:06 +1000
committernyamatongwe <unknown>2013-04-25 09:38:06 +1000
commite1964f6e7e247bfd2830de627fa0c1aee034f550 (patch)
treeddb124fdabda0adc2634fcd327b0978293770cb9 /lexlib/StyleContext.h
parent60e1f81c03145b6f95c9d1afa2a5c22e4f780659 (diff)
downloadscintilla-mirror-e1964f6e7e247bfd2830de627fa0c1aee034f550.tar.gz
Fix bug with setting atLineEnd at end of document.
Diffstat (limited to 'lexlib/StyleContext.h')
-rw-r--r--lexlib/StyleContext.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lexlib/StyleContext.h b/lexlib/StyleContext.h
index 2d3cfc1fc..c79d42e37 100644
--- a/lexlib/StyleContext.h
+++ b/lexlib/StyleContext.h
@@ -76,7 +76,7 @@ class StyleContext {
// End of line?
// Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win)
// or on LF alone (Unix). Avoid triggering two times on Dos/Win.
- if (lineStartNext < styler.Length())
+ if (currentLine < lineDocEnd)
atLineEnd = static_cast<int>(pos) >= (lineStartNext-1);
else // Last line
atLineEnd = static_cast<int>(pos) >= lineStartNext;
@@ -85,6 +85,7 @@ class StyleContext {
public:
unsigned int currentPos;
int currentLine;
+ int lineDocEnd;
int lineStartNext;
bool atLineStart;
bool atLineEnd;
@@ -112,6 +113,7 @@ public:
lengthDocument = static_cast<unsigned int>(styler.Length());
if (endPos == lengthDocument)
endPos++;
+ lineDocEnd = styler.GetLine(lengthDocument);
atLineStart = static_cast<unsigned int>(styler.LineStart(currentLine)) == startPos;
unsigned int pos = currentPos;
ch = static_cast<unsigned char>(styler.SafeGetCharAt(pos, 0));