diff options
Diffstat (limited to 'src/Document.h')
-rw-r--r-- | src/Document.h | 10 |
1 files changed, 10 insertions, 0 deletions
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); } |