From 8b9fd4a997380129ceea8840a41e02e3380e2ab8 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 20 Aug 2013 10:42:23 +1000 Subject: [PATCH] Browser: highlight spaces at the end of a line. Otherwise they are invisible. Signed-off-by: NeilBrown --- vpatch.c | 7 +++++++ 1 file changed, 7 insertions(+) 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') -- 2.11.4.GIT