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

This commit is contained in:
Blaž Hrastnik 2021-11-06 17:54:04 +09:00
parent 4c1321b3b6
commit f659e1178a

View File

@ -2196,8 +2196,7 @@ fn vsplit(
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 @@ fn hsplit(
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)?;