support case config
This commit is contained in:
parent
4da1b9d328
commit
1423fd68e7
3 changed files with 13 additions and 3 deletions
|
@ -90,10 +90,11 @@ This library is not available publicly yet as the interface is not stable enough
|
|||
* `line_wrap` is now called `line-wrap`
|
||||
* Wofi has a C-API, that is not and won't be supported, but Worf can be used as a rust library.
|
||||
|
||||
### Dropped arguments
|
||||
### Dropped arguments / config values
|
||||
* `mode`, use show
|
||||
* `dmenu`, use show
|
||||
* `D`, arguments are the same as config in worf, no need to have this flag.
|
||||
* `dark`, dark setting from theme is used now.
|
||||
|
||||
### Dropped configuration options
|
||||
* stylesheet -> use style instead
|
||||
|
|
|
@ -224,7 +224,7 @@ pub struct Config {
|
|||
matching: Option<MatchMethod>,
|
||||
|
||||
#[clap(short = 'i', long = "insensitive")]
|
||||
insensitive: Option<bool>, // todo support this
|
||||
insensitive: Option<bool>,
|
||||
|
||||
#[clap(short = 'q', long = "parse-search")]
|
||||
parse_search: Option<bool>, // todo support this
|
||||
|
@ -473,6 +473,11 @@ impl Config {
|
|||
pub fn show(&self) -> Option<Mode> {
|
||||
self.show.clone()
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn insensitive(&self) -> bool {
|
||||
self.insensitive.unwrap_or(true)
|
||||
}
|
||||
}
|
||||
|
||||
fn default_false() -> bool {
|
||||
|
|
|
@ -854,7 +854,11 @@ fn set_menu_visibility_for_search<T: Clone>(
|
|||
menu_item.visible = true;
|
||||
}
|
||||
} else {
|
||||
let query = query.to_owned().to_lowercase(); // todo match case sensitive according to conf
|
||||
let query = if config.insensitive() {
|
||||
query.to_owned().to_lowercase()
|
||||
} else {
|
||||
query.to_owned()
|
||||
};
|
||||
for menu_item in items.iter_mut() {
|
||||
let menu_item_search = format!(
|
||||
"{} {}",
|
||||
|
|
Loading…
Add table
Reference in a new issue