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,10 +185,11 @@ open_origin = "hovered"
|
||||||
open_offset = [ 0, 1, 50, 7 ]
|
open_offset = [ 0, 1, 50, 7 ]
|
||||||
|
|
||||||
[which]
|
[which]
|
||||||
|
enable = true
|
||||||
sort_by = "none"
|
sort_by = "none"
|
||||||
sort_sensitive = false
|
sort_sensitive = false
|
||||||
sort_reverse = false
|
sort_reverse = false
|
||||||
sort_translit = false
|
sort_translit = false
|
||||||
|
|
||||||
[log]
|
[log]
|
||||||
enabled = false
|
enabled = false
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ use crate::MERGED_YAZI;
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize, Validate)]
|
#[derive(Debug, Deserialize, Serialize, Validate)]
|
||||||
pub struct Which {
|
pub struct Which {
|
||||||
|
pub enable: bool,
|
||||||
// Sorting
|
// Sorting
|
||||||
pub sort_by: SortBy,
|
pub sort_by: SortBy,
|
||||||
pub sort_sensitive: bool,
|
pub sort_sensitive: bool,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use std::{collections::HashSet, str::FromStr};
|
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 yazi_shared::{event::Cmd, render, Layer};
|
||||||
|
|
||||||
use crate::which::{Which, WhichSorter};
|
use crate::which::{Which, WhichSorter};
|
||||||
|
|
@ -43,6 +43,10 @@ impl Which {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn show_with(&mut self, key: &Key, layer: Layer) {
|
pub fn show_with(&mut self, key: &Key, layer: Layer) {
|
||||||
|
if !WHICH.enable {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let mut seen = HashSet::new();
|
let mut seen = HashSet::new();
|
||||||
|
|
||||||
self.layer = layer;
|
self.layer = layer;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue