aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-01-13 19:48:04 +0100
committerMarc André Tanner <mat@brain-dump.org>2015-01-13 23:01:47 +0100
commit07da176189e45f835acb2a1aca71918b7dd3e38e (patch)
tree7f085bb7c0749528c4166d885dff453e512f99a0 /vis.c
parentff587fb25a56656a9a426a5086b47a5cf891092b (diff)
downloadvis-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.
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c10
1 files changed, 2 insertions, 8 deletions
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) {