summaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authords-cbo2022-12-16 14:53:37 +0000
committerMichael Davis2023-01-25 15:31:58 +0000
commit67a287dd818bea14d550951a9660e8b0775bd8d0 (patch)
treea538845ed5e208f77c276b10e514325ca176d3ed /helix-term/src/commands.rs
parent91dca3f667e146f93e6dca205b0a3f2a7a64b488 (diff)
keymap: Test backslash escaping in commands
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, ..