Commit 47bb888a authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

revert broken edit_scroll() changes for now

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2911 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 20 additions and 20 deletions
+20 -20
...@@ -36,15 +36,15 @@ CVS code - ...@@ -36,15 +36,15 @@ CVS code -
- Consistently make the flags global and any variables used to - Consistently make the flags global and any variables used to
hold it longs. (DLR) hold it longs. (DLR)
- Make edit_scroll() sophisticated enough to keep track of - Make edit_scroll() sophisticated enough to keep track of
current and current_x, update the lines before and after the current and current_x and update the lines before and after
scrolled region, and properly scroll more than editwinrows the scrolled region, and change the movement functions that
lines; and change the movement functions that use use edit_scroll() to (a) set current and current_x before
edit_scroll() to (a) set current and current_x before calling calling it, and (b) no longer call edit_redraw() afterward,
it, and (b) no longer call edit_redraw() afterward, as it's since it's now unnecessary. These changes eliminate
now unnecessary. These changes eliminate redundant screen redundant screen updates when the mark is on, since the mark
updates when the mark is on, since the mark display depends on display depends on current and current_x. Changes to
current and current_x. Changes to edit_scroll(), edit_scroll(), do_page_up(), do_page_down(), do_up(), and
do_page_up(), do_page_down(), do_up(), and do_down(). (DLR) do_down(). (DLR)
- Consistently make the fg and bg colortype struct entries and - Consistently make the fg and bg colortype struct entries and
any variables used to hold them shorts. Changes to any variables used to hold them shorts. Changes to
do_colorinit() (renamed color_init()), color_to_int() (renamed do_colorinit() (renamed color_init()), color_to_int() (renamed
......
...@@ -3496,8 +3496,9 @@ void edit_scroll(updown direction, int nlines) ...@@ -3496,8 +3496,9 @@ void edit_scroll(updown direction, int nlines)
const filestruct *foo; const filestruct *foo;
int i; int i;
/* Don't bother scrolling less than one line. */ /* Scrolling less than one line or more than editwinrows lines is
if (nlines < 1) * redundant, so don't allow it. */
if (nlines < 1 || nlines > editwinrows)
return; return;
/* Move the top line of the edit window up or down (depending on the /* Move the top line of the edit window up or down (depending on the
...@@ -3515,27 +3516,26 @@ void edit_scroll(updown direction, int nlines) ...@@ -3515,27 +3516,26 @@ void edit_scroll(updown direction, int nlines)
} }
} }
/* Scroll the text on the screen up or down nlines lines, depending
* on the value of direction. */
scrollok(edit, TRUE);
wscrl(edit, (direction == UP) ? -nlines : nlines);
scrollok(edit, FALSE);
/* If we scrolled up, we couldn't scroll up all nlines lines, and /* If we scrolled up, we couldn't scroll up all nlines lines, and
* we're now at the top of the file, we need to treat the entire * we're now at the top of the file, we need to treat the entire
* screen as the scrolled region, instead of just the top nlines * screen as the scrolled region, instead of just the top nlines
* lines. */ * lines. */
if (direction == UP && i > 0 && openfile->edittop == if (direction == UP && i > 0 && openfile->edittop ==
openfile->fileage) openfile->fileage)
nlines = editwinrows - 2; nlines = editwinrows;
/* Make nlines account for the lines before and after the scrolled /* Make nlines account for the lines before and after the scrolled
* region, if they're onscreen, and then put nlines in range of * region, if they're onsccreen. */
* editwinrows. */
nlines += 2; nlines += 2;
if (nlines > editwinrows) if (nlines > editwinrows)
nlines = editwinrows; nlines = editwinrows;
/* Scroll the text on the screen up or down nlines lines, depending
* on the value of direction. */
scrollok(edit, TRUE);
wscrl(edit, (direction == UP) ? -nlines : nlines);
scrollok(edit, FALSE);
/* If we scrolled up, we're on the line before the scrolled /* If we scrolled up, we're on the line before the scrolled
* region. */ * region. */
foo = openfile->edittop; foo = openfile->edittop;
......
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