aboutsummaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'text.c')
-rw-r--r--text.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/text.c b/text.c
index 5f516bc..ab8a846 100644
--- a/text.c
+++ b/text.c
@@ -1489,3 +1489,10 @@ Filerange text_range_union(Filerange *r1, Filerange *r2) {
.end = MAX(r1->end, r2->end),
};
}
+
+Filerange text_range_new(size_t a, size_t b) {
+ return (Filerange) {
+ .start = MIN(a, b),
+ .end = MAX(a, b),
+ };
+}