on master help sign in
Fix language config reload logic (#5381)
commit0dbee9590baed10bef3c6c32420b8a5802204657 authorEthan Kiang <zyklotomic@users.noreply.github.com> dateTue 3 Jan 2023, 21:24 (4 years ago) parenta895a4e
2 files changed+9−3
helix-term/src/application.rs+8−2 helix-term/src/commands/typed.rs+1−1
helix-term/src/application.rs+8−2
@@ -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+1−1
@@ -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 }