mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
chore: rename INPUTBOX and SELECTBOX
This commit is contained in:
parent
e0095950eb
commit
6d8a5469bd
7 changed files with 19 additions and 19 deletions
|
|
@ -33,8 +33,8 @@ pub static PLUGINS: RoCell<plugins::Plugins> = RoCell::new();
|
|||
pub static PREVIEW: RoCell<preview::Preview> = RoCell::new();
|
||||
pub static TASKS: RoCell<tasks::Tasks> = RoCell::new();
|
||||
pub static THEME: RoCell<theme::Theme> = RoCell::new();
|
||||
pub static INPUTBOX: RoCell<popup::Input> = RoCell::new();
|
||||
pub static SELECTBOX: RoCell<popup::Select> = RoCell::new();
|
||||
pub static INPUT: RoCell<popup::Input> = RoCell::new();
|
||||
pub static SELECT: RoCell<popup::Select> = RoCell::new();
|
||||
|
||||
pub static BOOT: RoCell<boot::Boot> = RoCell::new();
|
||||
|
||||
|
|
@ -51,8 +51,8 @@ pub fn init() {
|
|||
PREVIEW.with(Default::default);
|
||||
TASKS.with(Default::default);
|
||||
THEME.with(Default::default);
|
||||
INPUTBOX.with(Default::default);
|
||||
SELECTBOX.with(Default::default);
|
||||
INPUT.with(Default::default);
|
||||
SELECT.with(Default::default);
|
||||
|
||||
BOOT.with(Default::default);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std::ffi::OsString;
|
||||
|
||||
use yazi_config::{keymap::Exec, OPEN, SELECTBOX};
|
||||
use yazi_config::{keymap::Exec, OPEN, SELECT};
|
||||
use yazi_shared::MIME_DIR;
|
||||
|
||||
use crate::{emit, external, manager::Manager, select::SelectOpt};
|
||||
|
|
@ -23,8 +23,8 @@ impl Manager {
|
|||
let result = emit!(Select(SelectOpt::from_cfg(
|
||||
"Open with:",
|
||||
openers.iter().map(|o| o.desc.clone()).collect(),
|
||||
&SELECTBOX.open_position,
|
||||
&SELECTBOX.open_offset
|
||||
&SELECT.open_position,
|
||||
&SELECT.open_offset
|
||||
)));
|
||||
|
||||
if let Ok(choice) = result.await {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use std::{collections::BTreeSet, ffi::OsStr, io::{stdout, BufWriter, Write}, pat
|
|||
|
||||
use anyhow::{anyhow, bail, Result};
|
||||
use tokio::{fs::{self, OpenOptions}, io::{stdin, AsyncReadExt, AsyncWriteExt}};
|
||||
use yazi_config::{keymap::Exec, INPUTBOX, OPEN, PREVIEW};
|
||||
use yazi_config::{keymap::Exec, INPUT, OPEN, PREVIEW};
|
||||
use yazi_shared::{max_common_root, Defer, Term, Url};
|
||||
|
||||
use crate::{emit, external::{self, ShellOpt}, files::{File, FilesOp}, input::InputOpt, manager::Manager, Event, BLOCKER};
|
||||
|
|
@ -43,7 +43,7 @@ impl Manager {
|
|||
let opt = opt.into() as Opt;
|
||||
tokio::spawn(async move {
|
||||
let mut result = emit!(Input(
|
||||
InputOpt::from_cfg("Rename:", &INPUTBOX.rename_position, &INPUTBOX.rename_offset)
|
||||
InputOpt::from_cfg("Rename:", &INPUT.rename_position, &INPUT.rename_offset)
|
||||
.with_value(hovered.file_name().unwrap().to_string_lossy())
|
||||
));
|
||||
|
||||
|
|
@ -59,8 +59,8 @@ impl Manager {
|
|||
|
||||
let mut result = emit!(Input(InputOpt::from_cfg(
|
||||
"Overwrite an existing file? (y/N)",
|
||||
&INPUTBOX.rename_position,
|
||||
&INPUTBOX.rename_offset
|
||||
&INPUT.rename_position,
|
||||
&INPUT.rename_offset
|
||||
)));
|
||||
if let Some(Ok(choice)) = result.recv().await {
|
||||
if choice == "y" || choice == "Y" {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use std::{mem, time::Duration};
|
|||
|
||||
use tokio::{fs, pin};
|
||||
use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt};
|
||||
use yazi_config::{keymap::{Exec, KeymapLayer}, INPUTBOX};
|
||||
use yazi_config::{keymap::{Exec, KeymapLayer}, INPUT};
|
||||
use yazi_shared::{expand_path, Debounce, InputError, Url};
|
||||
|
||||
use crate::{emit, input::InputOpt, tab::Tab};
|
||||
|
|
@ -66,7 +66,7 @@ impl Tab {
|
|||
|
||||
tokio::spawn(async move {
|
||||
let rx = emit!(Input(
|
||||
InputOpt::from_cfg("Change directory:", &INPUTBOX.cd_position, &INPUTBOX.cd_offset)
|
||||
InputOpt::from_cfg("Change directory:", &INPUT.cd_position, &INPUT.cd_offset)
|
||||
.with_value(opt.target.to_string_lossy())
|
||||
.with_completion()
|
||||
));
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use std::time::Duration;
|
|||
|
||||
use tokio::pin;
|
||||
use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt};
|
||||
use yazi_config::{keymap::{Exec, KeymapLayer}, INPUTBOX};
|
||||
use yazi_config::{keymap::{Exec, KeymapLayer}, INPUT};
|
||||
use yazi_shared::{Debounce, InputError};
|
||||
|
||||
use crate::{emit, input::InputOpt, tab::{Finder, FinderCase, Tab}};
|
||||
|
|
@ -41,7 +41,7 @@ impl Tab {
|
|||
tokio::spawn(async move {
|
||||
let title = if opt.prev { "Find previous:" } else { "Find next:" };
|
||||
let rx = emit!(Input(
|
||||
InputOpt::from_cfg(title, &INPUTBOX.find_position, &INPUTBOX.find_offset).with_realtime()
|
||||
InputOpt::from_cfg(title, &INPUT.find_position, &INPUT.find_offset).with_realtime()
|
||||
));
|
||||
|
||||
let rx = Debounce::new(UnboundedReceiverStream::new(rx), Duration::from_millis(50));
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use std::{mem, time::Duration};
|
|||
use anyhow::bail;
|
||||
use tokio::pin;
|
||||
use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt};
|
||||
use yazi_config::{keymap::{Exec, KeymapLayer}, INPUTBOX};
|
||||
use yazi_config::{keymap::{Exec, KeymapLayer}, INPUT};
|
||||
|
||||
use crate::{emit, external, files::FilesOp, input::InputOpt, tab::Tab};
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ impl Tab {
|
|||
let hidden = self.conf.show_hidden;
|
||||
|
||||
self.search = Some(tokio::spawn(async move {
|
||||
let Some(Ok(subject)) = emit!(Input(InputOpt::from_cfg("Search:", &INPUTBOX.cd_position, &INPUTBOX.cd_offset))).recv().await else {
|
||||
let Some(Ok(subject)) = emit!(Input(InputOpt::from_cfg("Search:", &INPUT.cd_position, &INPUT.cd_offset))).recv().await else {
|
||||
bail!("")
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use yazi_config::{keymap::Exec, open::Opener, INPUTBOX};
|
||||
use yazi_config::{keymap::Exec, open::Opener, INPUT};
|
||||
|
||||
use crate::{emit, input::InputOpt, tab::Tab};
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ impl Tab {
|
|||
if !opt.confirm || opt.cmd.is_empty() {
|
||||
let title = if opt.block { "Shell (block):" } else { "Shell:" };
|
||||
let mut result = emit!(Input(
|
||||
InputOpt::from_cfg(title, &INPUTBOX.shell_position, &INPUTBOX.shell_offset)
|
||||
InputOpt::from_cfg(title, &INPUT.shell_position, &INPUT.shell_offset)
|
||||
.with_value(opt.cmd)
|
||||
.with_highlight()
|
||||
));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue