summaryrefslogtreecommitdiff
path: root/src/client_manager.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-12-14 19:06:30 +0000
committerMaxime Coste <frrrwww@gmail.com>2015-12-14 19:06:30 +0000
commitd2b0dba39dfc87fe7da7610b0ed68df65d89ded8 (patch)
tree215edd19fb28d9f631b6445d5fcd872b56dae8d0 /src/client_manager.cc
parent6873a44e3ea7eaaa435e3bf018d2c68fa214e858 (diff)
Support quitting while executing RuntimeError hooks
Fixes #529
Diffstat (limited to 'src/client_manager.cc')
-rw-r--r--src/client_manager.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/client_manager.cc b/src/client_manager.cc
index 7e70d5c4..b71dfc75 100644
--- a/src/client_manager.cc
+++ b/src/client_manager.cc
@@ -42,13 +42,16 @@ Client* ClientManager::create_client(std::unique_ptr<UserInterface>&& ui,
m_clients.emplace_back(client);
try
{
- CommandManager::instance().execute(init_commands, client->context());
- }
- catch (Kakoune::runtime_error& error)
- {
- client->context().print_status({ error.what().str(), get_face("Error") });
- client->context().hooks().run_hook("RuntimeError", error.what(),
- client->context());
+ try
+ {
+ CommandManager::instance().execute(init_commands, client->context());
+ }
+ catch (Kakoune::runtime_error& error)
+ {
+ client->context().print_status({ error.what().str(), get_face("Error") });
+ client->context().hooks().run_hook("RuntimeError", error.what(),
+ client->context());
+ }
}
catch (Kakoune::client_removed& removed)
{