]> git.neil.brown.name Git - wiggle.git/commitdiff
Browser: highlight spaces at the end of a line.
authorNeilBrown <neilb@suse.de>
Tue, 20 Aug 2013 00:42:23 +0000 (10:42 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 20 Aug 2013 00:42:23 +0000 (10:42 +1000)
Otherwise they are invisible.

Signed-off-by: NeilBrown <neilb@suse.de>
vpatch.c

index a0231d0814f3dfe162b0aa878186f54028136cb1..b5166b212e2c1e561f0f10852f44ae722f0037d9 100644 (file)
--- 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')