File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -237,7 +237,8 @@ impl Component for ChangesComponent {
237237 }
238238 true
239239 }
240- keys:: STATUS_RESET_FILE => {
240+ keys:: STATUS_RESET_FILE_1
241+ | keys:: STATUS_RESET_FILE_2 => {
241242 self . is_working_dir
242243 && self . dispatch_reset_workdir ( )
243244 }
Original file line number Diff line number Diff line change @@ -7,12 +7,17 @@ const fn no_mod(code: KeyCode) -> KeyEvent {
77 }
88}
99
10+ const fn with_mod (
11+ code : KeyCode ,
12+ modifiers : KeyModifiers ,
13+ ) -> KeyEvent {
14+ KeyEvent { code, modifiers }
15+ }
16+
1017pub const FOCUS_WORKDIR : KeyEvent = no_mod ( KeyCode :: Char ( '1' ) ) ;
1118pub const FOCUS_STAGE : KeyEvent = no_mod ( KeyCode :: Char ( '2' ) ) ;
1219pub const FOCUS_RIGHT : KeyEvent = no_mod ( KeyCode :: Right ) ;
1320pub const FOCUS_LEFT : KeyEvent = no_mod ( KeyCode :: Left ) ;
14- pub const STATUS_RESET_FILE : KeyEvent = no_mod ( KeyCode :: Char ( 'D' ) ) ;
15- pub const STATUS_STAGE_FILE : KeyEvent = no_mod ( KeyCode :: Enter ) ;
1621pub const EXIT_1 : KeyEvent = no_mod ( KeyCode :: Esc ) ;
1722pub const EXIT_POPUP : KeyEvent = no_mod ( KeyCode :: Esc ) ;
1823pub const EXIT_2 : KeyEvent = no_mod ( KeyCode :: Char ( 'q' ) ) ;
@@ -21,3 +26,7 @@ pub const OPEN_COMMIT: KeyEvent = no_mod(KeyCode::Char('c'));
2126pub const OPEN_HELP : KeyEvent = no_mod ( KeyCode :: Char ( 'h' ) ) ;
2227pub const MOVE_UP : KeyEvent = no_mod ( KeyCode :: Up ) ;
2328pub const MOVE_DOWN : KeyEvent = no_mod ( KeyCode :: Down ) ;
29+ pub const STATUS_STAGE_FILE : KeyEvent = no_mod ( KeyCode :: Enter ) ;
30+ pub const STATUS_RESET_FILE_1 : KeyEvent = no_mod ( KeyCode :: Char ( 'D' ) ) ;
31+ pub const STATUS_RESET_FILE_2 : KeyEvent =
32+ with_mod ( KeyCode :: Char ( 'D' ) , KeyModifiers :: SHIFT ) ;
You can’t perform that action at this time.
0 commit comments