aboutsummaryrefslogtreecommitdiff
path: root/text-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'text-util.c')
-rw-r--r--text-util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/text-util.c b/text-util.c
index 38e49e1..2b48719 100644
--- a/text-util.c
+++ b/text-util.c
@@ -31,6 +31,12 @@ Filerange text_range_new(size_t a, size_t b) {
};
}
+bool text_range_equal(Filerange *r1, Filerange *r2) {
+ if (!text_range_valid(r1) && !text_range_valid(r2))
+ return true;
+ return r1->start == r2->start && r1->end == r2->end;
+}
+
bool text_range_overlap(Filerange *r1, Filerange *r2) {
if (!text_range_valid(r1) || !text_range_valid(r2))
return false;