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 {
237
237
}
238
238
true
239
239
}
240
- keys:: STATUS_RESET_FILE => {
240
+ keys:: STATUS_RESET_FILE_1
241
+ | keys:: STATUS_RESET_FILE_2 => {
241
242
self . is_working_dir
242
243
&& self . dispatch_reset_workdir ( )
243
244
}
Original file line number Diff line number Diff line change @@ -7,12 +7,17 @@ const fn no_mod(code: KeyCode) -> KeyEvent {
7
7
}
8
8
}
9
9
10
+ const fn with_mod (
11
+ code : KeyCode ,
12
+ modifiers : KeyModifiers ,
13
+ ) -> KeyEvent {
14
+ KeyEvent { code, modifiers }
15
+ }
16
+
10
17
pub const FOCUS_WORKDIR : KeyEvent = no_mod ( KeyCode :: Char ( '1' ) ) ;
11
18
pub const FOCUS_STAGE : KeyEvent = no_mod ( KeyCode :: Char ( '2' ) ) ;
12
19
pub const FOCUS_RIGHT : KeyEvent = no_mod ( KeyCode :: Right ) ;
13
20
pub 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 ) ;
16
21
pub const EXIT_1 : KeyEvent = no_mod ( KeyCode :: Esc ) ;
17
22
pub const EXIT_POPUP : KeyEvent = no_mod ( KeyCode :: Esc ) ;
18
23
pub const EXIT_2 : KeyEvent = no_mod ( KeyCode :: Char ( 'q' ) ) ;
@@ -21,3 +26,7 @@ pub const OPEN_COMMIT: KeyEvent = no_mod(KeyCode::Char('c'));
21
26
pub const OPEN_HELP : KeyEvent = no_mod ( KeyCode :: Char ( 'h' ) ) ;
22
27
pub const MOVE_UP : KeyEvent = no_mod ( KeyCode :: Up ) ;
23
28
pub 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