diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-07-27 21:59:30 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-07-28 13:21:50 +0200 |
| commit | b134abd515969c123182d5f20008a5f89bd7bfe4 (patch) | |
| tree | 9a93e77009633b76cd105917be315decb0e75ae9 /view.c | |
| parent | 620518966fb99511c506af292cc1885f7a419881 (diff) | |
| download | vis-b134abd515969c123182d5f20008a5f89bd7bfe4.tar.gz vis-b134abd515969c123182d5f20008a5f89bd7bfe4.tar.xz | |
vis: ESC in normal mode clears all cursors
Diffstat (limited to 'view.c')
| -rw-r--r-- | view.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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); } |
