aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-11-06 08:54:04 +0000
committerBlaž Hrastnik2021-11-06 08:54:04 +0000
commitf659e1178a20cfaa151eaf62af3135a233272151 (patch)
tree356af8d2f61d934a06de04f317019a06520886cc /helix-term/src
parent4c1321b3b6b5b2f4e9f33963877a1019ba746e04 (diff)
minor: view!(..).doc is slightly more efficient than current!(..).1.id()
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/commands.rs6
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)?;