summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-12-05 10:14:04 +0000
committerMaxime Coste <frrrwww@gmail.com>2015-12-05 10:14:04 +0000
commiteac6d6337192e2e38aa790e55396ff1263125046 (patch)
treed6cd10afb74dfb5c4331581c215eb0460b95c303 /src
parent7d4c0a9d83c35655f6ef878f7256a667812b2e59 (diff)
Small code refactor
Diffstat (limited to 'src')
-rw-r--r--src/main.cc23
1 files 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<UserInterface> create_local_ui(bool dummy_ui)
return make_unique<LocalUI>();
}
-void create_local_client(std::unique_ptr<UserInterface> 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
{