aboutsummaryrefslogtreecommitdiff
path: root/view.c
diff options
context:
space:
mode:
Diffstat (limited to 'view.c')
-rw-r--r--view.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/view.c b/view.c
index 43915ce..4af93f8 100644
--- a/view.c
+++ b/view.c
@@ -890,6 +890,13 @@ Cursor *view_cursors_new(View *view) {
return c;
}
+int view_cursors_count(View *view) {
+ int i = 0;
+ for (Cursor *c = view_cursors(view); c; c = view_cursors_next(c))
+ i++;
+ return i;
+}
+
void view_cursors_free(Cursor *c) {
if (!c)
return;
@@ -1051,9 +1058,10 @@ void view_selections_clear(View *view) {
void view_cursors_clear(View *view) {
for (Cursor *c = view->cursors, *next; c; c = next) {
next = c->next;
- view_selections_free(c->sel);
- if (c != view->cursor)
+ if (c != view->cursor) {
+ view_selections_free(c->sel);
view_cursors_free(c);
+ }
}
view_draw(view);
}