From 07da176189e45f835acb2a1aca71918b7dd3e38e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 13 Jan 2015 19:48:04 +0100 Subject: Cleanup nn| implementation This command does not really do what it advertises because it operates on bytes not columns. --- vis.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'vis.c') diff --git a/vis.c b/vis.c index e32835e..d2d37fa 100644 --- a/vis.c +++ b/vis.c @@ -784,14 +784,8 @@ static size_t line(const Arg *arg) { } static size_t column(const Arg *arg) { - char c; - EditorWin *win = vis->win; - size_t pos = window_cursor_get(win->win); - Iterator it = text_iterator_get(win->text, text_line_begin(win->text, pos)); - int count = action.count; - while (count > 0 && text_iterator_byte_get(&it, &c) && c != '\n') - text_iterator_byte_next(&it, NULL); - return it.pos; + size_t pos = window_cursor_get(vis->win->win); + return text_line_offset(vis->win->text, pos, action.count); } static size_t window_lines_top(const Arg *arg) { -- cgit v1.2.3