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),
* 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);
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)