brain: Press `r` to reject a commit
1f6bc6479c73a9b737407cf499af73f17213b382
1 parent
45fe3ae4
crates/brain/src/session.rs
+5 -0
| 1089 | 1089 | } |
|
| 1090 | 1090 | Event::Key(Key::Tab) => { |
|
| 1091 | 1091 | self.next_tab()?; |
|
| 1092 | 1092 | return Ok(Control::Redraw); |
|
| 1093 | 1093 | } |
|
| 1094 | + | Event::Key(Key::Char('r')) => { |
|
| 1095 | + | self.toggle_commit_rejected(self.current)?; |
|
| 1096 | + | self.next_tab()?; |
|
| 1097 | + | return Ok(Control::Redraw); |
|
| 1098 | + | } |
|
| 1094 | 1099 | Event::Key(Key::Char('c') | Key::Enter) => { |
|
| 1095 | 1100 | view.enter(); |
|
| 1096 | 1101 | return Ok(Control::Redraw); |
|
| 1097 | 1102 | } |
|
| 1098 | 1103 | Event::Key(Key::Char('n')) => { |
a.rs
+0 -0
crates/brain/src/session/status.rs
+7 -0
| 101 | 101 | ("c", "comment"), |
|
| 102 | 102 | ]; |
|
| 103 | 103 | /// Action hints shown while browsing hunk comments. |
|
| 104 | 104 | const HUNK_BROWSE_ACTIONS: &[(&str, &str)] = &[ |
|
| 105 | 105 | (TAB_KEY, "history"), |
|
| 106 | + | ("r", "reject commit"), |
|
| 106 | 107 | ("c", "new"), |
|
| 107 | 108 | ("e", "edit"), |
|
| 108 | 109 | ("d", "delete"), |
|
| 109 | 110 | ("n/p", "select"), |
|
| 110 | 111 | ("esc", "commit"), |
| 597 | 598 | ActionContext::Commits |
|
| 598 | 599 | .actions() |
|
| 599 | 600 | .iter() |
|
| 600 | 601 | .any(|(_, label)| *label == "reject commit") |
|
| 601 | 602 | ); |
|
| 603 | + | assert!( |
|
| 604 | + | ActionContext::HunkBrowse |
|
| 605 | + | .actions() |
|
| 606 | + | .iter() |
|
| 607 | + | .any(|(_, label)| *label == "reject commit") |
|
| 608 | + | ); |
|
| 602 | 609 | assert!( |
|
| 603 | 610 | ActionContext::HunkEdit |
|
| 604 | 611 | .actions() |
|
| 605 | 612 | .iter() |
|
| 606 | 613 | .any(|(_, label)| *label == "save") |