minor: view!(..).doc is slightly more efficient than current!(..).1.id()

imgbot
Blaž Hrastnik 3 years ago
parent 4c1321b3b6
commit f659e1178a

@ -2196,8 +2196,7 @@ mod cmd {
args: &[&str], args: &[&str],
_event: PromptEvent, _event: PromptEvent,
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
let (_, doc) = current!(cx.editor); let id = view!(cx.editor).doc;
let id = doc.id();
if let Some(path) = args.get(0) { if let Some(path) = args.get(0) {
cx.editor.open(path.into(), Action::VerticalSplit)?; cx.editor.open(path.into(), Action::VerticalSplit)?;
@ -2213,8 +2212,7 @@ mod cmd {
args: &[&str], args: &[&str],
_event: PromptEvent, _event: PromptEvent,
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
let (_, doc) = current!(cx.editor); let id = view!(cx.editor).doc;
let id = doc.id();
if let Some(path) = args.get(0) { if let Some(path) = args.get(0) {
cx.editor.open(path.into(), Action::HorizontalSplit)?; cx.editor.open(path.into(), Action::HorizontalSplit)?;

Loading…
Cancel
Save