From d4b8e28d0a48607f873d79323f03a2fa7c8c11b6 Mon Sep 17 00:00:00 2001 From: pierroelmito Date: Sat, 30 Apr 2016 10:35:25 +0200 Subject: [PATCH] add face to change whitespace colors --- src/face_registry.cc | 1 + src/highlighters.cc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/face_registry.cc b/src/face_registry.cc index f5f415a2..644802df 100644 --- a/src/face_registry.cc +++ b/src/face_registry.cc @@ -121,6 +121,7 @@ FaceRegistry::FaceRegistry() { "Prompt", Face{ Color::Yellow, Color::Default } }, { "MatchingChar", Face{ Color::Default, Color::Default, Attribute::Bold } }, { "BufferPadding", Face{ Color::Blue, Color::Default } }, + { "WhiteSpace", Face{ Color::Default, Color::Default } }, } {} diff --git a/src/highlighters.cc b/src/highlighters.cc index 0f55e525..70ba867d 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -683,6 +683,7 @@ void expand_tabulations(const Context& context, HighlightFlags flags, DisplayBuf void show_whitespaces(const Context& context, HighlightFlags flags, DisplayBuffer& display_buffer, BufferRange) { const int tabstop = context.options()["tabstop"].get(); + auto whitespaceface = get_face("WhiteSpace"); auto& buffer = context.buffer(); for (auto& line : display_buffer.lines()) { @@ -713,6 +714,7 @@ void show_whitespaces(const Context& context, HighlightFlags flags, DisplayBuffe atom_it->replace("·"); else if (c == '\n') atom_it->replace("¬"); + atom_it->face = whitespaceface; break; } }