Fix redrawing of windows when only the status line changes
This commit is contained in:
parent
90c2647c0b
commit
55866b51d7
|
@ -88,16 +88,21 @@ void Client::change_buffer(Buffer& buffer)
|
||||||
|
|
||||||
void Client::redraw_ifn()
|
void Client::redraw_ifn()
|
||||||
{
|
{
|
||||||
if (context().window().timestamp() != context().buffer().timestamp())
|
DisplayLine mode_line = generate_mode_line();
|
||||||
|
const bool buffer_changed = context().window().timestamp() != context().buffer().timestamp();
|
||||||
|
if (buffer_changed or mode_line.atoms() != m_mode_line.atoms())
|
||||||
{
|
{
|
||||||
CharCoord dimensions = context().ui().dimensions();
|
if (buffer_changed)
|
||||||
if (dimensions == CharCoord{0,0})
|
{
|
||||||
return;
|
CharCoord dimensions = context().ui().dimensions();
|
||||||
context().window().set_dimensions(dimensions);
|
if (dimensions == CharCoord{0,0})
|
||||||
context().window().update_display_buffer(context());
|
return;
|
||||||
|
context().window().set_dimensions(dimensions);
|
||||||
|
context().window().update_display_buffer(context());
|
||||||
|
}
|
||||||
|
m_mode_line = std::move(mode_line);
|
||||||
context().ui().draw(context().window().display_buffer(),
|
context().ui().draw(context().window().display_buffer(),
|
||||||
m_status_line, generate_mode_line());
|
m_status_line, m_mode_line);
|
||||||
}
|
}
|
||||||
context().ui().refresh();
|
context().ui().refresh();
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,7 @@ private:
|
||||||
InputHandler m_input_handler;
|
InputHandler m_input_handler;
|
||||||
|
|
||||||
DisplayLine m_status_line;
|
DisplayLine m_status_line;
|
||||||
|
DisplayLine m_mode_line;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,6 +105,13 @@ public:
|
||||||
void trim_end(CharCount count);
|
void trim_end(CharCount count);
|
||||||
|
|
||||||
void check_invariant() const;
|
void check_invariant() const;
|
||||||
|
|
||||||
|
bool operator==(const DisplayAtom& other) const
|
||||||
|
{
|
||||||
|
return colors == other.colors or attribute == other.attribute or
|
||||||
|
content() == other.content();
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ColorPair colors = {Colors::Default, Colors::Default};
|
ColorPair colors = {Colors::Default, Colors::Default};
|
||||||
Attribute attribute = Normal;
|
Attribute attribute = Normal;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user