diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-06-12 18:28:19 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-06-15 15:51:43 +0200 |
| commit | 08d7d23f7d27e253947ecd2bfa6334f0fdbe3ea5 (patch) | |
| tree | 9abbd5b7c4dd785354296939b50e433d5f69cea3 | |
| parent | 742fb8b4c39d3278227a25ab7723c0f72bbca552 (diff) | |
| download | vis-08d7d23f7d27e253947ecd2bfa6334f0fdbe3ea5.tar.gz vis-08d7d23f7d27e253947ecd2bfa6334f0fdbe3ea5.tar.xz | |
view: rename view_cursors_column{,count,next}
| -rw-r--r-- | main.c | 16 | ||||
| -rw-r--r-- | view.c | 4 | ||||
| -rw-r--r-- | view.h | 4 |
3 files changed, 12 insertions, 12 deletions
@@ -1304,11 +1304,11 @@ static const char *cursors_align_indent(Vis *vis, const char *keys, const Arg *a View *view = vis_view(vis); Text *txt = vis_text(vis); bool left_align = arg->i < 0; - int columns = view_cursors_column_count(view); + int columns = view_selections_column_count(view); for (int i = 0; i < columns; i++) { int mincol = INT_MAX, maxcol = 0; - for (Cursor *c = view_cursors_column(view, i); c; c = view_cursors_column_next(c, i)) { + for (Cursor *c = view_cursors_column(view, i); c; c = view_selections_column_next(c, i)) { Filerange sel = view_selections_get(c); size_t pos = left_align ? sel.start : sel.end; int col = text_line_width_get(txt, pos); @@ -1324,7 +1324,7 @@ static const char *cursors_align_indent(Vis *vis, const char *keys, const Arg *a return keys; memset(buf, ' ', len); - for (Cursor *c = view_cursors_column(view, i); c; c = view_cursors_column_next(c, i)) { + for (Cursor *c = view_cursors_column(view, i); c; c = view_selections_column_next(c, i)) { Filerange sel = view_selections_get(c); size_t pos = left_align ? sel.start : sel.end; size_t ipos = sel.start; @@ -1418,7 +1418,7 @@ static const char *cursors_remove(Vis *vis, const char *keys, const Arg *arg) { static const char *cursors_remove_column(Vis *vis, const char *keys, const Arg *arg) { View *view = vis_view(vis); - int max = view_cursors_column_count(view); + int max = view_selections_column_count(view); int column = vis_count_get_default(vis, arg->i) - 1; if (column >= max) column = max - 1; @@ -1428,7 +1428,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); + next = view_selections_column_next(c, column); view_selections_dispose(c); } @@ -1438,7 +1438,7 @@ static const char *cursors_remove_column(Vis *vis, const char *keys, const Arg * static const char *cursors_remove_column_except(Vis *vis, const char *keys, const Arg *arg) { View *view = vis_view(vis); - int max = view_cursors_column_count(view); + int max = view_selections_column_count(view); int column = vis_count_get_default(vis, arg->i) - 1; if (column >= max) column = max - 1; @@ -1452,7 +1452,7 @@ static const char *cursors_remove_column_except(Vis *vis, const char *keys, cons for (Cursor *next; cur; cur = next) { next = view_selections_next(cur); if (cur == col) - col = view_cursors_column_next(col, column); + col = view_selections_column_next(col, column); else view_selections_dispose(cur); } @@ -1497,7 +1497,7 @@ static const char *selections_rotate(Vis *vis, const char *keys, const Arg *arg) Array arr; Text *txt = vis_text(vis); View *view = vis_view(vis); - int columns = view_cursors_column_count(view); + int columns = view_selections_column_count(view); int selections = columns == 1 ? view_selections_count(view) : columns; int count = vis_count_get_default(vis, 1); array_init_sized(&arr, sizeof(Rotate)); @@ -945,7 +945,7 @@ int view_selections_number(Cursor *c) { return c->number; } -int view_cursors_column_count(View *view) { +int view_selections_column_count(View *view) { Text *txt = view->text; int cpl_max = 0, cpl = 0; /* cursors per line */ size_t line_prev = 0; @@ -994,7 +994,7 @@ Cursor *view_cursors_column(View *view, int column) { return cursors_column_next(view, NULL, column); } -Cursor *view_cursors_column_next(Cursor *c, int column) { +Cursor *view_selections_column_next(Cursor *c, int column) { return cursors_column_next(c->view, c, column); } @@ -168,7 +168,7 @@ int view_selections_count(View*); */ int view_selections_number(Cursor*); /** Get maximal number of selections on a single line. */ -int view_cursors_column_count(View*); +int view_selections_column_count(View*); /** * Starting from the start of the text, get the `column`-th selection on a line. * @param column The zero based column index. @@ -178,7 +178,7 @@ Cursor *view_cursors_column(View*, int column); * Get the next `column`-th selection on a line. * @param column The zero based column index. */ -Cursor *view_cursors_column_next(Cursor*, int column); +Cursor *view_selections_column_next(Cursor*, int column); /** * @} * @defgroup view_cover |
