mirror of https://github.com/buggins/dlangui.git
support toggle comment
This commit is contained in:
parent
8293129a25
commit
70d27155b0
|
@ -185,6 +185,17 @@ struct TextPosition {
|
||||||
struct TextRange {
|
struct TextRange {
|
||||||
TextPosition start;
|
TextPosition start;
|
||||||
TextPosition end;
|
TextPosition end;
|
||||||
|
bool intersects(const ref TextRange v) const {
|
||||||
|
if (start >= v.end)
|
||||||
|
return false;
|
||||||
|
if (end <= v.start)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
/// returns true if position is inside this range
|
||||||
|
bool isInside(TextPosition p) const {
|
||||||
|
return start <= p && end > p;
|
||||||
|
}
|
||||||
/// returns true if range is empty
|
/// returns true if range is empty
|
||||||
@property bool empty() const {
|
@property bool empty() const {
|
||||||
return end <= start;
|
return end <= start;
|
||||||
|
|
Loading…
Reference in New Issue