From 8b7bbebeeb5b021434c19d24f82e1cc798ebe53f Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 19 Mar 2017 18:01:43 +0100 Subject: [PATCH] tweaks: add a warning for a condition that should never occur --- src/winio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/winio.c b/src/winio.c index 0b2abcbb..0d591497 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2667,8 +2667,11 @@ int update_line(filestruct *fileptr, size_t index) row = fileptr->lineno - openfile->edittop->lineno; /* If the line is offscreen, don't even try to display it. */ - if (row < 0 || row >= editwinrows) + if (row < 0 || row >= editwinrows) { + statusline(ALERT, "Badness: tried to display a chunk on row %i" + " -- please report a bug", row); return 0; + } /* First, blank out the row. */ blank_row(edit, row, 0, COLS);