aboutsummaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/document.rs18
1 files changed, 13 insertions, 5 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs
index 61bea527..ff64689e 100644
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -574,7 +574,12 @@ impl Document {
}
};
- let identifier = self.identifier();
+ let identifier = if self.path().is_some() {
+ Some(self.identifier())
+ } else {
+ None
+ };
+
let language_server = self.language_server.clone();
// mark changes up to now as saved
@@ -628,10 +633,13 @@ impl Document {
if !language_server.is_initialized() {
return Ok(event);
}
- if let Some(notification) =
- language_server.text_document_did_save(identifier, &text)
- {
- notification.await?;
+
+ if let Some(identifier) = identifier {
+ if let Some(notification) =
+ language_server.text_document_did_save(identifier, &text)
+ {
+ notification.await?;
+ }
}
}