diff options
author | Blaž Hrastnik | 2021-11-06 08:54:04 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-11-06 08:54:04 +0000 |
commit | f659e1178a20cfaa151eaf62af3135a233272151 (patch) | |
tree | 356af8d2f61d934a06de04f317019a06520886cc | |
parent | 4c1321b3b6b5b2f4e9f33963877a1019ba746e04 (diff) |
minor: view!(..).doc is slightly more efficient than current!(..).1.id()
-rw-r--r-- | helix-term/src/commands.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 752b5900..aa18bef0 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2196,8 +2196,7 @@ mod cmd { args: &[&str], _event: PromptEvent, ) -> anyhow::Result<()> { - let (_, doc) = current!(cx.editor); - let id = doc.id(); + let id = view!(cx.editor).doc; if let Some(path) = args.get(0) { cx.editor.open(path.into(), Action::VerticalSplit)?; @@ -2213,8 +2212,7 @@ mod cmd { args: &[&str], _event: PromptEvent, ) -> anyhow::Result<()> { - let (_, doc) = current!(cx.editor); - let id = doc.id(); + let id = view!(cx.editor).doc; if let Some(path) = args.get(0) { cx.editor.open(path.into(), Action::HorizontalSplit)?; |