Skip to content

Commit

Permalink
view: rename view_cursors_number
Browse files Browse the repository at this point in the history
  • Loading branch information
martanne committed Jun 15, 2017
1 parent a91e705 commit 742fb8b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion view.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ int view_selections_count(View *view) {
return view->cursor_count;
}

int view_cursors_number(Cursor *c) {
int view_selections_number(Cursor *c) {
return c->number;
}

Expand Down
2 changes: 1 addition & 1 deletion view.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ int view_selections_count(View*);
* to remain the same.
* @endrst
*/
int view_cursors_number(Cursor*);
int view_selections_number(Cursor*);
/** Get maximal number of selections on a single line. */
int view_cursors_column_count(View*);
/**
Expand Down
4 changes: 2 additions & 2 deletions vis-lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static void window_status_update(Vis *vis, Win *win) {
int cursor_count = view_selections_count(view);
if (cursor_count > 1) {
Cursor *c = view_selections_primary_get(view);
int cursor_number = view_cursors_number(c) + 1;
int cursor_number = view_selections_number(c) + 1;
snprintf(right_parts[right_count], sizeof(right_parts[right_count])-1,
"%d/%d", cursor_number, cursor_count);
right_count++;
Expand Down Expand Up @@ -1859,7 +1859,7 @@ static int window_cursor_index(lua_State *L) {
}

if (strcmp(key, "number") == 0) {
lua_pushunsigned(L, view_cursors_number(cur)+1);
lua_pushunsigned(L, view_selections_number(cur)+1);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion vis.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ void vis_do(Vis *vis) {
.newpos = EPOS,
.range = text_range_empty(),
.reg = reg,
.reg_slot = reg_slot == EPOS ? (size_t)view_cursors_number(cursor) : reg_slot,
.reg_slot = reg_slot == EPOS ? (size_t)view_selections_number(cursor) : reg_slot,
.linewise = linewise,
.arg = &a->arg,
.context = a->op ? a->op->context : NULL,
Expand Down

0 comments on commit 742fb8b

Please sign in to comment.