Skip to content

Commit 490ddc9

Browse files
fix ignoring workspace settings when using command line arguements
1 parent 20a07f3 commit 490ddc9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

helix-term/src/main.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
use anyhow::{Context, Error, Result};
2+
use helix_loader::trust_db::Trust;
23
use helix_loader::{trust_db, VERSION_AND_GIT_HASH};
34
use helix_term::application::Application;
45
use helix_term::args::Args;
56
use helix_term::config::{Config, ConfigLoadError};
7+
use helix_view::editor::WorkspaceTrust;
68

79
fn setup_logging(verbosity: u64) -> Result<()> {
810
let mut base_config = fern::Dispatch::new();
@@ -118,8 +120,13 @@ FLAGS:
118120
}
119121
};
120122

121-
let use_local_config =
122-
trust_db::is_workspace_trusted(helix_loader::find_workspace().0)?.unwrap_or_default();
123+
let use_local_config = match config.editor.workspace_trust {
124+
WorkspaceTrust::Always => true,
125+
WorkspaceTrust::Never => false,
126+
WorkspaceTrust::Manual | WorkspaceTrust::Ask => {
127+
trust_db::is_workspace_trusted(helix_loader::find_workspace().0)?.unwrap_or_default()
128+
}
129+
};
123130

124131
if args.health {
125132
if let Err(err) = helix_term::health::print_health(args.health_arg, use_local_config) {

0 commit comments

Comments
 (0)