diff options
Diffstat (limited to 'text-util.c')
| -rw-r--r-- | text-util.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/text-util.c b/text-util.c index 4139454..38e49e1 100644 --- a/text-util.c +++ b/text-util.c @@ -36,3 +36,7 @@ bool text_range_overlap(Filerange *r1, Filerange *r2) { return false; return r1->start <= r2->end && r2->start <= r1->end; } + +bool text_range_contains(Filerange *r, size_t pos) { + return text_range_valid(r) && r->start <= pos && pos <= r->end; +} |
