From a38426717abbb32d1f44e57a77151c3e070c943e Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 1 Mar 2002 07:24:01 +0000 Subject: Fixed problem where brace highlights were remembered in line layout cache. --- src/Document.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/Document.h') diff --git a/src/Document.h b/src/Document.h index 8affe294c..941ad79cc 100644 --- a/src/Document.h +++ b/src/Document.h @@ -37,6 +37,7 @@ public: return (start != invalidPosition) && (end != invalidPosition); } + // Is the position within the range? bool Contains(Position pos) const { if (start < end) { return (pos >= start && pos <= end); @@ -45,6 +46,15 @@ public: } } + // Is the character after pos within the range? + bool ContainsCharacter(Position pos) const { + if (start < end) { + return (pos >= start && pos < end); + } else { + return (pos < start && pos >= end); + } + } + bool Contains(Range other) const { return Contains(other.start) && Contains(other.end); } -- cgit v1.2.3