From eac6d6337192e2e38aa790e55396ff1263125046 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 5 Dec 2015 10:14:04 +0000 Subject: [PATCH] Small code refactor --- src/main.cc | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/main.cc b/src/main.cc index a0f08527..91870c12 100644 --- a/src/main.cc +++ b/src/main.cc @@ -357,18 +357,6 @@ std::unique_ptr create_local_ui(bool dummy_ui) return make_unique(); } -void create_local_client(std::unique_ptr ui, StringView init_command, bool startup_error) -{ - local_client = ClientManager::instance().create_client( - std::move(ui), get_env_vars(), init_command); - - if (startup_error) - local_client->print_status({ - "error during startup, see *debug* buffer for details", - get_face("Error") - }); -} - void signal_handler(int signal) { NCursesUI::abort(); @@ -518,7 +506,16 @@ int run_server(StringView session, StringView init_command, new Buffer("*scratch*", Buffer::Flags::None); if (not daemon) - create_local_client(create_local_ui(dummy_ui), init_command, startup_error); + { + local_client = client_manager.create_client( + create_local_ui(dummy_ui), get_env_vars(), init_command); + + if (startup_error) + local_client->print_status({ + "error during startup, see *debug* buffer for details", + get_face("Error") + }); + } try {