From: NeilBrown Date: Tue, 20 Aug 2013 00:42:23 +0000 (+1000) Subject: Browser: highlight spaces at the end of a line. X-Git-Tag: v1.0~35 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=8b9fd4a997380129ceea8840a41e02e3380e2ab8;p=wiggle.git Browser: highlight spaces at the end of a line. Otherwise they are invisible. Signed-off-by: NeilBrown --- diff --git a/vpatch.c b/vpatch.c index a0231d0..b5166b2 100644 --- a/vpatch.c +++ b/vpatch.c @@ -977,6 +977,13 @@ static void draw_mside(int mode, int row, int offset, int start, int cols, for (l = 0; l < e.plen + e.prefix; l++) if (c[l] == '\t') highlight_space = 1; + if (!highlight_space && (c[0] == ' ' || c[0] == '\t')) { + /* always highlight space/tab at end-of-line */ + struct mp nxt = pos.p; + struct elmnt nxte = next_melmnt(&nxt, fm, fb, fa, m); + if (nxte.start[0] == '\n') + highlight_space = 1; + } for (l = 0; l < e.plen + e.prefix; l++) { int scol = col; if (*c == '\n')