From a5cc15d8e38c4d50161f4f6d4eaeefb4bda344a2 Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Mon, 1 Aug 2016 02:58:41 +0300 Subject: [PATCH] Fixed #77 (#156) --- suplemon/viewer.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/suplemon/viewer.py b/suplemon/viewer.py index e4ada15..a901d99 100644 --- a/suplemon/viewer.py +++ b/suplemon/viewer.py @@ -378,9 +378,12 @@ def render_line_pygments(self, line, pos, x_offset, max_len): scope = token[0] text = self.replace_whitespace(token[1]) if token[1].isspace() and not self.app.ui.limited_colors: - # Color visible whitespace with gray - # TODO: get whitespace color from theme - pair = 9 # Gray text on normal background + pair = 9 # Default to gray text on normal background + settings = self.app.themes.get_scope("global") + if settings and settings.get("invisibles"): + fg = int(settings.get("invisibles") or -1) + bg = int(settings.get("background") or -1) + curses.init_pair(pair, fg, bg) curs_color = curses.color_pair(pair) # Only add tab indicators to the inital whitespace if first_token and self.config["show_tab_indicators"]: