From d0ed5fef6a4098a7991a7e6ab44076a423721212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 27 Jan 2016 19:00:00 +0100 Subject: vis: clean up count handling There are cases where zero can also be a legitimate count. --- vis-motions.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vis-motions.c') 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) { -- cgit v1.2.3