From: Benno Schulenberg Date: Wed, 30 Mar 2016 12:18:22 +0000 (+0000) Subject: Renaming a variable for clarity. X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=29cac04afcec4a2a0be94de179b7206892df4524;p=nano.git Renaming a variable for clarity. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5778 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index f65c8db9..3fc59b9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ that is taking too long. This fixes Savannah bug #47439. * src/winio.c (do_replace_highlight): Rename this to 'spotlight', for clarity, and for contrast with 'do_replace/do_replace_loop'. + * src/winio.c (spotlight): Rename a variable for clarity. 2016-03-29 Benno Schulenberg * src/nano.c (main), src/text.c (do_justify, do_verbatim_input), diff --git a/src/winio.c b/src/winio.c index 9c33f3a6..8287ed5c 100644 --- a/src/winio.c +++ b/src/winio.c @@ -3151,16 +3151,15 @@ void disable_nodelay(void) * expect word to have tabs and control characters expanded. */ void spotlight(bool active, const char *word) { - size_t y = xplustabs(), word_len = strlenpt(word); + size_t word_len = strlenpt(word), room; - y = get_page_start(y) + COLS - y; - /* Now y is the number of columns that we can display on this - * line. */ + /* Compute the number of columns that are available for the word. */ + room = COLS + get_page_start(xplustabs()) - xplustabs(); - assert(y > 0); + assert(room > 0); - if (word_len > y) - y--; + if (word_len > room) + room--; reset_cursor(); wnoutrefresh(edit); @@ -3172,9 +3171,9 @@ void spotlight(bool active, const char *word) if (word_len == 0) waddch(edit, ' '); else - waddnstr(edit, word, actual_x(word, y)); + waddnstr(edit, word, actual_x(word, room)); - if (word_len > y) + if (word_len > room) waddch(edit, '$'); if (active)