summaryrefslogtreecommitdiffstats
path: root/src/key_command/impl_display.rs
diff options
context:
space:
mode:
authorAzad <49314270+Akmadan23@users.noreply.github.com>2024-03-14 17:05:42 +0100
committerGitHub <noreply@github.com>2024-03-14 12:05:42 -0400
commit2536838ce31955ec55561aabb4b86fdd4bc984df (patch)
tree186952491a26613054c338046ff96df411b7c34d /src/key_command/impl_display.rs
parent9339b90cd4a8b26aaa57d63b90c633f427990745 (diff)
feat: add `--reverse` flag to sort methods (#507)
Diffstat (limited to 'src/key_command/impl_display.rs')
-rw-r--r--src/key_command/impl_display.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/key_command/impl_display.rs b/src/key_command/impl_display.rs
index 50252ed..b219a9a 100644
--- a/src/key_command/impl_display.rs
+++ b/src/key_command/impl_display.rs
@@ -49,7 +49,17 @@ impl std::fmt::Display for Command {
Self::SearchRegex { pattern } => write!(f, "{} {}", self.command(), pattern),
Self::SearchString { pattern } => write!(f, "{} {}", self.command(), pattern),
Self::SubProcess { words, .. } => write!(f, "{} {:?}", self.command(), words),
- Self::Sort(t) => write!(f, "{} {}", self.command(), t),
+ Self::Sort { sort_type, reverse } => write!(
+ f,
+ "{} {}{}",
+ self.command(),
+ sort_type,
+ match reverse {
+ Some(true) => " --reverse=true",
+ Some(false) => " --reverse=false",
+ None => "",
+ },
+ ),
Self::TabSwitch { offset } => write!(f, "{} {}", self.command(), offset),
Self::TabSwitchIndex { index } => write!(f, "{} {}", self.command(), index),
_ => write!(f, "{}", self.command()),