diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-06-12 18:07:48 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-06-15 15:51:42 +0200 |
| commit | dc9f1cd879069889e6e3ef2fc6acc35250fe5423 (patch) | |
| tree | f664c7f837b0e62c176dc849481789376b7ea03a | |
| parent | e7717eb977142b6cb3b05e04c8623d39b7bac102 (diff) | |
| download | vis-dc9f1cd879069889e6e3ef2fc6acc35250fe5423.tar.gz vis-dc9f1cd879069889e6e3ef2fc6acc35250fe5423.tar.xz | |
view: rename view_cursors_dispose
| -rw-r--r-- | main.c | 10 | ||||
| -rw-r--r-- | sam.c | 8 | ||||
| -rw-r--r-- | view.c | 8 | ||||
| -rw-r--r-- | view.h | 4 | ||||
| -rw-r--r-- | vis.c | 4 |
5 files changed, 17 insertions, 17 deletions
@@ -1405,13 +1405,13 @@ static const char *cursors_select_skip(Vis *vis, const char *keys, const Arg *ar Cursor *cursor = view_cursors_primary_get(view); keys = cursors_select_next(vis, keys, arg); if (cursor != view_cursors_primary_get(view)) - view_cursors_dispose(cursor); + view_selections_dispose(cursor); return keys; } static const char *cursors_remove(Vis *vis, const char *keys, const Arg *arg) { View *view = vis_view(vis); - view_cursors_dispose(view_cursors_primary_get(view)); + view_selections_dispose(view_cursors_primary_get(view)); view_cursor_to(view, view_cursor_get(view)); return keys; } @@ -1429,7 +1429,7 @@ static const char *cursors_remove_column(Vis *vis, const char *keys, const Arg * for (Cursor *c = view_cursors_column(view, column), *next; c; c = next) { next = view_cursors_column_next(c, column); - view_cursors_dispose(c); + view_selections_dispose(c); } vis_count_set(vis, VIS_COUNT_UNKNOWN); @@ -1454,7 +1454,7 @@ static const char *cursors_remove_column_except(Vis *vis, const char *keys, cons if (cur == col) col = view_cursors_column_next(col, column); else - view_cursors_dispose(cur); + view_selections_dispose(cur); } vis_count_set(vis, VIS_COUNT_UNKNOWN); @@ -1567,7 +1567,7 @@ static const char *selections_trim(Vis *vis, const char *keys, const Arg *arg) { && isspace((unsigned char)b); sel.start++); if (sel.start < sel.end) { view_cursors_selection_set(c, &sel); - } else if (!view_cursors_dispose(c)) { + } else if (!view_selections_dispose(c)) { vis_mode_switch(vis, VIS_MODE_NORMAL); } } @@ -1095,7 +1095,7 @@ static bool sam_execute(Vis *vis, Win *win, Command *cmd, Cursor *cur, Filerange { for (Command *c = cmd->cmd; c && ret; c = c->next) ret &= sam_execute(vis, win, c, NULL, range); - view_cursors_dispose_force(cur); + view_selections_dispose_force(cur); break; } default: @@ -1200,7 +1200,7 @@ enum SamError sam_cmd(Vis *vis, const char *s) { delta -= text_range_size(&c->range); if (c->cursor && c->type == TRANSCRIPT_DELETE) { if (visual) - view_cursors_dispose_force(c->cursor); + view_selections_dispose_force(c->cursor); else view_cursors_to(c->cursor, c->range.start); } @@ -1335,7 +1335,7 @@ static bool cmd_guard(Vis *vis, Win *win, Command *cmd, const char *argv[], Curs text_range_size(range), cmd->regex, 0, NULL, 0); if ((count_evaluate(cmd) && match) ^ (argv[0][0] == 'v')) return sam_execute(vis, win, cmd->cmd, cur, range); - view_cursors_dispose_force(cur); + view_selections_dispose_force(cur); return true; } @@ -1416,7 +1416,7 @@ static int extract(Vis *vis, Win *win, Command *cmd, const char *argv[], Cursor } if (!simulate) - view_cursors_dispose_force(cur); + view_selections_dispose_force(cur); return simulate ? count : ret; } @@ -921,7 +921,7 @@ static Cursor *cursors_new(View *view, size_t pos, bool force) { } view->cursor_latest = c; view->cursor_count++; - view_cursors_dispose(view->cursor_dead); + view_selections_dispose(view->cursor_dead); view_cursors_to(c, pos); return c; err: @@ -1019,7 +1019,7 @@ static void view_cursors_free(Cursor *c) { free(c); } -bool view_cursors_dispose(Cursor *c) { +bool view_selections_dispose(Cursor *c) { if (!c) return true; View *view = c->view; @@ -1030,8 +1030,8 @@ bool view_cursors_dispose(Cursor *c) { return true; } -bool view_cursors_dispose_force(Cursor *c) { - if (view_cursors_dispose(c)) +bool view_selections_dispose_force(Cursor *c) { + if (view_selections_dispose(c)) return true; View *view = c->view; if (view->cursor_dead) @@ -120,7 +120,7 @@ Cursor *view_selections_new_force(View*, size_t pos); * .. warning:: Not applicaple for the last existing selection. * @endrst */ -bool view_cursors_dispose(Cursor*); +bool view_selections_dispose(Cursor*); /** * Forcefully dispose an existing selection. * @@ -128,7 +128,7 @@ bool view_cursors_dispose(Cursor*); * marked for destruction. As soon as a new selection is created this one * will be disposed. */ -bool view_cursors_dispose_force(Cursor*); +bool view_selections_dispose_force(Cursor*); /** * Query state of primary selection. * @@ -852,7 +852,7 @@ void vis_do(Vis *vis) { size_t pos = view_cursors_pos(cursor); if (pos == EPOS) { - if (!view_cursors_dispose(cursor)) + if (!view_selections_dispose(cursor)) view_cursors_to(cursor, 0); continue; } @@ -977,7 +977,7 @@ void vis_do(Vis *vis) { if (a->op) { size_t pos = a->op->func(vis, txt, &c); if (pos == EPOS) { - view_cursors_dispose(cursor); + view_selections_dispose(cursor); } else if (pos <= text_size(txt)) { if (vis->mode->visual) view_cursors_selection_save(cursor); |
