mirror of https://github.com/bobwen-dev/hunter
move quit function from Widget to FileBrowser
This commit is contained in:
parent
392e6c0128
commit
9729a2482e
|
@ -1032,6 +1032,7 @@ impl Widget for FileBrowser {
|
|||
fn on_key(&mut self, key: Key) -> HResult<()> {
|
||||
match key {
|
||||
Key::Char('/') => { self.turbo_cd()?; },
|
||||
Key::Char('q') => HError::quit()?,
|
||||
Key::Char('Q') => { self.quit_with_dir()?; },
|
||||
Key::Right | Key::Char('l') => { self.enter_dir()?; },
|
||||
Key::Char('L') => { self.open_bg()?; },
|
||||
|
|
|
@ -150,7 +150,6 @@ pub trait Widget {
|
|||
fn on_event(&mut self, event: Event) -> HResult<()> {
|
||||
self.clear_status().log();
|
||||
match event {
|
||||
Event::Key(Key::Char('q')) => HError::quit(),
|
||||
Event::Key(key) => self.on_key(key),
|
||||
Event::Mouse(button) => self.on_mouse(button),
|
||||
Event::Unsupported(wtf) => self.on_wtf(wtf),
|
||||
|
|
Loading…
Reference in New Issue