moving: determine the correct leftedge when paging up/down too

The change in commit 244a503d for the <Up> and <Down> keys
needs to be done for <PageUp> and <PageDown> too.
This commit is contained in:
David Lawrence Ramsey 2017-03-27 15:50:46 -05:00 committed by Benno Schulenberg
parent 644fedcb61
commit d01756bb69

View File

@ -65,7 +65,12 @@ void do_page_up(void)
#ifndef NANO_TINY
if (ISSET(SOFTWRAP)) {
leftedge = (openfile->placewewant / editwincols) * editwincols;
size_t realspan = strlenpt(openfile->current->data);
if (openfile->placewewant < realspan)
realspan = openfile->placewewant;
leftedge = (realspan / editwincols) * editwincols;
target_column = openfile->placewewant % editwincols;
} else
#endif
@ -103,7 +108,12 @@ void do_page_down(void)
#ifndef NANO_TINY
if (ISSET(SOFTWRAP)) {
leftedge = (openfile->placewewant / editwincols) * editwincols;
size_t realspan = strlenpt(openfile->current->data);
if (openfile->placewewant < realspan)
realspan = openfile->placewewant;
leftedge = (realspan / editwincols) * editwincols;
target_column = openfile->placewewant % editwincols;
} else
#endif