Skip to content

Commit

Permalink
Deprecate/remove vim_mode in DateSelect
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelmello committed Jan 7, 2024
1 parent b69129b commit 5f31a0a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- Ctrl-p/Ctrl-n for up/down
- Ctrl-b/Ctrl-f for left/right
- Ctrl-j/Ctrl-g for enter/cancel
- Vim keybindings are always supported in DateSelect prompts.
- Added 'with_starting_filter_input' to both Select and MultiSelect, which allows for setting an initial value to the filter section of the prompt.
- Added starting_input for CustomType. [#194](https://github.com/mikaelmello/inquire/pull/194)
- Added 'without_filtering' to both Select and MultiSelect, useful when you want to simplify the UX if the filter does not add any value, such as when the list is already short.
Expand Down
4 changes: 0 additions & 4 deletions inquire/src/prompts/dateselect/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ use crate::DateSelect;
/// Configuration settings used in the execution of a DateSelectPrompt.
#[derive(Copy, Clone, Debug)]
pub struct DateSelectConfig {
/// Whether to support vim-style keybindings.
pub vim_mode: bool,

/// Min date allowed to be selected.
pub min_date: Option<NaiveDate>,

Expand All @@ -21,7 +18,6 @@ pub struct DateSelectConfig {
impl From<&DateSelect<'_>> for DateSelectConfig {
fn from(value: &DateSelect<'_>) -> Self {
Self {
vim_mode: value.vim_mode,
min_date: value.min_date,
max_date: value.max_date,
week_start: value.week_start,
Expand Down
11 changes: 0 additions & 11 deletions inquire/src/prompts/dateselect/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ pub struct DateSelect<'a> {
/// Help message to be presented to the user.
pub help_message: Option<&'a str>,

/// Whether vim mode is enabled. When enabled, the user can
/// navigate through the options using hjkl.
pub vim_mode: bool,

/// Function that formats the user input and presents it to the user as the final rendering of the prompt.
pub formatter: DateFormatter<'a>,

Expand Down Expand Up @@ -141,7 +137,6 @@ impl<'a> DateSelect<'a> {
min_date: Self::DEFAULT_MIN_DATE,
max_date: Self::DEFAULT_MAX_DATE,
help_message: Self::DEFAULT_HELP_MESSAGE,
vim_mode: Self::DEFAULT_VIM_MODE,
formatter: Self::DEFAULT_FORMATTER,
validators: Self::DEFAULT_VALIDATORS,
week_start: Self::DEFAULT_WEEK_START,
Expand Down Expand Up @@ -220,12 +215,6 @@ impl<'a> DateSelect<'a> {
self
}

/// Enables or disables vim_mode.
pub fn with_vim_mode(mut self, vim_mode: bool) -> Self {
self.vim_mode = vim_mode;
self
}

/// Sets the formatter.
pub fn with_formatter(mut self, formatter: DateFormatter<'a>) -> Self {
self.formatter = formatter;
Expand Down

0 comments on commit 5f31a0a

Please sign in to comment.