File tree 4 files changed +22
-0
lines changed
4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
## [ Unreleased]
8
8
9
9
### Added
10
+ - Inspect stash commit in detail ([ #121 ] ( https://github.com/extrawurst/gitui/issues/121 ) )
10
11
- Commit Amend (` ctrl+a ` ) when in commit popup ([ #89 ] ( https://github.com/extrawurst/gitui/issues/89 ) )
11
12
12
13
![ ] ( assets/amend.gif )
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ pub const STASHING_TOGGLE_UNTRACKED: KeyEvent =
57
57
pub const STASHING_TOGGLE_INDEX : KeyEvent =
58
58
no_mod ( KeyCode :: Char ( 'i' ) ) ;
59
59
pub const STASH_APPLY : KeyEvent = no_mod ( KeyCode :: Enter ) ;
60
+ pub const STASH_OPEN : KeyEvent = no_mod ( KeyCode :: Right ) ;
60
61
pub const STASH_DROP : KeyEvent =
61
62
with_mod ( KeyCode :: Char ( 'D' ) , KeyModifiers :: SHIFT ) ;
62
63
pub const CMD_BAR_TOGGLE : KeyEvent = no_mod ( KeyCode :: Char ( '.' ) ) ;
Original file line number Diff line number Diff line change @@ -253,6 +253,12 @@ pub mod commands {
253
253
"drop selected stash" ,
254
254
CMD_GROUP_STASHES ,
255
255
) ;
256
+ ///
257
+ pub static STASHLIST_INSPECT : CommandText = CommandText :: new (
258
+ "Inspect [\u{2192} ]" , //→
259
+ "open stash commit details (allows to diff files)" ,
260
+ CMD_GROUP_STASHES ,
261
+ ) ;
256
262
257
263
///
258
264
pub static LOG_DETAILS_TOGGLE : CommandText = CommandText :: new (
Original file line number Diff line number Diff line change @@ -73,6 +73,14 @@ impl StashList {
73
73
}
74
74
}
75
75
76
+ fn inspect ( & mut self ) {
77
+ if let Some ( e) = self . list . selected_entry ( ) {
78
+ self . queue
79
+ . borrow_mut ( )
80
+ . push_back ( InternalEvent :: InspectCommit ( e. id ) ) ;
81
+ }
82
+ }
83
+
76
84
///
77
85
pub fn drop ( id : CommitId ) -> bool {
78
86
sync:: stash_drop ( CWD , id) . is_ok ( )
@@ -112,6 +120,11 @@ impl Component for StashList {
112
120
selection_valid,
113
121
true ,
114
122
) ) ;
123
+ out. push ( CommandInfo :: new (
124
+ commands:: STASHLIST_INSPECT ,
125
+ selection_valid,
126
+ true ,
127
+ ) ) ;
115
128
}
116
129
117
130
visibility_blocking ( self )
@@ -127,6 +140,7 @@ impl Component for StashList {
127
140
match k {
128
141
keys:: STASH_APPLY => self . apply_stash ( ) ,
129
142
keys:: STASH_DROP => self . drop_stash ( ) ,
143
+ keys:: STASH_OPEN => self . inspect ( ) ,
130
144
131
145
_ => ( ) ,
132
146
} ;
You can’t perform that action at this time.
0 commit comments