nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 6e9d6a08b9537c17b261f8e57a6c04bd40257c4c
parent 07ebba5e99176470575d6a754bc05be2d81c4186
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Thu, 23 Feb 2017 23:25:03 -0600

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>

Diffstat:
Msrc/winio.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -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);