mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
WIP [no ci]
This commit is contained in:
parent
802aa86e23
commit
b749972908
5 changed files with 8 additions and 9 deletions
|
|
@ -16,7 +16,7 @@ pub struct Completion {
|
|||
|
||||
impl Completion {
|
||||
pub fn show(&mut self, opt: CompletionOpt) {
|
||||
self.close();
|
||||
self.close(false);
|
||||
self.items = opt.items;
|
||||
|
||||
self.identifier = format!(
|
||||
|
|
@ -34,7 +34,7 @@ impl Completion {
|
|||
self.max_width = opt.max_width;
|
||||
}
|
||||
|
||||
pub fn close(&mut self) -> bool {
|
||||
pub fn close(&mut self, submit: bool) -> bool {
|
||||
self.cursor = 0;
|
||||
|
||||
self.identifier = String::new();
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ use crate::{external, Position};
|
|||
|
||||
#[derive(Default)]
|
||||
pub struct Input {
|
||||
pub(super) snaps: InputSnaps,
|
||||
pub visible: bool,
|
||||
snaps: InputSnaps,
|
||||
pub visible: bool,
|
||||
|
||||
title: String,
|
||||
pub position: Position,
|
||||
|
|
|
|||
|
|
@ -15,10 +15,7 @@ impl InputOpt {
|
|||
Self {
|
||||
title: title.as_ref().to_owned(),
|
||||
value: String::new(),
|
||||
position: Position::Top(
|
||||
// TODO: hardcode
|
||||
Rect { x: 0, y: 2, width: 50, height: 3 },
|
||||
),
|
||||
position: Position::Top(/* TODO: hardcode */ Rect { x: 0, y: 2, width: 50, height: 3 }),
|
||||
realtime: false,
|
||||
highlight: false,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
mod completion;
|
||||
|
||||
pub(super) use completion::*;
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ impl Executor {
|
|||
|
||||
fn completion(cx: &mut Ctx, exec: &Exec) -> bool {
|
||||
match exec.cmd.as_str() {
|
||||
"close" => cx.completion.close(),
|
||||
"close" => cx.completion.close(exec.named.contains_key("submit")),
|
||||
|
||||
"arrow" => {
|
||||
let step: isize = exec.args.get(0).and_then(|s| s.parse().ok()).unwrap_or(0);
|
||||
|
|
@ -292,6 +292,7 @@ impl Executor {
|
|||
}
|
||||
}
|
||||
|
||||
"help" => cx.help.toggle(cx.layer()),
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue