.. [no ci]

This commit is contained in:
sxyazi 2023-11-03 22:42:14 +08:00
parent ab723c5ba7
commit bcefbfd990
No known key found for this signature in database

View file

@ -3,11 +3,11 @@ use std::ops::Range;
use crossterm::event::KeyCode; use crossterm::event::KeyCode;
use tokio::sync::mpsc::UnboundedSender; use tokio::sync::mpsc::UnboundedSender;
use unicode_width::UnicodeWidthStr; use unicode_width::UnicodeWidthStr;
use yazi_config::keymap::Key; use yazi_config::keymap::{Exec, Key, KeymapLayer};
use yazi_shared::{CharKind, InputError}; use yazi_shared::{CharKind, InputError};
use super::{mode::InputMode, op::InputOp, InputOpt, InputSnap, InputSnaps}; use super::{mode::InputMode, op::InputOp, InputOpt, InputSnap, InputSnaps};
use crate::{external, Position}; use crate::{emit, external, Position};
#[derive(Default)] #[derive(Default)]
pub struct Input { pub struct Input {
@ -68,6 +68,10 @@ impl Input {
InputMode::Insert => { InputMode::Insert => {
snap.mode = InputMode::Normal; snap.mode = InputMode::Normal;
self.move_(-1); self.move_(-1);
if self.completion {
emit!(Call(Exec::call("close", vec![]).vec(), KeymapLayer::Completion));
}
} }
} }
self.snaps.tag(); self.snaps.tag();