commit 29cac04afcec4a2a0be94de179b7206892df4524
parent c98afde096a042398909dbb59390e3d486d73e3c
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Wed, 30 Mar 2016 12:18:22 +0000
Renaming a variable for clarity.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5778 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git 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 <bensberg@justemail.net>
* src/nano.c (main), src/text.c (do_justify, do_verbatim_input),
diff --git 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)