From 728895d5540af3775574a96a52bdc20db1303455 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 25 Feb 2016 13:08:19 +0100 Subject: [PATCH 3/3] Center the cursor when showing replacement candidates that were offscreen. (This fuses revisions 5641, 5642, and 5650 from SVN.) Signed-off-by: Benno Schulenberg --- src/search.c | 1 + src/winio.c | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/search.c b/src/search.c index 9d63f7b..014b111 100644 --- a/src/search.c +++ b/src/search.c @@ -708,6 +708,7 @@ ssize_t do_replace_loop( xpt, strnlenpt(openfile->current->data, openfile->current_x + match_len) - xpt, FALSE); + /* Refresh the edit window, scrolling it if necessary. */ edit_refresh(); /* Don't show cursor, to not distract from highlighted match. */ diff --git a/src/winio.c b/src/winio.c index 2bfb7bf..22e5c53 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2999,7 +2999,7 @@ void edit_refresh(void) #endif /* Make sure the current line is on the screen. */ - edit_update(ISSET(SMOOTH_SCROLL) ? NONE : CENTER); + edit_update((ISSET(SMOOTH_SCROLL) && !focusing) ? NONE : CENTER); } foo = openfile->edittop; -- 1.7.0.4