From 40b9e68e02522df3d29941ab89b027d84435795f Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 4 Sep 2022 10:40:17 +0200 Subject: [PATCH] goto: don't center the current line when the user specified a column only This does not quite do what I would have liked (scroll only when needed) when on a softwrapped line and jumping to a different chunk, but... it's still better than needlessly centering the line. (The user can still center the line, if that is what they want, by using a period or a slash instead of a comma.) This addresses https://savannah.gnu.org/bugs/?63008. --- src/search.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/search.c b/src/search.c index 4d12138f..d759668b 100644 --- a/src/search.c +++ b/src/search.c @@ -829,9 +829,9 @@ void goto_line_and_column(ssize_t line, ssize_t column, bool retain_answer, openfile->placewewant = breadth(openfile->current->data); #endif - /* When the position was manually given, center the target line. */ + /* When a line number was manually given, center the target line. */ if (interactive) { - adjust_viewport(CENTERING); + adjust_viewport((*answer == ',') ? STATIONARY : CENTERING); refresh_needed = TRUE; } else { int rows_from_tail;