From af90f03ac5d8904cb004b7495a50224896dd6ccf Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 23 Apr 2021 12:04:19 +0200 Subject: [PATCH] tweaks: condense three comments, drop another, and rewrap a line --- src/winio.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/winio.c b/src/winio.c index b3fdf2f3..16c71fae 100644 --- a/src/winio.c +++ b/src/winio.c @@ -3288,14 +3288,11 @@ size_t actual_last_column(size_t leftedge, size_t column) return leftedge + column; } -/* Return TRUE if current[current_x] is above the top of the screen, and FALSE - * otherwise. */ +/* Return TRUE if current[current_x] is before the viewport. */ bool current_is_above_screen(void) { #ifndef NANO_TINY if (ISSET(SOFTWRAP)) - /* The cursor is above screen when current[current_x] is before edittop - * at column firstcolumn. */ return (openfile->current->lineno < openfile->edittop->lineno || (openfile->current->lineno == openfile->edittop->lineno && xplustabs() < openfile->firstcolumn)); @@ -3304,8 +3301,7 @@ bool current_is_above_screen(void) return (openfile->current->lineno < openfile->edittop->lineno); } -/* Return TRUE if current[current_x] is below the bottom of the screen, and - * FALSE otherwise. */ +/* Return TRUE if current[current_x] is beyond the viewport. */ bool current_is_below_screen(void) { #ifndef NANO_TINY @@ -3318,16 +3314,14 @@ bool current_is_below_screen(void) return (go_forward_chunks(editwinrows - 1, &line, &leftedge) == 0 && (line->lineno < openfile->current->lineno || (line->lineno == openfile->current->lineno && - leftedge < leftedge_for(xplustabs(), - openfile->current)))); + leftedge < leftedge_for(xplustabs(), openfile->current)))); } else #endif return (openfile->current->lineno >= openfile->edittop->lineno + editwinrows); } -/* Return TRUE if current[current_x] is offscreen relative to edittop, and - * FALSE otherwise. */ +/* Return TRUE if current[current_x] is outside the viewport. */ bool current_is_offscreen(void) { return (current_is_above_screen() || current_is_below_screen());