Remove Client::window() method, use a force_redraw() one
We cannot assume Client::m_window is always non-null, as when changing current buffer its temporarily null, at the point where WinCreate hook might get called. Fixes #382
This commit is contained in:
parent
dc504284c3
commit
ae839fc471
|
@ -166,6 +166,12 @@ void Client::redraw_ifn()
|
|||
ui.refresh();
|
||||
}
|
||||
|
||||
void Client::force_redraw()
|
||||
{
|
||||
if (m_window)
|
||||
m_window->force_redraw();
|
||||
}
|
||||
|
||||
void Client::reload_buffer()
|
||||
{
|
||||
auto& buffer = context().buffer();
|
||||
|
|
|
@ -35,10 +35,10 @@ public:
|
|||
|
||||
void print_status(DisplayLine status_line);
|
||||
|
||||
void force_redraw();
|
||||
void redraw_ifn();
|
||||
|
||||
UserInterface& ui() const { return *m_ui; }
|
||||
Window& window() const { return *m_window; }
|
||||
|
||||
void check_if_buffer_needs_reloading();
|
||||
|
||||
|
|
|
@ -1536,7 +1536,7 @@ const CommandDesc face_cmd = {
|
|||
FaceRegistry::instance().register_alias(parser[0], parser[1], true);
|
||||
|
||||
for (auto& client : ClientManager::instance())
|
||||
client->window().force_redraw();
|
||||
client->force_redraw();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user