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],
_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)?;

Loading…
Cancel
Save