Removing the old softwrap scrolling code.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4648 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2014-03-17 13:15:50 +00:00
parent e34ac8e11d
commit a8353bdfff
2 changed files with 2 additions and 33 deletions

View File

@ -4,6 +4,7 @@
* src/global.c (shortcut_init) - Remove some inconsistent spaces
and newlines, condense three statements into one, place an #endif
better, melt two #ifndefs into one, and add a comment.
* src/winio.c (edit_scroll) - Remove the old softwrap scrolling code.
2014-03-16 Benno Schulenberg <bensberg@justemail.net>
* src/nano.h - Display more help items when the terminal is wider.

View File

@ -2983,8 +2983,8 @@ void compute_maxrows(void)
* also assume that scrollok(edit) is FALSE. */
void edit_scroll(scroll_dir direction, ssize_t nlines)
{
ssize_t i;
filestruct *foo;
ssize_t i, extracuzsoft = 0;
bool do_redraw = FALSE;
/* Don't bother scrolling less than one line. */
@ -2994,38 +2994,6 @@ void edit_scroll(scroll_dir direction, ssize_t nlines)
if (need_vertical_update(0))
do_redraw = TRUE;
/* If using soft wrapping, we want to scroll down enough to display the entire next
line, if possible... */
/* DEFEAT the extracuzsoft computation for now; the amount should be okay already. */
if (FALSE && ISSET(SOFTWRAP) && direction == DOWN_DIR) {
#ifdef DEBUG
fprintf(stderr, "Softwrap: Entering check for extracuzsoft\n");
#endif
for (i = maxrows, foo = openfile->edittop; foo && i > 0; i--, foo = foo->next)
;
if (foo) {
extracuzsoft += strlenpt(foo->data) / COLS;
#ifdef DEBUG
fprintf(stderr, "Setting extracuzsoft to %lu due to strlen %lu of line %lu\n", (unsigned long) extracuzsoft,
(unsigned long) strlenpt(foo->data), (unsigned long) foo->lineno);
#endif
/* Now account for whether the edittop line itself is >COLS, if scrolling down */
for (foo = openfile->edittop; foo && extracuzsoft > 0; nlines++) {
extracuzsoft -= 1 + strlenpt(foo->data) / COLS;
#ifdef DEBUG
fprintf(stderr, "Edittop adjustment, setting nlines to %lu\n", (unsigned long) nlines);
#endif
if (foo == openfile->filebot)
break;
foo = foo->next;
}
}
}
/* Part 1: nlines is the number of lines we're going to scroll the
* text of the edit window. */