summaryrefslogtreecommitdiff
path: root/src/client.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2019-12-28 11:27:04 +1100
committerMaxime Coste <mawww@kakoune.org>2019-12-28 11:27:04 +1100
commit22bfbd06af1d0257419a9c9e0f2e3b0ebff30ddb (patch)
tree729191f76f46790eccd70e2d16a477352b87b9c6 /src/client.cc
parent7c1d4f5bd61129530e30abd92c8f65893fdf8a93 (diff)
Redraw relevant clients after adding/removing highlighters
Diffstat (limited to 'src/client.cc')
-rw-r--r--src/client.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client.cc b/src/client.cc
index 2c84de6b..da178623 100644
--- a/src/client.cc
+++ b/src/client.cc
@@ -171,20 +171,21 @@ void Client::change_buffer(Buffer& buffer)
close_buffer_reload_dialog();
auto& client_manager = ClientManager::instance();
+ WindowAndSelections ws = client_manager.get_free_window(buffer);
+
m_window->options().unregister_watcher(*this);
m_window->set_client(nullptr);
-
- WindowAndSelections ws = client_manager.get_free_window(buffer);
client_manager.add_free_window(std::move(m_window),
std::move(context().selections()));
+
m_window = std::move(ws.window);
m_window->set_client(this);
m_window->options().register_watcher(*this);
- m_ui->set_ui_options(m_window->options()["ui_options"].get<UserInterface::Options>());
-
context().selections_write_only() = std::move(ws.selections);
context().set_window(*m_window);
+
m_window->set_dimensions(m_ui->dimensions());
+ 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();