From b9007ca88b5a57a1660c85c895a117ef15c04fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Fri, 15 Apr 2016 22:13:10 +0200 Subject: view: add view_cursors_place(cursor, line, col) function --- view.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'view.c') diff --git a/view.c b/view.c index 9cc568c..875185e 100644 --- a/view.c +++ b/view.c @@ -1324,6 +1324,13 @@ void view_cursors_to(Cursor *c, size_t pos) { cursor_to(c, pos); } +void view_cursors_place(Cursor *c, size_t line, size_t col) { + Text *txt = c->view->text; + size_t pos = text_pos_by_lineno(txt, line); + pos = text_line_char_set(txt, pos, col); + view_cursors_to(c, pos); +} + void view_cursors_selection_start(Cursor *c) { if (c->sel) return; -- cgit v1.2.3