mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-07 02:57:34 +00:00
Implement Debug for keymap::MatchResult
Helpful when debugging issues with keystroke dispatch. Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
parent
92f411f01e
commit
d5cc3fea3d
1 changed files with 13 additions and 0 deletions
|
@ -76,6 +76,19 @@ pub enum MatchResult {
|
||||||
Action(Box<dyn AnyAction>),
|
Action(Box<dyn AnyAction>),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Debug for MatchResult {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
match self {
|
||||||
|
MatchResult::None => f.debug_struct("MatchResult::None").finish(),
|
||||||
|
MatchResult::Pending => f.debug_struct("MatchResult::Pending").finish(),
|
||||||
|
MatchResult::Action(action) => f
|
||||||
|
.debug_tuple("MatchResult::Action")
|
||||||
|
.field(&action.name())
|
||||||
|
.finish(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Matcher {
|
impl Matcher {
|
||||||
pub fn new(keymap: Keymap) -> Self {
|
pub fn new(keymap: Keymap) -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|
Loading…
Reference in a new issue