diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-07-28 17:00:20 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-07-28 17:00:20 +0200 |
| commit | 6d7aa204acaa326ce5ef1c74a7ae88875bc1752a (patch) | |
| tree | 17127655e872286519ebefaa81e1c827e6bb3586 /text-objects.c | |
| parent | b366f55f29af3775c055115572dd84873b1921e0 (diff) | |
| download | vis-6d7aa204acaa326ce5ef1c74a7ae88875bc1752a.tar.gz vis-6d7aa204acaa326ce5ef1c74a7ae88875bc1752a.tar.xz | |
text-object: introduce utility function text_range_is_linewise
Diffstat (limited to 'text-objects.c')
| -rw-r--r-- | text-objects.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/text-objects.c b/text-objects.c index d33132c..0d22ca4 100644 --- a/text-objects.c +++ b/text-objects.c @@ -304,3 +304,9 @@ Filerange text_range_linewise(Text *txt, Filerange *rin) { rout.end = text_line_next(txt, rin->end); return rout; } + +bool text_range_is_linewise(Text *txt, Filerange *r) { + return text_range_valid(r) && + r->start == text_line_begin(txt, r->start) && + r->end == text_line_begin(txt, r->end); +} |
