summaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authorRustyStriker2021-11-28 01:19:54 +0000
committerGitHub2021-11-28 01:19:54 +0000
commit103b5125e4bc51965d98a38cdbeed2151ed816fa (patch)
tree1fafc89b34b60b4abd065b70ca7618315f80f14c /helix-term/src
parent3b2b7341a5d3d616496e8f13e6522d08c7864fb4 (diff)
Detect filetype on :write (#1141)
fixes #1136 * removed a log::info * removed temp.rs * cargo clippy no longer complains * new get_lang_server function * get_lang_server is now launch_language_server * launch_lang_server will now close the previous one * better code readability * remove resfresh_ls(and a wrong comment)
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/commands.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index ff8d7a4f..8e57ef30 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -1907,7 +1907,7 @@ mod cmd {
let jobs = &mut cx.jobs;
let (_, doc) = current!(cx.editor);
- if let Some(path) = path {
+ if let Some(ref path) = path {
doc.set_path(Some(path.as_ref()))
.context("invalid filepath")?;
}
@@ -1927,6 +1927,11 @@ mod cmd {
});
let future = doc.format_and_save(fmt);
cx.jobs.add(Job::new(future).wait_before_exiting());
+
+ if path.is_some() {
+ let id = doc.id();
+ let _ = cx.editor.refresh_language_server(id);
+ }
Ok(())
}