aboutsummaryrefslogtreecommitdiff
path: root/vis-prompt.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-03-10 20:53:47 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-03-10 22:36:54 +0100
commit5e632554d9bf7ea48783702ea59585639e1797bf (patch)
tree5691f504dd0c9974d1579469094a9c1fc2b24967 /vis-prompt.c
parent5f8760a614e11dc2f665ed4a23309875a6af61df (diff)
downloadvis-5e632554d9bf7ea48783702ea59585639e1797bf.tar.gz
vis-5e632554d9bf7ea48783702ea59585639e1797bf.tar.xz
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.
Diffstat (limited to 'vis-prompt.c')
-rw-r--r--vis-prompt.c3
1 files changed, 2 insertions, 1 deletions
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;