summaryrefslogtreecommitdiff
path: root/src/client.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2018-07-25 21:23:22 +1000
committerMaxime Coste <mawww@kakoune.org>2018-07-25 21:23:22 +1000
commit7905382b747ef77515183b15812000122dc5503f (patch)
tree81e448b7560ed2fae68bc34b39af8d586627e4e4 /src/client.cc
parent47666ba20b90c439c972babee1e10712b94e1b77 (diff)
Obtain a new window for a client before releasing the current one
Creating a window potentially runs hooks, which themselves could trigger shell evaluation, which could handle urgent input events such as a resize, while waiting for the shell to finish. When that happens, the client had a temporarily null window as it had already released its own window. Fixes #2225
Diffstat (limited to 'src/client.cc')
-rw-r--r--src/client.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client.cc b/src/client.cc
index 7baf551b..44702331 100644
--- a/src/client.cc
+++ b/src/client.cc
@@ -175,10 +175,10 @@ void Client::change_buffer(Buffer& buffer)
auto& client_manager = ClientManager::instance();
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()));
- WindowAndSelections ws = client_manager.get_free_window(buffer);
-
m_window = std::move(ws.window);
m_window->set_client(this);
m_window->options().register_watcher(*this);