From 0ab78db2cf8ca04c9b882f7b572819c8f34323ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 13 Apr 2016 17:05:56 +0200 Subject: view: add view_cursors_new_force function To create a cursor even if there already exists one at the same position. Should only be used if all but one of the cursors will later be removed. --- view.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'view.h') diff --git a/view.h b/view.h index fd0c329..fadaaba 100644 --- a/view.h +++ b/view.h @@ -119,8 +119,13 @@ void view_scroll_to(View*, size_t pos); * position is visible. if the position is in the middle of a line, try to * adjust the viewport in such a way that the whole line is displayed */ void view_cursor_to(View*, size_t pos); -/* create a new cursor, at given position */ +/* create a new cursor at given position, fails if there already + * exists a cursor at the same position */ Cursor *view_cursors_new(View*, size_t pos); +/* create a new cursor even if there already is one located at the + * same position, this should only be used if the one of the two + * cursors will later be disposed */ +Cursor *view_cursors_new_force(View*, size_t pos); /* get number of active cursors */ int view_cursors_count(View*); /* get index/relative order at time of creation of a cursor [0,count-1] */ -- cgit v1.2.3