diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-01-13 19:48:04 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-01-13 23:01:47 +0100 |
| commit | 07da176189e45f835acb2a1aca71918b7dd3e38e (patch) | |
| tree | 7f085bb7c0749528c4166d885dff453e512f99a0 | |
| parent | ff587fb25a56656a9a426a5086b47a5cf891092b (diff) | |
| download | vis-07da176189e45f835acb2a1aca71918b7dd3e38e.tar.gz vis-07da176189e45f835acb2a1aca71918b7dd3e38e.tar.xz | |
Cleanup nn| implementation
This command does not really do what it advertises because
it operates on bytes not columns.
| -rw-r--r-- | vis.c | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -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) { |
