diff options
| -rw-r--r-- | vis.c | 16 | ||||
| -rw-r--r-- | window.c | 16 | ||||
| -rw-r--r-- | window.h | 12 |
3 files changed, 22 insertions, 22 deletions
@@ -281,11 +281,11 @@ static size_t window_lines_middle(const Arg *arg); static size_t window_lines_bottom(const Arg *arg); static Movement moves[] = { - [MOVE_SCREEN_LINE_UP] = { .win = window_line_up }, - [MOVE_SCREEN_LINE_DOWN] = { .win = window_line_down }, - [MOVE_SCREEN_LINE_BEGIN] = { .win = window_line_begin, .type = CHARWISE }, - [MOVE_SCREEN_LINE_MIDDLE] = { .win = window_line_middle, .type = CHARWISE }, - [MOVE_SCREEN_LINE_END] = { .win = window_line_end, .type = CHARWISE|INCLUSIVE }, + [MOVE_SCREEN_LINE_UP] = { .win = window_screenline_up }, + [MOVE_SCREEN_LINE_DOWN] = { .win = window_screenline_down }, + [MOVE_SCREEN_LINE_BEGIN] = { .win = window_screenline_begin, .type = CHARWISE }, + [MOVE_SCREEN_LINE_MIDDLE] = { .win = window_screenline_middle, .type = CHARWISE }, + [MOVE_SCREEN_LINE_END] = { .win = window_screenline_end, .type = CHARWISE|INCLUSIVE }, [MOVE_LINE_PREV] = { .txt = text_line_prev, .type = LINEWISE }, [MOVE_LINE_BEGIN] = { .txt = text_line_begin, .type = LINEWISE }, [MOVE_LINE_START] = { .txt = text_line_start, .type = LINEWISE }, @@ -789,15 +789,15 @@ static size_t column(const Arg *arg) { } static size_t window_lines_top(const Arg *arg) { - return window_line_goto(vis->win->win, action.count); + return window_screenline_goto(vis->win->win, action.count); } static size_t window_lines_middle(const Arg *arg) { - return window_line_goto(vis->win->win, vis->win->height / 2); + return window_screenline_goto(vis->win->win, vis->win->height / 2); } static size_t window_lines_bottom(const Arg *arg) { - return window_line_goto(vis->win->win, vis->win->height - action.count); + return window_screenline_goto(vis->win->win, vis->win->height - action.count); } /** key bindings functions of type: void (*func)(const Arg*) */ @@ -748,7 +748,7 @@ size_t window_slide_up(Win *win, int lines) { else window_cursor_to(win, cursor->pos); } else { - window_line_down(win); + window_screenline_down(win); } return cursor->pos; } @@ -761,7 +761,7 @@ size_t window_slide_down(Win *win, int lines) { else window_cursor_to(win, cursor->pos); } else { - window_line_up(win); + window_screenline_up(win); } return cursor->pos; } @@ -788,7 +788,7 @@ size_t window_scroll_down(Win *win, int lines) { return cursor->pos; } -size_t window_line_up(Win *win) { +size_t window_screenline_up(Win *win) { Cursor *cursor = &win->cursor; if (!cursor->line->prev) window_scroll_up(win, 1); @@ -797,7 +797,7 @@ size_t window_line_up(Win *win) { return cursor->pos; } -size_t window_line_down(Win *win) { +size_t window_screenline_down(Win *win) { Cursor *cursor = &win->cursor; if (!cursor->line->next && cursor->line == win->bottomline) window_scroll_down(win, 1); @@ -806,16 +806,16 @@ size_t window_line_down(Win *win) { return cursor->pos; } -size_t window_line_begin(Win *win) { +size_t window_screenline_begin(Win *win) { return window_cursor_set(win, win->cursor.line, 0); } -size_t window_line_middle(Win *win) { +size_t window_screenline_middle(Win *win) { Cursor *cursor = &win->cursor; return window_cursor_set(win, cursor->line, cursor->line->width / 2); } -size_t window_line_end(Win *win) { +size_t window_screenline_end(Win *win) { Cursor *cursor = &win->cursor; int col = cursor->line->width - 1; return window_cursor_set(win, cursor->line, col >= 0 ? col : 0); @@ -920,7 +920,7 @@ void window_cursor_watch(Win *win, void (*cursor_moved)(Win*, void *), void *dat win->cursor_moved_data = data; } -size_t window_line_goto(Win *win, int n) { +size_t window_screenline_goto(Win *win, int n) { size_t pos = win->start; for (Line *line = win->topline; --n > 0 && line != win->lastline; line = line->next) pos += line->len; @@ -36,11 +36,11 @@ void window_tabwidth_set(Win*, int tabwidth); * they return new cursor postion */ size_t window_char_next(Win*); size_t window_char_prev(Win*); -size_t window_line_down(Win*); -size_t window_line_up(Win*); -size_t window_line_begin(Win*); -size_t window_line_middle(Win*); -size_t window_line_end(Win*); +size_t window_screenline_down(Win*); +size_t window_screenline_up(Win*); +size_t window_screenline_begin(Win*); +size_t window_screenline_middle(Win*); +size_t window_screenline_end(Win*); /* move window content up/down, but keep cursor position unchanged unless it is * on a now invisible line in which case we try to preserve the column position */ size_t window_slide_up(Win*, int lines); @@ -50,7 +50,7 @@ size_t window_slide_down(Win*, int lines); size_t window_scroll_up(Win*, int lines); size_t window_scroll_down(Win*, int lines); /* place the cursor at the start ot the n-th window line, counting from 1 */ -size_t window_line_goto(Win*, int n); +size_t window_screenline_goto(Win*, int n); /* get cursor position in bytes from start of the file */ size_t window_cursor_get(Win*); |
