aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/main.rs
diff options
context:
space:
mode:
authorKirawi2022-04-18 03:10:51 +0000
committerGitHub2022-04-18 03:10:51 +0000
commitc2a40d9d5229c701fa1a6d0fb80ce4ba86e8dc0c (patch)
treeb27da29863432ca7ee48c582f5aeb538d7a39ea1 /helix-term/src/main.rs
parentbe656c14e32243fc32ed68f9a3240301f2902df7 (diff)
Add support for local language configuration (#1249)
* add local configuration * move config loading to Application::new * simplify find_root_impl
Diffstat (limited to 'helix-term/src/main.rs')
-rw-r--r--helix-term/src/main.rs30
1 files changed, 2 insertions, 28 deletions
diff --git a/helix-term/src/main.rs b/helix-term/src/main.rs
index 4a3434d1..58a90131 100644
--- a/helix-term/src/main.rs
+++ b/helix-term/src/main.rs
@@ -1,7 +1,6 @@
-use anyhow::{Context, Error, Result};
+use anyhow::{Context, Result};
use helix_term::application::Application;
use helix_term::args::Args;
-use helix_term::config::{Config, ConfigLoadError};
use std::path::PathBuf;
fn setup_logging(logpath: PathBuf, verbosity: u64) -> Result<()> {
@@ -109,35 +108,10 @@ FLAGS:
return Ok(0);
}
- let conf_dir = helix_loader::config_dir();
- if !conf_dir.exists() {
- std::fs::create_dir_all(&conf_dir).ok();
- }
-
- let config = match Config::load_default() {
- Ok(config) => config,
- Err(err) => {
- match err {
- ConfigLoadError::BadConfig(err) => {
- eprintln!("Bad config: {}", err);
- eprintln!("Press <ENTER> to continue with default config");
- use std::io::Read;
- // This waits for an enter press.
- let _ = std::io::stdin().read(&mut []);
- Config::default()
- }
- ConfigLoadError::Error(err) if err.kind() == std::io::ErrorKind::NotFound => {
- Config::default()
- }
- ConfigLoadError::Error(err) => return Err(Error::new(err)),
- }
- }
- };
-
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, config).context("unable to create new application")?;
+ let mut app = Application::new(args).context("unable to create new application")?;
let exit_code = app.run().await?;