aboutsummaryrefslogtreecommitdiff
path: root/view.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-05-02 15:54:19 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-05-04 13:47:50 +0200
commitbab79b3bbdb95579ffc7e447bed3b00f2547505c (patch)
treec05bbc6fc8c40527c1aa11b460a8f89b6db93225 /view.c
parent8f92b98848f9366e78c7aa824615bade83971513 (diff)
downloadvis-bab79b3bbdb95579ffc7e447bed3b00f2547505c.tar.gz
vis-bab79b3bbdb95579ffc7e447bed3b00f2547505c.tar.xz
vis: clean up cursor column display
Diffstat (limited to 'view.c')
-rw-r--r--view.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/view.c b/view.c
index ef9fac9..289ec18 100644
--- a/view.c
+++ b/view.c
@@ -432,18 +432,6 @@ static bool view_addch(View *view, Cell *cell) {
}
}
-CursorPos view_cursor_getpos(View *view) {
- Cursor *cursor = view->cursor;
- Line *line = cursor->line;
- CursorPos pos = { .line = line->lineno, .col = cursor->col };
- while (line->prev && line->prev->lineno == pos.line) {
- line = line->prev;
- pos.col += line->width;
- }
- pos.col++;
- return pos;
-}
-
static void cursor_to(Cursor *c, size_t pos) {
Text *txt = c->view->text;
c->mark = text_mark_set(txt, pos);
@@ -1011,6 +999,10 @@ const Line *view_lines_get(View *view) {
return view->topline;
}
+const Line *view_line_get(View *view) {
+ return view->cursor->line;
+}
+
void view_scroll_to(View *view, size_t pos) {
view_cursors_scroll_to(view->cursor, pos);
}