mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-23 15:51:03 +00:00
feat: add show_icons option to disable input popup icons
The icon shown on cd/create/rename/shell input popups (added in #4080) had no way to opt out short of clearing all icon rules, which would also remove file-type icons everywhere else. Add a `show_icons` option under `[input]`, enabled by default, that short-circuits the icon lookup for input popups specifically. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
d6af2ebf80
commit
b53a1b2ea7
4 changed files with 9 additions and 1 deletions
|
|
@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/):
|
|||
- Make help menu a command palette ([#4074])
|
||||
- H/M/L Vim-like motion for moving cursor relative to viewport ([#3970])
|
||||
- Context-aware icons for inputs ([#4080])
|
||||
- New `show_icons` option under `[input]` to toggle icons on input popups ([#4100])
|
||||
- Show file icons in trash/delete/overwrite confirmations ([#4096])
|
||||
- Dynamic keymap Lua API ([#4031])
|
||||
- New `ui.Input` element ([#4040])
|
||||
|
|
@ -1768,3 +1769,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/):
|
|||
[#4074]: https://github.com/sxyazi/yazi/pull/4074
|
||||
[#4080]: https://github.com/sxyazi/yazi/pull/4080
|
||||
[#4096]: https://github.com/sxyazi/yazi/pull/4096
|
||||
[#4100]: https://github.com/sxyazi/yazi/pull/4100
|
||||
|
|
|
|||
|
|
@ -176,6 +176,7 @@ previewers = [
|
|||
|
||||
[input]
|
||||
cursor_blink = false
|
||||
show_icons = true
|
||||
|
||||
# cd
|
||||
cd_title = "Change directory:"
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ use yazi_widgets::input::InputOpt;
|
|||
#[derive(Deserialize, DeserializeOver, DeserializeOver2)]
|
||||
pub struct Input {
|
||||
pub cursor_blink: bool,
|
||||
pub show_icons: bool,
|
||||
|
||||
// cd
|
||||
pub cd_title: String,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use std::path::Path;
|
|||
|
||||
use ratatui_core::{buffer::Buffer, layout::{Margin, Rect}, text::Line, widgets::Widget};
|
||||
use ratatui_widgets::{block::Block, borders::BorderType};
|
||||
use yazi_config::{Icon, THEME};
|
||||
use yazi_config::{Icon, THEME, YAZI};
|
||||
use yazi_core::Core;
|
||||
use yazi_fs::{cha::{Cha, ChaKind}, file::File};
|
||||
use yazi_shim::path::CROSS_SEPARATOR;
|
||||
|
|
@ -15,6 +15,10 @@ impl<'a> Input<'a> {
|
|||
pub(crate) fn new(core: &'a Core) -> Self { Self { core } }
|
||||
|
||||
fn icon(&self) -> Option<Icon> {
|
||||
if !YAZI.input.show_icons {
|
||||
return None;
|
||||
}
|
||||
|
||||
let input = &self.core.input.main;
|
||||
|
||||
let is_dir = input.value().ends_with(CROSS_SEPARATOR);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue