From a0aff67a4d3c7e729d5ef0b52a65bd05fc99e171 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Thu, 27 Oct 2005 20:10:45 +0000 Subject: [PATCH] rename edit_add() to edit_draw(), and rename its parameter yval to line git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3059 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 4 ++++ src/proto.h | 4 ++-- src/winio.c | 41 +++++++++++++++++++++-------------------- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3ba55783..2eee4e15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,10 @@ CVS code - get_page_start(). (DLR) - nano.h: - Readd MIN_EDITOR_COLS #define. (DLR) +- winio.c: + edit_add() + - Rename to edit_draw(), and rename parameter yval to line. + (DLR) - doc/nanorc.sample: - Tweak the "c-file" regex for characters to properly accept '\"' and reject '"' and '''. (DLR) diff --git a/src/proto.h b/src/proto.h index b8370dc9..1c0421af 100644 --- a/src/proto.h +++ b/src/proto.h @@ -669,8 +669,8 @@ void bottombars(const shortcut *s); void onekey(const char *keystroke, const char *desc, size_t len); size_t get_page_start(size_t column); void reset_cursor(void); -void edit_add(const filestruct *fileptr, const char *converted, int - yval, size_t start); +void edit_draw(const filestruct *fileptr, const char *converted, int + line, size_t start); void update_line(const filestruct *fileptr, size_t index); bool need_horizontal_update(size_t old_pww); bool need_vertical_update(size_t old_pww); diff --git a/src/winio.c b/src/winio.c index 38b0fd31..fcb52661 100644 --- a/src/winio.c +++ b/src/winio.c @@ -3121,15 +3121,16 @@ void reset_cursor(void) } } -/* edit_add() takes care of the job of actually painting a line into the - * edit window. fileptr is the line to be painted, at row yval of the - * window. converted is the actual string to be written to the window, - * with tabs and control characters replaced by strings of regular - * 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) +/* edit_draw() takes care of the job of actually painting a line into + * the edit window. fileptr is the line to be painted, at row line of + * the window. converted is the actual string to be written to the + * window, with tabs and control characters replaced by strings of + * regular 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_draw(const filestruct *fileptr, const char *converted, int + line, size_t start) { #if !defined(NANO_SMALL) || defined(ENABLE_COLOR) size_t startpos = actual_x(fileptr->data, start); @@ -3148,7 +3149,7 @@ void edit_add(const filestruct *fileptr, const char *converted, int /* Just paint the string in any case (we'll add color or reverse on * just the text that needs it). */ - mvwaddstr(edit, yval, 0, converted); + mvwaddstr(edit, line, 0, converted); #ifdef ENABLE_COLOR /* If color syntaxes are available and turned on, we need to display @@ -3217,8 +3218,8 @@ void edit_add(const filestruct *fileptr, const char *converted, int assert(0 <= x_start && 0 <= paintlen); - mvwaddnstr(edit, yval, x_start, - converted + index, paintlen); + mvwaddnstr(edit, line, x_start, converted + + index, paintlen); } k = startmatch.rm_eo; } @@ -3304,7 +3305,7 @@ void edit_add(const filestruct *fileptr, const char *converted, int strnlenpt(fileptr->data, endmatch.rm_eo) - start); - mvwaddnstr(edit, yval, 0, converted, paintlen); + mvwaddnstr(edit, line, 0, converted, paintlen); step_two: /* Second step, we look for starts on this line. */ @@ -3349,8 +3350,8 @@ void edit_add(const filestruct *fileptr, const char *converted, int assert(0 <= x_start && x_start < COLS); - mvwaddnstr(edit, yval, x_start, - converted + index, paintlen); + mvwaddnstr(edit, line, x_start, converted + + index, paintlen); } } else { /* There is no end on this line. But we haven't @@ -3365,8 +3366,8 @@ void edit_add(const filestruct *fileptr, const char *converted, int if (end_line != NULL) { assert(0 <= x_start && x_start < COLS); - mvwaddnstr(edit, yval, x_start, - converted + index, -1); + mvwaddnstr(edit, line, x_start, converted + + index, -1); /* We painted to the end of the line, so * don't bother checking any more starts. */ break; @@ -3447,7 +3448,7 @@ void edit_add(const filestruct *fileptr, const char *converted, int paintlen = actual_x(converted + index, paintlen); wattron(edit, A_REVERSE); - mvwaddnstr(edit, yval, x_start, converted + index, + mvwaddnstr(edit, line, x_start, converted + index, paintlen); wattroff(edit, A_REVERSE); } @@ -3456,7 +3457,7 @@ void edit_add(const filestruct *fileptr, const char *converted, int } /* Just update one line in the edit buffer. This is basically a wrapper - * for edit_add(). + * for edit_draw(). * * If fileptr != current, then index is considered 0. The line will be * displayed starting with fileptr->data[index]. Likely args are @@ -3494,7 +3495,7 @@ void update_line(const filestruct *fileptr, size_t index) converted = display_string(fileptr->data, page_start, COLS, TRUE); /* Paint the line. */ - edit_add(fileptr, converted, line, page_start); + edit_draw(fileptr, converted, line, page_start); free(converted); if (page_start > 0) -- 2.39.5