mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
feat: support enable for which-key
This commit is contained in:
parent
189cb81db3
commit
ebd57cea44
3 changed files with 9 additions and 3 deletions
|
|
@ -185,6 +185,7 @@ open_origin = "hovered"
|
|||
open_offset = [ 0, 1, 50, 7 ]
|
||||
|
||||
[which]
|
||||
enable = true
|
||||
sort_by = "none"
|
||||
sort_sensitive = false
|
||||
sort_reverse = false
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ use crate::MERGED_YAZI;
|
|||
|
||||
#[derive(Debug, Deserialize, Serialize, Validate)]
|
||||
pub struct Which {
|
||||
pub enable: bool,
|
||||
// Sorting
|
||||
pub sort_by: SortBy,
|
||||
pub sort_sensitive: bool,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std::{collections::HashSet, str::FromStr};
|
||||
|
||||
use yazi_config::{keymap::{Control, Key}, KEYMAP};
|
||||
use yazi_config::{keymap::{Control, Key}, KEYMAP, WHICH};
|
||||
use yazi_shared::{event::Cmd, render, Layer};
|
||||
|
||||
use crate::which::{Which, WhichSorter};
|
||||
|
|
@ -43,6 +43,10 @@ impl Which {
|
|||
}
|
||||
|
||||
pub fn show_with(&mut self, key: &Key, layer: Layer) {
|
||||
if !WHICH.enable {
|
||||
return;
|
||||
}
|
||||
|
||||
let mut seen = HashSet::new();
|
||||
|
||||
self.layer = layer;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue