nano

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

commit 498154804c962a4b49494a4dcb486c2aa6dfcafa
parent 34dda6461069926ebe001392846527fa7fbd5cdb
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun,  9 Jun 2024 08:12:56 +0200

bindings: let ^L put the cursor line at center, then top, then bottom

Something similar can be achieved with:

  bind ^T "{center}{bottomrow}{center}{toprow}" main
  bind ^B "{center}{toprow}{center}{bottomrow}" main

But that requires allocating two extra shortcuts, and it works right only
when the edit window has an odd number of rows, not with an even number.
Also, this new ^L behavior is available by default, out-of-the-box.

Diffstat:
Msrc/global.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/global.c b/src/global.c @@ -1434,7 +1434,7 @@ void shortcut_init(void) add_to_sclist(MEXECUTE, "^J", 0, do_full_justify, 0); #endif #ifndef NANO_TINY - add_to_sclist(MMAIN, "^L", 0, do_center, 0); + add_to_sclist(MMAIN, "^L", 0, do_cycle, 0); #endif add_to_sclist(MMOST|MBROWSER|MHELP|MYESNO, "^L", 0, full_refresh, 0);