aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
authorSkyler Hawthorne2022-08-31 19:08:00 +0000
committerSkyler Hawthorne2022-10-19 02:31:39 +0000
commitaf03df3413f04ce7079d14388ce42fe70bd1397e (patch)
treed23e4e7746c4f5c31ec9709e95798b81beb67252 /helix-view/src
parent18c32118b1df63895b662c1b37ada28ad0d5c9b5 (diff)
fix write scratch buffer to file
Diffstat (limited to 'helix-view/src')
-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?;
+ }
}
}