From: David Lawrence Ramsey Date: Wed, 25 Feb 2004 06:25:12 +0000 (+0000) Subject: move the leaveok() calls back to edit_refresh() from update_line() X-Git-Tag: v1.3.2~38 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=b55e382dfc0d7346f7df72eeee10e76370415902;p=nano.git move the leaveok() calls back to edit_refresh() from update_line() git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1666 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 7a702d0d..73f0a01e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -179,14 +179,8 @@ CVS code - the "$" on subsequent pages. (DLR) reset_cursor() - Tweak for efficiency. (David Benbennick) - update_line() - - Move leaveok() calls here from edit_refresh(), since the - places where they were used in edit_refresh() mainly affected - the update_line()s. (DLR) edit_refresh() - Tweak for efficiency. (David Benbennick) - - Remove the aforementioned leaveok() calls from this function. - (DLR) do_credits() - Use nanosleep() instead of usleep(). The latter is only standard under BSD, whereas the former is POSIX compliant. diff --git a/src/winio.c b/src/winio.c index c33a2ecb..27ad4edf 100644 --- a/src/winio.c +++ b/src/winio.c @@ -1875,9 +1875,6 @@ void update_line(const filestruct *fileptr, size_t index) if (line < 0 || line >= editwinrows) return; - /* Don't make the cursor jump around the screen while updating. */ - leaveok(edit, TRUE); - /* First, blank out the line (at a minimum) */ mvwaddstr(edit, line, 0, hblank); @@ -1898,9 +1895,6 @@ void update_line(const filestruct *fileptr, size_t index) mvwaddch(edit, line, 0, '$'); if (strlenpt(fileptr->data) > page_start + COLS) mvwaddch(edit, line, COLS - 1, '$'); - - /* Let the cursor jump around the screen again. */ - leaveok(edit, FALSE); } /* This function updates current, based on where current_y is; @@ -1957,6 +1951,10 @@ void edit_refresh(void) fprintf(stderr, "edit_refresh(): edittop->lineno = %ld\n", edittop->lineno); #endif + /* Don't let the cursor jump around the screen while + * updating. */ + leaveok(edit, TRUE); + while (nlines < editwinrows) { update_line(foo, current_x); nlines++; @@ -1972,6 +1970,9 @@ void edit_refresh(void) /* What the hell are we expecting to update the screen if this * isn't here? Luck? */ wrefresh(edit); + + /* Let the cursor jump around the screen again. */ + leaveok(edit, FALSE); } }