We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c202c1 commit 80a9b3cCopy full SHA for 80a9b3c
helix-view/src/editor.rs
@@ -1202,10 +1202,12 @@ impl Editor {
1202
let path = path.map(|path| path.into());
1203
let doc = doc_mut!(self, &doc_id);
1204
let future = doc.save(path, force)?;
1205
- // TODO: if no self.saves for that doc id then bail
1206
- // bail!("saves are closed for this document!");
+
1207
use futures_util::stream;
1208
- self.saves[&doc_id]
+ self.saves
1209
+ .get(&doc_id)
1210
+ .ok_or_else(|| anyhow::format_err!("saves are closed for this document!"))?
1211
.send(stream::once(Box::pin(future)))
1212
.map_err(|err| anyhow!("failed to send save event: {}", err))?;
1213
0 commit comments