Commit 374216fe authored by Chris Allegretta's avatar Chris Allegretta
Browse files

2010-01-04 Chris Allegretta <chrisa@asty.org>

        * winio.c: edit_update, edit_redraw - Fix search not scrolling to the middle of the screen 
          (reported by alpha@qzx.com) and places where we rely on maxrows but should not.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4471 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent fc6ef3e1
Showing with 10 additions and 6 deletions
+10 -6
2010-01-04 Chris Allegretta <chrisa@asty.org>
* winio.c: edit_update, edit_redraw - Fix search not scrolling to the middle of the screen
(reported by alpha@qzx.com) and places where we rely on maxrows but should not.
2009-12-26 Jordi Mallach <jordi@gnu.org> 2009-12-26 Jordi Mallach <jordi@gnu.org>
* doc/man/nano.1: Avoid a groff warning by prepending a zero-width * doc/man/nano.1: Avoid a groff warning by prepending a zero-width
space to a line starting with '. space to a line starting with '.
......
...@@ -2935,7 +2935,7 @@ bool need_vertical_update(size_t pww_save) ...@@ -2935,7 +2935,7 @@ bool need_vertical_update(size_t pww_save)
} }
/* When edittop changes, try and figure out how many lines /* When edittop changes, try and figure out how many lines
* we really have to work with (i.e. set maxrows) * we really have to work with (i.e. set maxrows)
*/ */
void compute_maxrows(void) void compute_maxrows(void)
{ {
...@@ -3160,7 +3160,7 @@ void edit_redraw(filestruct *old_current, size_t pww_save) ...@@ -3160,7 +3160,7 @@ void edit_redraw(filestruct *old_current, size_t pww_save)
/* Put edittop in range of current, get the difference in lines /* Put edittop in range of current, get the difference in lines
* between the original edittop and the current edittop, and * between the original edittop and the current edittop, and
* then restore the original edittop. */ * then restore the original edittop. */
edit_update(NONE); edit_update(CENTER);
nlines = openfile->edittop->lineno - old_edittop->lineno; nlines = openfile->edittop->lineno - old_edittop->lineno;
...@@ -3239,7 +3239,7 @@ void edit_refresh(void) ...@@ -3239,7 +3239,7 @@ void edit_refresh(void)
/* Put the top line of the edit window in range of the current /* Put the top line of the edit window in range of the current
* line. */ * line. */
edit_update(NONE); edit_update(CENTER);
} }
foo = openfile->edittop; foo = openfile->edittop;
...@@ -3279,13 +3279,13 @@ void edit_update(update_type location) ...@@ -3279,13 +3279,13 @@ void edit_update(update_type location)
* screen as before, or at the top or bottom of the screen if * screen as before, or at the top or bottom of the screen if
* edittop is beyond either. */ * edittop is beyond either. */
if (location == CENTER) if (location == CENTER)
goal = maxrows / 2; goal = editwinrows / 2;
else { else {
goal = openfile->current_y; goal = openfile->current_y;
/* Limit goal to (editwinrows - 1) lines maximum. */ /* Limit goal to (editwinrows - 1) lines maximum. */
if (goal > maxrows - 1) if (goal > editwinrows - 1)
goal = maxrows - 1; goal = editwinrows - 1;
} }
for (; goal > 0 && foo->prev != NULL; goal--) { for (; goal > 0 && foo->prev != NULL; goal--) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment