aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs23
1 files changed, 17 insertions, 6 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index e7091401..365d5b65 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -448,9 +448,16 @@ impl MappableCommand {
impl fmt::Debug for MappableCommand {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- f.debug_tuple("MappableCommand")
- .field(&self.name())
- .finish()
+ match self {
+ MappableCommand::Static { name, .. } => {
+ f.debug_tuple("MappableCommand").field(name).finish()
+ }
+ MappableCommand::Typable { name, args, .. } => f
+ .debug_tuple("MappableCommand")
+ .field(name)
+ .field(args)
+ .finish(),
+ }
}
}
@@ -505,12 +512,16 @@ impl PartialEq for MappableCommand {
match (self, other) {
(
MappableCommand::Typable {
- name: first_name, ..
+ name: first_name,
+ args: first_args,
+ ..
},
MappableCommand::Typable {
- name: second_name, ..
+ name: second_name,
+ args: second_args,
+ ..
},
- ) => first_name == second_name,
+ ) => first_name == second_name && first_args == second_args,
(
MappableCommand::Static {
name: first_name, ..