From bcefbfd990ab117c311916224c1431eb9b6f5f45 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Fri, 3 Nov 2023 22:42:14 +0800 Subject: [PATCH] .. [no ci] --- yazi-core/src/input/input.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/yazi-core/src/input/input.rs b/yazi-core/src/input/input.rs index 98def8f0..d6a7d18d 100644 --- a/yazi-core/src/input/input.rs +++ b/yazi-core/src/input/input.rs @@ -3,11 +3,11 @@ use std::ops::Range; use crossterm::event::KeyCode; use tokio::sync::mpsc::UnboundedSender; use unicode_width::UnicodeWidthStr; -use yazi_config::keymap::Key; +use yazi_config::keymap::{Exec, Key, KeymapLayer}; use yazi_shared::{CharKind, InputError}; use super::{mode::InputMode, op::InputOp, InputOpt, InputSnap, InputSnaps}; -use crate::{external, Position}; +use crate::{emit, external, Position}; #[derive(Default)] pub struct Input { @@ -68,6 +68,10 @@ impl Input { InputMode::Insert => { snap.mode = InputMode::Normal; self.move_(-1); + + if self.completion { + emit!(Call(Exec::call("close", vec![]).vec(), KeymapLayer::Completion)); + } } } self.snaps.tag();