aboutsummaryrefslogtreecommitdiff
path: root/view.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-03-28 12:01:49 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-03-28 12:25:05 +0200
commit647dc4c030c0ee876d85de0447f4d706d600d3f6 (patch)
tree3de0921d374d75928e70d0aecb226db3b7dfdffd /view.h
parent99512776c0f35f3f518c995642d1707368f80598 (diff)
downloadvis-647dc4c030c0ee876d85de0447f4d706d600d3f6.tar.gz
vis-647dc4c030c0ee876d85de0447f4d706d600d3f6.tar.xz
view: add infrastructure to iterate through cursor columns
The number of columns i.e. maximal number of cursors located on the same line can be obtained by view_cursors_column_count. Column addressing is zero based, valid indexes are [0, max-1]. Assuming there is a cursor on every letter: a b c d e f g h i max column would be 3, and the following would iterate over the cursors forming the second column [c, e, h]: for (Cursor *c = view_cursors_column(view, 1); c; c = view_cursors_column_next(c, 1)) ...
Diffstat (limited to 'view.h')
-rw-r--r--view.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/view.h b/view.h
index e408cf7..6447032 100644
--- a/view.h
+++ b/view.h
@@ -179,4 +179,11 @@ Filerange view_selections_get(Selection*);
void view_selections_set(Selection*, Filerange*);
Text *view_text(View*);
+/* get number of columns, that is maximal number of cursors on a line */
+int view_cursors_column_count(View*);
+/* get first cursor in zero based column */
+Cursor *view_cursors_column(View*, int column);
+/* get next cursor (i.e. on another line) in zero based column */
+Cursor *view_cursors_column_next(Cursor*, int column);
+
#endif