diff options
| author | iximeow <me@iximeow.net> | 2017-10-15 03:30:52 -0700 | 
|---|---|---|
| committer | iximeow <me@iximeow.net> | 2017-10-15 03:30:52 -0700 | 
| commit | 582351d837cb25680a3d7ae7345cf82479a3adf8 (patch) | |
| tree | a8faf20d15537c42d2f941da20e0f06307842360 | |
| parent | c6db91eddda42687a24859373869bef5df997cc0 (diff) | |
fix bug in address dialog not going away immediately
| -rw-r--r-- | main.rs | 34 | 
1 files changed, 17 insertions, 17 deletions
@@ -531,27 +531,27 @@ fn interface_loop(state: &mut Program) {                              state.input_buf = Vec::with_capacity(0);                              state.state = Mode::Edit;                              state.status = " ".to_string(); -                            continue; -                        } -                        let addr_str = u64::from_str_radix(&buf_str, 16); -                        match addr_str { -                            Ok(addr) => { -                                if addr < state.view.size() { -                                    state.seek_to(addr); -                                    state.input_buf = Vec::with_capacity(0); -                                    state.state = Mode::Edit; -                                    state.status = " ".to_string(); -                                } else { -                                    state.status = format!("Address out of bounds: 0x{:x}", addr); +                        } else { +                            let addr_str = u64::from_str_radix(&buf_str, 16); +                            match addr_str { +                                Ok(addr) => { +                                    if addr < state.view.size() { +                                        state.seek_to(addr); +                                        state.input_buf = Vec::with_capacity(0); +                                        state.state = Mode::Edit; +                                        state.status = " ".to_string(); +                                    } else { +                                        state.status = format!("Address out of bounds: 0x{:x}", addr); +                                        state.input_buf = Vec::with_capacity(0); +                                        state.state = Mode::Edit; +                                    } +                                } +                                Err(s) => { +                                    state.status = format!("Unable to parse address '{}', error: {}", buf_str, s);                                      state.input_buf = Vec::with_capacity(0);                                      state.state = Mode::Edit;                                  }                              } -                            Err(s) => { -                                state.status = format!("Unable to parse address '{}', error: {}", buf_str, s); -                                state.input_buf = Vec::with_capacity(0); -                                state.state = Mode::Edit; -                            }                          }                      }                      Event::Key(Key::Esc) => {  | 
