^L double binding in MMAIN

Peter Michaux <[email protected]> Sun, 27 Apr 2025 11:17:16 -0700
Newsgroups gmane.editors.nano.devel
Message-ID <CAG0y48D698pO4uBqejh3CJCp8=AG_s=M_7=PWdF--GQ-Q1Jvaw@mail.gmail.com>
There is a default configuration issue in MMAIN for keybinding ^L.

In the main help bar, ^L appears twice at the far right end:

    F12 Spell Check    ^L Cycle
    ^L Refresh         ^S Save

In the main help viewer, the two relevant lines are:

    ^L    Refresh (redraw) the current screen

    ^L    Push the cursor line to the center, then top, then bottom

In both cases, "refresh" is listed before "cycle." A user reading
the help will likely see the "refresh" binding first and stop
reading with the conclusion that ^L is bound to screen refresh.
Even if the reader does not stop reading on first encounter, ^L
should not be bound to two functions.

In practice, ^L actually triggers do_cycle in the MMAIN context.

global.c contains the following four lines.

    #ifndef NANO_TINY
        add_to_sclist(MMAIN, "^L", 0, do_cycle, 0);
    #endif
        add_to_sclist(MMOST|MBROWSER|MHELP|MYESNO, "^L", 0, full_refresh, 0);

From this code, it appears the general intention was for ^L to remain
consistently bound to full_refresh throughout Nano. This consistency
would be more intuitive for users. ^L is also bound to refresh in
other programs.

Removing the binding of ^L to do_cycle in MMAIN or changing
the binding to a different combination of keys would be a bugfix
or an enhancement. Either way, a modification to the binding
appears to be needed.

Peter