on master help sign in
minor: view!(..).doc is slightly more efficient than current!(..).1.id()
commitf659e1178a20cfaa151eaf62af3135a233272151 authorBlaž Hrastnik <blaz@mxxn.io> dateSat 6 Nov 2021, 17:54 (5 years ago) parent4c1321b
1 file changed+2−4
helix-term/src/commands.rs+2−4
helix-term/src/commands.rs+2−4
@@ -2196,8 +2196,7 @@ mod cmd {
21962196 args: &[&str],
21972197 _event: PromptEvent,
21982198 ) -> anyhow::Result<()> {
2199− let (_, doc) = current!(cx.editor);
2200− let id = doc.id();
2199+ let id = view!(cx.editor).doc;
22012200
22022201 if let Some(path) = args.get(0) {
22032202 cx.editor.open(path.into(), Action::VerticalSplit)?;
@@ -2213,8 +2212,7 @@ mod cmd {
22132212 args: &[&str],
22142213 _event: PromptEvent,
22152214 ) -> anyhow::Result<()> {
2216− let (_, doc) = current!(cx.editor);
2217− let id = doc.id();
2215+ let id = view!(cx.editor).doc;
22182216
22192217 if let Some(path) = args.get(0) {
22202218 cx.editor.open(path.into(), Action::HorizontalSplit)?;