Cleaned up some code with some macros

This commit is contained in:
2023-08-08 10:50:05 -06:00
parent cab3d1d50d
commit 0f9dc639a8
10 changed files with 132 additions and 204 deletions
+15
View File
@@ -62,3 +62,18 @@ fn handle_prompt_toggle(app: &mut App, key: &Key) {
_ => (),
}
}
#[macro_export]
macro_rules! handle_text_box_keys {
($self:expr, $key:expr, $input:expr) => {
match $self.key {
_ if *$key == DEFAULT_KEYBINDINGS.backspace.key => {
$input.pop();
}
Key::Char(character) => {
$input.push(*character);
}
_ => (),
}
};
}