summaryrefslogtreecommitdiff
path: root/src/client.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2023-08-27 07:23:39 +1000
committerMaxime Coste <mawww@kakoune.org>2023-08-27 08:03:42 +1000
commitfe93a9df37bdc28ff6580cf9ece8d18bbe2663cf (patch)
tree36e879ca26cc4f55f73695230e9d43268aafe298 /src/client.cc
parent6f9f32b4bb7603c308a3e245fef10ad48bf20719 (diff)
Remove Window::force_redraw()
This was mostly redundant with Client::force_redraw.
Diffstat (limited to 'src/client.cc')
-rw-r--r--src/client.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/client.cc b/src/client.cc
index 33285b95..6996ee13 100644
--- a/src/client.cc
+++ b/src/client.cc
@@ -62,7 +62,7 @@ Client::Client(std::unique_ptr<UserInterface>&& ui,
else if (key.modifiers & Key::Modifiers::Resize)
{
m_window->set_dimensions(key.coord());
- force_redraw();
+ force_redraw(true);
}
else
m_pending_keys.push_back(key);
@@ -210,7 +210,7 @@ void Client::change_buffer(Buffer& buffer, Optional<FunctionRef<void()>> set_sel
m_ui->set_ui_options(m_window->options()["ui_options"].get<UserInterface::Options>());
m_window->hooks().run_hook(Hook::WinDisplay, buffer.name(), context());
- force_redraw();
+ force_redraw(true);
}
static bool is_inline(InfoStyle style)
@@ -289,11 +289,14 @@ void Client::redraw_ifn()
m_ui_pending = 0;
}
-void Client::force_redraw()
+void Client::force_redraw(bool full)
{
- m_ui_pending |= Refresh | Draw | StatusLine |
- (m_menu.items.empty() ? MenuHide : MenuShow | MenuSelect) |
- (m_info.content.empty() ? InfoHide : InfoShow);
+ if (full)
+ m_ui_pending |= Refresh | Draw | StatusLine |
+ (m_menu.items.empty() ? MenuHide : MenuShow | MenuSelect) |
+ (m_info.content.empty() ? InfoHide : InfoShow);
+ else
+ m_ui_pending |= Draw;
}
void Client::reload_buffer()
@@ -422,10 +425,8 @@ StringView Client::get_env_var(StringView name) const
void Client::on_option_changed(const Option& option)
{
if (option.name() == "ui_options")
- {
m_ui->set_ui_options(option.get<UserInterface::Options>());
- m_ui_pending |= Draw;
- }
+ m_ui_pending |= Draw; // a highlighter might depend on the option, so we need to redraw
}
void Client::menu_show(Vector<DisplayLine> choices, BufferCoord anchor, MenuStyle style)