• David Lawrence Ramsey's avatar
    softwrap: iterate through softwrapped chunks better in do_mouse() · 52087408
    David Lawrence Ramsey authored
    Use go_back_chunks() and go_forward_chunks() to move from the row
    current_y is on to the row mouse_row is on.  Now softwrap mode and
    non-softwrap mode will behave the same way when we can scroll edittop
    partially off the screen, which is forthcoming.  Accordingly, remove
    the call to ensure_line_is_visible(), as it no longer applies.
    
    The old code did work, but it behaved differently between softwrap mode
    (which counted down from edittop) and non-softwrap mode (which counted
    up or down from current_y to take less time, and used a double loop to
    keep current from going to NULL).
    
    The new code counts up or down from current_y in both softwrap mode and
    non-softwrap mode.  In non-softwrap mode, it also avoids the double loop,
    since go_back_chunks() and go_forward_chunks() keep the filestructs they
    operate on from going to NULL.
    52087408
nano.c 72.1 KB