From 5e632554d9bf7ea48783702ea59585639e1797bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 10 Mar 2016 20:53:47 +0100 Subject: view: clean up API functions related to primary cursor handling The currently visible display port is always adjusted in a way that the primary cursor is visible. --- vis-prompt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vis-prompt.c') diff --git a/vis-prompt.c b/vis-prompt.c index 42b1a2c..e9f8277 100644 --- a/vis-prompt.c +++ b/vis-prompt.c @@ -164,7 +164,8 @@ void vis_prompt_show(Vis *vis, const char *title) { view_options_set(prompt->view, UI_OPTION_ONELINE); Text *txt = prompt->file->text; text_insert(txt, text_size(txt), title, strlen(title)); - view_cursors_scroll_to(view_cursor(prompt->view), text_size(txt)); + Cursor *cursor = view_cursors_primary_get(prompt->view); + view_cursors_scroll_to(cursor, text_size(txt)); view_draw(prompt->view); prompt->parent = active; prompt->parent_mode = vis->mode; -- cgit v1.2.3