From 9875311bcc73904991a3f368993cd367288607d8 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 17 Oct 2022 11:54:23 +0200 Subject: [PATCH] startup: for +/string, center the found occurrence when possible This places the cursor in a more predictable position. This fixes https://savannah.gnu.org/bugs/?63223. Issue existed since version 4.4, commit a9dd73fb, since the +/string feature was introduced. --- src/nano.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nano.c b/src/nano.c index 13dec9a4..091d3ca7 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2492,6 +2492,7 @@ int main(int argc, char **argv) else if (lastmessage <= REMARK) wipe_statusbar(); openfile->placewewant = xplustabs(); + adjust_viewport(CENTERING); if (ISSET(USE_REGEXP)) tidy_up_after_search(); free(last_search);