From 07d3febe1b981ba632999c8282036ee4c27ec266 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Fri, 16 Apr 2004 05:15:11 +0000 Subject: [PATCH] remove apparently unneeded leaveok() calls per DB's patch, and make a few cosmetic cleanups git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1712 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 2 ++ src/proto.h | 4 ++-- src/winio.c | 20 +++++++------------- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1443e28f..232f58db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -32,6 +32,8 @@ CVS code - - Refactor the output in the DEBUG #ifdef. It didn't work properly ever since this function was changed to use an int* instead of a char*. (DLR) + edit_refresh() + - Remove apparently unneeded leaveok() calls. (David Benbennick) GNU nano 1.3.2 - 2004.03.31 - General: diff --git a/src/proto.h b/src/proto.h index 53817ed3..8fcc5317 100644 --- a/src/proto.h +++ b/src/proto.h @@ -496,8 +496,8 @@ size_t get_page_start(size_t column); void reset_cursor(void); void add_marked_sameline(int begin, int end, filestruct *fileptr, int y, int virt_cur_x, int this_page); -void edit_add(const filestruct *fileptr, const char *converted, - int yval, size_t start); +void edit_add(const filestruct *fileptr, const char *converted, int + yval, size_t start); void update_line(const filestruct *fileptr, size_t index); void update_cursor(void); void center_cursor(void); diff --git a/src/winio.c b/src/winio.c index e493ffb8..a4cfdf13 100644 --- a/src/winio.c +++ b/src/winio.c @@ -1556,8 +1556,8 @@ void reset_cursor(void) * characters. start is the column number of the first character * of this page. That is, the first character of converted corresponds to * character number actual_x(fileptr->data, start) of the line. */ -void edit_add(const filestruct *fileptr, const char *converted, - int yval, size_t start) +void edit_add(const filestruct *fileptr, const char *converted, int + yval, size_t start) { #if defined(ENABLE_COLOR) || !defined(NANO_SMALL) size_t startpos = actual_x(fileptr->data, start); @@ -1863,9 +1863,9 @@ void edit_add(const filestruct *fileptr, const char *converted, /* Just update one line in the edit buffer. Basically a wrapper for * edit_add(). * - * If fileptr != current, then index is considered 0. - * The line will be displayed starting with fileptr->data[index]. - * Likely args are current_x or 0. */ + * If fileptr != current, then index is considered 0. The line will be + * displayed starting with fileptr->data[index]. Likely args are + * current_x or 0. */ void update_line(const filestruct *fileptr, size_t index) { int line; @@ -1961,10 +1961,6 @@ 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++; @@ -1977,12 +1973,10 @@ void edit_refresh(void) nlines++; } reset_cursor(); + /* 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); } } @@ -2003,7 +1997,7 @@ void edit_update(filestruct *fileptr, topmidnone location) return; if (location != TOP) { - int goal = location == NONE ? current_y : editwinrows / 2; + int goal = (location == NONE) ? current_y : editwinrows / 2; for (; goal > 0 && fileptr->prev != NULL; goal--) fileptr = fileptr->prev; -- 2.39.5