From 47cfd197b8d5d97ad9f87eb17d21e30f75923a3f Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Mon, 2 Jan 2006 04:30:33 +0000 Subject: [PATCH] in edit_scroll(), redraw the lines before and after the scrolled region even if the scrolled region was only one line; this fixes a display problem that occurs after doing a search that scrolls the screen down one line and leaves the cursor on the last line of the screen, in which case we need to update the line after the scrolled region git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3254 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 8 ++++++++ src/winio.c | 11 ++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6ae09732..c0114395 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,14 @@ CVS code - - Miscellaneous comment fixes. (DLR) - Remove unnecessary #ifdef around termios.h #include in nano.c. (DLR) +- winio.c: + edit_scroll() + - Redraw the lines before and after the scrolled region even if + the scrolled region was only one line. This fixes a display + problem that occurs after doing a search that scrolls the + screen down one line and leaves the cursor on the last line of + the screen, in which case we need to update the line after the + scrolled region. (DLR) GNU nano 1.3.10 - 2005.12.23 - General: diff --git a/src/winio.c b/src/winio.c index e7b4b92d..03c4961e 100644 --- a/src/winio.c +++ b/src/winio.c @@ -3,7 +3,7 @@ * winio.c * * * * Copyright (C) 1999-2004 Chris Allegretta * - * Copyright (C) 2005 David Lawrence Ramsey * + * Copyright (C) 2005-2006 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -2702,12 +2702,9 @@ void edit_scroll(scroll_dir direction, ssize_t nlines) 1 >= openfile->filebot->lineno)) nlines = editwinrows; - /* If the scrolled region contains only one line, and the line - * before it is visible in the edit window, we need to draw it too. - * If the scrolled region contains more than one line, and the lines - * before and after the scrolled region are visible in the edit - * window, we need to draw them too. */ - nlines += (nlines == 1) ? 1 : 2; + /* If the lines before and after the scrolled region are visible in + * the edit window, we need to draw them too. */ + nlines += 2; if (nlines > editwinrows) nlines = editwinrows; -- 2.39.5