Renaming a variable for clarity.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5778 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2016-03-30 12:18:22 +00:00
parent c98afde096
commit 29cac04afc
2 changed files with 9 additions and 9 deletions

View File

@ -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),

View File

@ -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)