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: David Lawrence Ramsey <pooka109@gmail.com>master
parent
07ebba5e99
commit
6e9d6a08b9
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue