nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit b55e382dfc0d7346f7df72eeee10e76370415902
parent 3af54d3ff5de8098e85365c868bd9441072991ab
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Wed, 25 Feb 2004 06:25:12 +0000

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

Diffstat:
MChangeLog | 6------
Msrc/winio.c | 13+++++++------
2 files changed, 7 insertions(+), 12 deletions(-)

diff --git 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 @@ -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); } }