diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-01-27 19:00:00 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-01-28 03:13:59 +0100 |
| commit | d0ed5fef6a4098a7991a7e6ab44076a423721212 (patch) | |
| tree | 1a24edf56f78a9e19d9a4a0de94ebff9f78786cc /vis-motions.c | |
| parent | 84eeabfef92559cb71233bf69db4f1b1fd4f9cd8 (diff) | |
| download | vis-d0ed5fef6a4098a7991a7e6ab44076a423721212.tar.gz vis-d0ed5fef6a4098a7991a7e6ab44076a423721212.tar.xz | |
vis: clean up count handling
There are cases where zero can also be a legitimate count.
Diffstat (limited to 'vis-motions.c')
| -rw-r--r-- | vis-motions.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vis-motions.c b/vis-motions.c index 399d51d..3278546 100644 --- a/vis-motions.c +++ b/vis-motions.c @@ -90,15 +90,15 @@ static size_t till_left(Vis *vis, Text *txt, size_t pos) { } static size_t line(Vis *vis, Text *txt, size_t pos) { - return text_pos_by_lineno(txt, vis->action.count); + return text_pos_by_lineno(txt, vis_count_get_default(vis, 1)); } static size_t column(Vis *vis, Text *txt, size_t pos) { - return text_line_offset(txt, pos, vis->action.count); + return text_line_offset(txt, pos, vis_count_get_default(vis, 0)); } static size_t view_lines_top(Vis *vis, View *view) { - return view_screenline_goto(view, vis->action.count); + return view_screenline_goto(view, vis_count_get_default(vis, 1)); } static size_t view_lines_middle(Vis *vis, View *view) { @@ -108,7 +108,7 @@ static size_t view_lines_middle(Vis *vis, View *view) { static size_t view_lines_bottom(Vis *vis, View *view) { int h = view_height_get(vis->win->view); - return view_screenline_goto(vis->win->view, h - vis->action.count); + return view_screenline_goto(vis->win->view, h - vis_count_get_default(vis, 0)); } static size_t window_changelist_next(Vis *vis, Win *win, size_t pos) { |
