tweaks: conditionalize a bit of softwrap code
This addresses https://savannah.gnu.org/bugs/?49803.master
parent
6263416355
commit
c8c6340ce8
14
src/winio.c
14
src/winio.c
|
@ -2804,18 +2804,15 @@ bool need_horizontal_scroll(const size_t old_column, const size_t new_column)
|
|||
return (get_page_start(old_column) != get_page_start(new_column));
|
||||
}
|
||||
|
||||
/* When edittop changes, try and figure out how many lines
|
||||
* we really have to work with (i.e. set maxrows). */
|
||||
/* When edittop changes, try and figure out how many lines we really
|
||||
* have to work with, accounting for softwrap mode. */
|
||||
void compute_maxrows(void)
|
||||
{
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(SOFTWRAP)) {
|
||||
int n;
|
||||
filestruct *foo = openfile->edittop;
|
||||
|
||||
if (!ISSET(SOFTWRAP)) {
|
||||
maxrows = editwinrows;
|
||||
return;
|
||||
}
|
||||
|
||||
maxrows = 0;
|
||||
for (n = 0; n < editwinrows && foo; n++) {
|
||||
maxrows++;
|
||||
|
@ -2829,6 +2826,9 @@ void compute_maxrows(void)
|
|||
#ifdef DEBUG
|
||||
fprintf(stderr, "compute_maxrows(): maxrows = %d\n", maxrows);
|
||||
#endif
|
||||
} else
|
||||
#endif /* !NANO_TINY */
|
||||
maxrows = editwinrows;
|
||||
}
|
||||
|
||||
/* Scroll the edit window in the given direction and the given number
|
||||
|
|
Loading…
Reference in New Issue