File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -160,14 +160,14 @@ pub enum HexdumpCommand {
160
160
/// Cancel hexdump and move to the previous tab.
161
161
CancelPrevious ,
162
162
/// Exit application.
163
- Exit ,
163
+ Exit ( Event ) ,
164
164
}
165
165
166
166
impl HexdumpCommand {
167
167
/// Parses the event.
168
168
pub fn parse ( key_event : KeyEvent , is_read_only : bool ) -> Self {
169
169
match key_event. code {
170
- KeyCode :: Char ( 'q' ) => Self :: Exit ,
170
+ KeyCode :: Char ( 'q' ) => Self :: Exit ( Event :: Key ( key_event ) ) ,
171
171
KeyCode :: Tab => Self :: CancelNext ,
172
172
KeyCode :: BackTab => Self :: CancelPrevious ,
173
173
KeyCode :: Char ( 's' ) => {
Original file line number Diff line number Diff line change @@ -176,8 +176,21 @@ impl<'a> State<'a> {
176
176
. into ( ) ;
177
177
self . handle_tab ( ) ?;
178
178
}
179
- HexdumpCommand :: Exit => {
180
- self . running = false ;
179
+ HexdumpCommand :: Exit ( event) => {
180
+ if self . analyzer . heh . key_handler . is_focusing ( Window :: Search )
181
+ || self
182
+ . analyzer
183
+ . heh
184
+ . key_handler
185
+ . is_focusing ( Window :: JumpToByte )
186
+ {
187
+ self . analyzer
188
+ . heh
189
+ . handle_input ( & event)
190
+ . map_err ( |e| Error :: HexdumpError ( e. to_string ( ) ) ) ?;
191
+ } else {
192
+ self . running = false ;
193
+ }
181
194
}
182
195
} ,
183
196
Command :: ShowDetails => {
You can’t perform that action at this time.
0 commit comments