nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 83629b999189f507761d1efe697e622ec089869d
parent 405c66e86447f396a7ee59e8badeea009883b7d3
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu, 11 Aug 2022 08:17:35 +0200

startup: ensure that +/string centers the match also with --linenumbers

When confirm_margin() first sets the margin needed for the requested
line numbers, also then it needs to keep 'focusing' TRUE.  Only when
actually toggling --linenumbers ON (from a zero margin to something)
should focusing be suppressed, in order to obtain smooth scrolling
when the cursor is pushed off-screen.

This fixes https://savannah.gnu.org/bugs/?62885.

Bug existed since version 4.4, since the search-at-startup feature
was introduced.

Diffstat:
Msrc/nano.c | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -2521,6 +2521,11 @@ int main(int argc, char **argv) statusbar(_("Welcome to nano. For basic help, type Ctrl+G.")); #endif +#ifdef ENABLE_LINENUMBERS + /* Set the margin to an impossible value to force re-evaluation. */ + margin = 12345; +#endif + we_are_running = TRUE; while (TRUE) {