Skip to content

Commit 1a81dcd

Browse files
zyklotomicsemin-park
authored andcommitted
Fix language config reload logic (helix-editor#5381)
1 parent 012cffe commit 1a81dcd

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

helix-term/src/application.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ impl Application {
403403
.map_err(|err| anyhow::anyhow!("Failed to load language config: {}", err))?;
404404

405405
self.syn_loader = std::sync::Arc::new(syntax::Loader::new(syntax_config));
406+
self.editor.syn_loader = self.syn_loader.clone();
406407
for document in self.editor.documents.values_mut() {
407408
document.detect_language(self.syn_loader.clone());
408409
}
@@ -438,8 +439,13 @@ impl Application {
438439
Ok(())
439440
};
440441

441-
if let Err(err) = refresh_config() {
442-
self.editor.set_error(err.to_string());
442+
match refresh_config() {
443+
Ok(_) => {
444+
self.editor.set_status("Config refreshed");
445+
}
446+
Err(err) => {
447+
self.editor.set_error(err.to_string());
448+
}
443449
}
444450
}
445451

helix-term/src/commands/typed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1797,7 +1797,7 @@ fn run_shell_command(
17971797
let shell = &cx.editor.config().shell;
17981798
let (output, success) = shell_impl(shell, &args.join(" "), None)?;
17991799
if success {
1800-
cx.editor.set_status("Command succeed");
1800+
cx.editor.set_status("Command succeeded");
18011801
} else {
18021802
cx.editor.set_error("Command failed");
18031803
}

0 commit comments

Comments
 (0)