nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 6e3adf31b80a8167c26ef399a2191fed10e85e30
parent c67c4312395c5e87f067c416ecd087924582c817
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Wed, 28 Dec 2016 10:22:05 -0600

tweaks: let update_line() return the correct value on error

If the given line is out of range of editwinrows, we don't display it
at all, so we obviously don't display more than one line of it.  Thus,
the return value in this case should be zero, not one.

Diffstat:
Msrc/winio.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/winio.c b/src/winio.c @@ -2683,8 +2683,9 @@ int update_line(filestruct *fileptr, size_t index) #endif row = fileptr->lineno - openfile->edittop->lineno; + /* If the line is offscreen, don't even try to display it. */ if (row < 0 || row >= editwinrows) - return 1; + return 0; /* First, blank out the row. */ blank_row(edit, row, 0, COLS);