nano

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

commit 47cfd197b8d5d97ad9f87eb17d21e30f75923a3f
parent 5b7b3e3c9c1e02c48886e78b5d9490aacb97fa93
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Mon,  2 Jan 2006 04:30:33 +0000

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

Diffstat:
MChangeLog | 8++++++++
Msrc/winio.c | 11++++-------
2 files changed, 12 insertions(+), 7 deletions(-)

diff --git 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 @@ -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;