Commit 6e9d6a08 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey Committed by Benno Schulenberg
Browse files

replacing: fix spotlight() to highlight words properly in softwrap mode

In softwrap mode, the entire line is onscreen, so the word is never
partially offscreen, so we always have enough columns to show it.

This fixes https://savannah.gnu.org/bugs/?50389

.
Reported-by: default avatarDavid Lawrence Ramsey <pooka109@gmail.com>
No related merge requests found
Showing with 3 additions and 2 deletions
+3 -2
......@@ -3100,10 +3100,11 @@ void disable_nodelay(void)
* expect word to have tabs and control characters expanded. */
void spotlight(bool active, const char *word)
{
size_t word_len = strlenpt(word), room;
size_t word_len = strlenpt(word), room = word_len;
/* Compute the number of columns that are available for the word. */
room = editwincols + get_page_start(xplustabs()) - xplustabs();
if (!ISSET(SOFTWRAP))
room = editwincols + get_page_start(xplustabs()) - xplustabs();
assert(room > 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment