aboutsummaryrefslogtreecommitdiff
path: root/view.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-01-13 14:22:36 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-01-13 21:38:20 +0100
commit5d54271403b1a90ed7ef81894ea0ff91d7a8c5f6 (patch)
treea943c6a9084891310b5187a25edd2c2b255df580 /view.c
parent8ca992e7a2d2f7be3b4e46a988443525575ca72d (diff)
downloadvis-5d54271403b1a90ed7ef81894ea0ff91d7a8c5f6.tar.gz
vis-5d54271403b1a90ed7ef81894ea0ff91d7a8c5f6.tar.xz
view: introduce view_selection_get
It returns the range covered by the selection of the primary cursor.
Diffstat (limited to 'view.c')
-rw-r--r--view.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/view.c b/view.c
index db39de7..ad7d954 100644
--- a/view.c
+++ b/view.c
@@ -1301,6 +1301,10 @@ Selection *view_selections_next(Selection *s) {
return s->next;
}
+Filerange view_selection_get(View *view) {
+ return view_selections_get(view->cursor->sel);
+}
+
Filerange view_selections_get(Selection *s) {
if (!s)
return text_range_empty();