@@ -8,6 +8,8 @@ mod ui;
9use application::Application;
9use application::Application;
11+use helix_core::config_dir;
11use std::path::PathBuf;
13use std::path::PathBuf;
13use anyhow::{Context, Result};
15use anyhow::{Context, Result};
@@ -27,8 +29,6 @@ fn setup_logging(verbosity: u64) -> Result<()> {
27 _3_or_more => base_config.level(log::LevelFilter::Trace),
29 _3_or_more => base_config.level(log::LevelFilter::Trace),
30− let home = dirs_next::home_dir().context("can't find the home directory")?;
32 // Separate file config so we can include year, month and day in file logs
32 // Separate file config so we can include year, month and day in file logs
33 let file_config = fern::Dispatch::new()
33 let file_config = fern::Dispatch::new()
34 .format(|out, message, record| {
34 .format(|out, message, record| {
@@ -40,7 +40,7 @@ fn setup_logging(verbosity: u64) -> Result<()> {
43− .chain(fern::log_file(home.join("helix.log"))?);
43+ .chain(fern::log_file(config_dir().join("helix.log"))?);
45 base_config.chain(file_config).apply()?;
45 base_config.chain(file_config).apply()?;
@@ -89,6 +89,12 @@ FLAGS:
89 verbosity = 1;
89 verbosity = 1;
92+ let conf_dir = config_dir();
94+ if !conf_dir.exists() {
95+ std::fs::create_dir(&conf_dir);
92 setup_logging(verbosity).context("failed to initialize logging")?;
98 setup_logging(verbosity).context("failed to initialize logging")?;
94 let args = Args {
100 let args = Args {
@@ -96,7 +102,6 @@ FLAGS:
98 // initialize language registry
104 // initialize language registry
99− use helix_core::config_dir;
100 use helix_core::syntax::{Loader, LOADER};
105 use helix_core::syntax::{Loader, LOADER};
102 // load $HOME/.config/helix/languages.toml, fallback to default config
107 // load $HOME/.config/helix/languages.toml, fallback to default config