Skip to content

Commit

Permalink
fix: workspace_blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
vyfor committed Jun 13, 2024
1 parent 1ac0498 commit c94361f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lua/cord.lua
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ function cord.setup(userConfig)

vim.g.cord_initialized = true

if init(config) == 2 then return end
if init(config) == 3 then return end
start_timer(config)
end
end
Expand Down
10 changes: 6 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ pub unsafe extern "C" fn init(

let workspace =
workspace.file_name().unwrap().to_string_lossy().to_string();
let ws = workspace.clone();

let workspace_blacklist = if args.workspace_blacklist.is_null() {
Vec::new()
Expand All @@ -154,10 +155,7 @@ pub unsafe extern "C" fn init(
.map(|s| ptr_to_string(s.to_owned()))
.collect::<Vec<String>>()
};

if workspace_blacklist.contains(&workspace) {
return status::WORKSPACE_BLACKLISTED;
}
let ws_blacklist = workspace_blacklist.clone();

std::thread::spawn(move || {
if let Ok(mut rich_client) = RichClient::connect(client_id) {
Expand Down Expand Up @@ -189,6 +187,10 @@ pub unsafe extern "C" fn init(
};
});

if ws_blacklist.clone().contains(&ws) {
return status::WORKSPACE_BLACKLISTED;
}

status::SUCCESS
}

Expand Down

0 comments on commit c94361f

Please sign in to comment.