From a4a492d78a96a1e33258beeaebbac2b48fb734ff Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 19 Aug 2013 11:15:53 +1000 Subject: [PATCH] Browser: Don't highlight spaces so much. Highlighting spaces is very noisy and doesn't help very much. We only really need to differentiate spaces from tabs and highlighting tabs is enough for that. We continue to highlight spaces that are adjacent to tabs, but not other spaces. Signed-off-by: NeilBrown --- vpatch.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vpatch.c b/vpatch.c index 51c52a2..5f068a9 100644 --- a/vpatch.c +++ b/vpatch.c @@ -966,9 +966,11 @@ static void draw_mside(int mode, int row, int offset, int start, int cols, highlight_space = 0; attr = visible(mode, m, &pos); if ((attr == a_unmatched || attr == a_extra) && - changed && - (*c == ' ' || *c == '\t')) - highlight_space = 1; + changed) + /* Only highlight spaces if there is a tab nearby */ + for (l = 0; l < e.plen + e.prefix; l++) + if (c[l] == '\t') + highlight_space = 1; for (l = 0; l < e.plen + e.prefix; l++) { int scol = col; if (*c == '\n') -- 2.39.5