diff --git a/helix-term/src/health.rs b/helix-term/src/health.rs index 180e0652c04a..eef0dac8f536 100644 --- a/helix-term/src/health.rs +++ b/helix-term/src/health.rs @@ -83,6 +83,19 @@ pub fn general() -> std::io::Result<()> { ); writeln!(stdout, "{}", msg.yellow())?; } + } + + Ok(()) +} + +/// Display warnings if runtime directories don't exist. +pub fn runtime_warnings() -> std::io::Result<()> { + let stdout = std::io::stdout(); + let mut stdout = stdout.lock(); + + let rt_dirs = helix_loader::runtime_dirs(); + + for rt_dir in rt_dirs.iter() { if !rt_dir.exists() { let msg = format!("Runtime directory does not exist: {}", rt_dir.display()); writeln!(stdout, "{}", msg.yellow())?; @@ -395,11 +408,16 @@ pub fn print_health(health_arg: Option) -> std::io::Result<()> { Some("clipboard") => clipboard()?, None | Some("all") => { general()?; + runtime_warnings()?; clipboard()?; writeln!(std::io::stdout().lock())?; languages_all()?; } - Some(lang) => language(lang.to_string())?, + Some(lang) => { + language(lang.to_string())?; + writeln!(std::io::stdout().lock())?; + runtime_warnings()?; + } } Ok(()) }