summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-09-20 11:34:13 +0100
committerMaxime Coste <frrrwww@gmail.com>2015-09-20 11:34:13 +0100
commit2b4b73ae8e450c995ccccc93fcf6d2b73ea18862 (patch)
tree5091585fa7f2a261e13a854a1339648291fde2ae /src
parentb3e0e27d1fc295ab14ab0855bca4fcfe71d0ad49 (diff)
Remove the default_face parameter of parse_display_line
No need to define a default face there, we will pass a default face to UserInterface::draw_status later.
Diffstat (limited to 'src')
-rw-r--r--src/client.cc4
-rw-r--r--src/commands.cc2
-rw-r--r--src/display_buffer.cc6
-rw-r--r--src/display_buffer.hh2
4 files changed, 6 insertions, 8 deletions
diff --git a/src/client.cc b/src/client.cc
index fa7b6d38..9da589b5 100644
--- a/src/client.cc
+++ b/src/client.cc
@@ -99,14 +99,12 @@ void Client::print_status(DisplayLine status_line)
DisplayLine Client::generate_mode_line() const
{
- Face status_face = get_face("StatusLine");
-
DisplayLine modeline;
try
{
const String& modelinefmt = context().options()["modelinefmt"].get<String>();
- modeline = parse_display_line(expand(modelinefmt, context()), status_face);
+ modeline = parse_display_line(expand(modelinefmt, context()));
}
catch (runtime_error& err)
{
diff --git a/src/commands.cc b/src/commands.cc
index 0c35cb26..12534798 100644
--- a/src/commands.cc
+++ b/src/commands.cc
@@ -904,7 +904,7 @@ const CommandDesc echo_cmd = {
if (parser.get_switch("debug"))
write_to_debug_buffer(message);
else if (parser.get_switch("markup"))
- context.print_status(parse_display_line(message, get_face("StatusLine")));
+ context.print_status(parse_display_line(message));
else
{
auto face = get_face(parser.get_switch("color").value_or("StatusLine").str());
diff --git a/src/display_buffer.cc b/src/display_buffer.cc
index 3bf2f1b4..61078657 100644
--- a/src/display_buffer.cc
+++ b/src/display_buffer.cc
@@ -253,13 +253,13 @@ void DisplayBuffer::optimize()
line.optimize();
}
-DisplayLine parse_display_line(StringView line, Face default_face)
+DisplayLine parse_display_line(StringView line)
{
DisplayLine res;
bool was_antislash = false;
auto pos = line.begin();
String content;
- Face face = default_face;
+ Face face;
for (auto it = line.begin(), end = line.end(); it != end; ++it)
{
const char c = *it;
@@ -279,7 +279,7 @@ DisplayLine parse_display_line(StringView line, Face default_face)
auto closing = std::find(it+1, end, '}');
if (closing == end)
throw runtime_error("unclosed face definition");
- face = merge_faces(default_face, get_face({it+1, closing}));
+ face = get_face({it+1, closing});
it = closing;
pos = closing + 1;
}
diff --git a/src/display_buffer.hh b/src/display_buffer.hh
index 9670325a..1b852a58 100644
--- a/src/display_buffer.hh
+++ b/src/display_buffer.hh
@@ -140,7 +140,7 @@ private:
AtomList m_atoms;
};
-DisplayLine parse_display_line(StringView line, Face default_face);
+DisplayLine parse_display_line(StringView line);
class DisplayBuffer : public UseMemoryDomain<MemoryDomain::Display>
{