Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix language config reload logic #5381

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions helix-term/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ impl Application {
.map_err(|err| anyhow::anyhow!("Failed to load language config: {}", err))?;

self.syn_loader = std::sync::Arc::new(syntax::Loader::new(syntax_config));
self.editor.syn_loader = self.syn_loader.clone();
for document in self.editor.documents.values_mut() {
document.detect_language(self.syn_loader.clone());
}
Expand Down Expand Up @@ -438,8 +439,13 @@ impl Application {
Ok(())
};

if let Err(err) = refresh_config() {
self.editor.set_error(err.to_string());
match refresh_config() {
Ok(_) => {
self.editor.set_status("Config refreshed");
}
Err(err) => {
self.editor.set_error(err.to_string());
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,7 @@ fn run_shell_command(
let shell = &cx.editor.config().shell;
let (output, success) = shell_impl(shell, &args.join(" "), None)?;
if success {
cx.editor.set_status("Command succeed");
cx.editor.set_status("Command succeeded");
} else {
cx.editor.set_error("Command failed");
}
Expand Down