From: Benno Schulenberg Date: Mon, 17 Mar 2014 13:15:50 +0000 (+0000) Subject: Removing the old softwrap scrolling code. X-Git-Tag: v2.3.3~282 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=a8353bdfff79c13b490f577806ae39816294a02f;p=nano.git Removing the old softwrap scrolling code. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4648 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index bcee17de..d7a558db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 * src/nano.h - Display more help items when the terminal is wider. diff --git a/src/winio.c b/src/winio.c index b5505f28..d2544bcf 100644 --- a/src/winio.c +++ b/src/winio.c @@ -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. */