mirror of
git://git.sv.gnu.org/nano.git
synced 2025-01-04 00:24:26 +03:00
Removing the old softwrap scrolling code.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4648 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
e34ac8e11d
commit
a8353bdfff
@ -4,6 +4,7 @@
|
|||||||
* src/global.c (shortcut_init) - Remove some inconsistent spaces
|
* src/global.c (shortcut_init) - Remove some inconsistent spaces
|
||||||
and newlines, condense three statements into one, place an #endif
|
and newlines, condense three statements into one, place an #endif
|
||||||
better, melt two #ifndefs into one, and add a comment.
|
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>
|
2014-03-16 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/nano.h - Display more help items when the terminal is wider.
|
* src/nano.h - Display more help items when the terminal is wider.
|
||||||
|
34
src/winio.c
34
src/winio.c
@ -2983,8 +2983,8 @@ void compute_maxrows(void)
|
|||||||
* also assume that scrollok(edit) is FALSE. */
|
* also assume that scrollok(edit) is FALSE. */
|
||||||
void edit_scroll(scroll_dir direction, ssize_t nlines)
|
void edit_scroll(scroll_dir direction, ssize_t nlines)
|
||||||
{
|
{
|
||||||
|
ssize_t i;
|
||||||
filestruct *foo;
|
filestruct *foo;
|
||||||
ssize_t i, extracuzsoft = 0;
|
|
||||||
bool do_redraw = FALSE;
|
bool do_redraw = FALSE;
|
||||||
|
|
||||||
/* Don't bother scrolling less than one line. */
|
/* 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))
|
if (need_vertical_update(0))
|
||||||
do_redraw = TRUE;
|
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
|
/* Part 1: nlines is the number of lines we're going to scroll the
|
||||||
* text of the edit window. */
|
* text of the edit window. */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user