mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-24 10:26:18 +04:00
Use doc_mut! macro for document accesses
This commit is contained in:
parent
816dfee64a
commit
19111e1478
@ -1855,11 +1855,7 @@ fn label(&self, _data: &Self::Data) -> Spans {
|
|||||||
cx.editor
|
cx.editor
|
||||||
.open(path, Action::HorizontalSplit)
|
.open(path, Action::HorizontalSplit)
|
||||||
.and_then(|id| {
|
.and_then(|id| {
|
||||||
cx.editor
|
doc_mut!(cx.editor, &id).set_path(None).map_err(Into::into)
|
||||||
.document_mut(id)
|
|
||||||
.unwrap()
|
|
||||||
.set_path(None)
|
|
||||||
.map_err(Into::into)
|
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
cx.editor.set_error(e.to_string());
|
cx.editor.set_error(e.to_string());
|
||||||
@ -1887,7 +1883,7 @@ fn label(&self, _data: &Self::Data) -> Spans {
|
|||||||
|
|
||||||
ensure!(path.is_file(), "No help available for '{}'", args_msg);
|
ensure!(path.is_file(), "No help available for '{}'", args_msg);
|
||||||
let id = editor.open(&path, Action::HorizontalSplit)?;
|
let id = editor.open(&path, Action::HorizontalSplit)?;
|
||||||
editor.document_mut(id).unwrap().set_path(None)?;
|
doc_mut!(editor, &id).set_path(None)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user