summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/window.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/window.cc b/src/window.cc
index 314a31c7..58a85f48 100644
--- a/src/window.cc
+++ b/src/window.cc
@@ -117,6 +117,30 @@ private:
const Window& m_window;
};
+static void blink_void(DisplayBuffer& display_buffer)
+{
+ for (auto atom_it = display_buffer.begin();
+ atom_it != display_buffer.end();)
+ {
+ DisplayAtom& atom = *atom_it;
+ size_t pos = atom.content.find("void");
+ if (pos != std::string::npos)
+ {
+ DisplayAtom prefix(atom.begin, atom.begin + pos,
+ atom.content.substr(0, pos));
+ prefix.attribute = atom.attribute;
+ DisplayAtom match(prefix.end, prefix.end + 4, "void");
+ match.attribute = atom.attribute | Attributes::Blink;
+ atom.begin = prefix.end + 4;
+ atom.content = atom.content.substr(pos + 4);
+ atom_it = display_buffer.insert(atom_it, match);
+ atom_it = display_buffer.insert(atom_it, prefix) + 2;
+ }
+ else
+ ++atom_it;
+ }
+}
+
Window::Window(Buffer& buffer)
: m_buffer(buffer),
m_position(0, 0),
@@ -125,6 +149,7 @@ Window::Window(Buffer& buffer)
m_current_inserter(nullptr)
{
m_selections.push_back(Selection(buffer.begin(), buffer.begin()));
+ m_filters.push_back(blink_void);
m_filters.push_back(HighlightSelections(*this));
}