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 {
160160 /// Cancel hexdump and move to the previous tab.
161161 CancelPrevious ,
162162 /// Exit application.
163- Exit ,
163+ Exit ( Event ) ,
164164}
165165
166166impl HexdumpCommand {
167167 /// Parses the event.
168168 pub fn parse ( key_event : KeyEvent , is_read_only : bool ) -> Self {
169169 match key_event. code {
170- KeyCode :: Char ( 'q' ) => Self :: Exit ,
170+ KeyCode :: Char ( 'q' ) => Self :: Exit ( Event :: Key ( key_event ) ) ,
171171 KeyCode :: Tab => Self :: CancelNext ,
172172 KeyCode :: BackTab => Self :: CancelPrevious ,
173173 KeyCode :: Char ( 's' ) => {
Original file line number Diff line number Diff line change @@ -176,8 +176,21 @@ impl<'a> State<'a> {
176176 . into ( ) ;
177177 self . handle_tab ( ) ?;
178178 }
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+ }
181194 }
182195 } ,
183196 Command :: ShowDetails => {
You can’t perform that action at this time.
0 commit comments