From c63c92cbf714dc14aa96e4b1a048d4f1132306b6 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 6 Sep 2016 22:46:27 +0100 Subject: [PATCH] Support kill session inside init command --- src/main.cc | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/main.cc b/src/main.cc index dbaae037..0049f6be 100644 --- a/src/main.cc +++ b/src/main.cc @@ -557,28 +557,28 @@ int run_server(StringView session, StringView init_command, else buffer_manager.create_buffer("*scratch*", Buffer::Flags::None); - if (not daemon) - { - local_client = client_manager.create_client( - create_local_ui(ui_type), get_env_vars(), init_command); - - if (local_client) - { - auto& selections = local_client->context().selections_write_only(); - auto& buffer = selections.buffer(); - selections = SelectionList(buffer, buffer.clamp(target_coord)); - local_client->context().window().center_line(target_coord.line); - - if (startup_error) - local_client->print_status({ - "error during startup, see *debug* buffer for details", - get_face("Error") - }); - } - } - try { + if (not daemon) + { + local_client = client_manager.create_client( + create_local_ui(ui_type), get_env_vars(), init_command); + + if (local_client) + { + auto& selections = local_client->context().selections_write_only(); + auto& buffer = selections.buffer(); + selections = SelectionList(buffer, buffer.clamp(target_coord)); + local_client->context().window().center_line(target_coord.line); + + if (startup_error) + local_client->print_status({ + "error during startup, see *debug* buffer for details", + get_face("Error") + }); + } + } + while (not terminate and (not client_manager.empty() or daemon)) { client_manager.redraw_clients();