diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-05-03 17:21:46 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-05-03 17:31:52 +0200 |
| commit | 02c18c23d7eb8e520e8584af183ca9b67937d45d (patch) | |
| tree | 9a3caaa42dcb1d79074bd30476a8fc0d1f6207f7 /main.c | |
| parent | 3a1b14314b9b7c00aa78eee0b2aa5b492f2dd40f (diff) | |
| download | vis-02c18c23d7eb8e520e8584af183ca9b67937d45d.tar.gz vis-02c18c23d7eb8e520e8584af183ca9b67937d45d.tar.xz | |
vis: introduce count iterator to handle interrupted flag
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1241,7 +1241,8 @@ static const char *repeat(Vis *vis, const char *keys, const Arg *arg) { static const char *cursors_new(Vis *vis, const char *keys, const Arg *arg) { View *view = vis_view(vis); - for (int count = vis_count_get_default(vis, 1); count > 0; count--) { + VisCountIterator it = vis_count_iterator_get(vis, 1); + while (vis_count_iterator_next(&it)) { Cursor *cursor = NULL; switch (arg->i) { case -1: @@ -1481,7 +1482,8 @@ static const char *cursors_navigate(Vis *vis, const char *keys, const Arg *arg) return keys; } Cursor *c = view_cursors_primary_get(view); - for (int count = vis_count_get_default(vis, 1); count > 0; count--) { + VisCountIterator it = vis_count_iterator_get(vis, 1); + while (vis_count_iterator_next(&it)) { if (arg->i > 0) { c = view_cursors_next(c); if (!c) |
