• Benno Schulenberg's avatar
    scrolling: center the cursor when inserted stuff does not fit on screen · 318ed6b1
    Benno Schulenberg authored
    Since nano-2.4.1, reading in or pasting a large piece of text would put
    the cursor on the bottom line, leaving only one line of the non-read or
    non-pasted text visible.  This is different from the centering behavior
    of Pico, and somewhat disorienting, as you can't see "where you are" any
    more in relation to the file as it was.
    
    So now center the cursor whenever the read or pasted text is larger than
    the screen, but don't center it when the text fits entirely on the screen.
    (The latter avoids the effect of the screen jumping unnecessarily when
    inserting just a few lines while the cursor is near the bottom.)
    
    To achieve this behavior: default to focusing, and temporarily set it to
    FALSE when the focusing effect is unwanted.
    
    This fixes https://savannah.gnu.org/bugs/?47841.
    318ed6b1
move.c 16.8 KB