aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/main.rs')
-rw-r--r--helix-term/src/main.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/helix-term/src/main.rs b/helix-term/src/main.rs
index 9d4e1c5b..ef912480 100644
--- a/helix-term/src/main.rs
+++ b/helix-term/src/main.rs
@@ -1,6 +1,6 @@
use helix_term::application::Application;
use helix_term::args::Args;
-
+use helix_term::config::Config;
use std::path::PathBuf;
use anyhow::{Context, Result};
@@ -89,10 +89,17 @@ FLAGS:
std::fs::create_dir_all(&conf_dir).ok();
}
+ let config = std::fs::read_to_string(conf_dir.join("config.toml"))
+ .ok()
+ .map(|s| toml::from_str(&s))
+ .transpose()?
+ .or_else(|| Some(Config::default()))
+ .unwrap();
+
setup_logging(logpath, args.verbosity).context("failed to initialize logging")?;
// TODO: use the thread local executor to spawn the application task separately from the work pool
- let mut app = Application::new(args).context("unable to create new appliction")?;
+ let mut app = Application::new(args, config).context("unable to create new application")?;
app.run().await.unwrap();
Ok(())