aboutsummaryrefslogtreecommitdiff
path: root/view.c
diff options
context:
space:
mode:
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);
}