summaryrefslogtreecommitdiffstats
path: root/src/main.rs
blob: c9a0381b55161f2f284df9fbf973a40675a3737e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// Main function
/// Init the status and display and listen to events (keyboard, mouse, resize, custom...).
/// The application is redrawn after every event.
/// When the user issues a quit event, the main loop is broken
/// Then we reset the cursor, drop everything holding a terminal and print the last path.
fn main() -> anyhow::Result<()> {
    let mut fm = fm::app::FM::start()?;

    while let Ok(event) = fm.poll_event() {
        fm.update(event)?;
        fm.display()?;
        if fm.must_quit() {
            break;
        }
    }

    fm.quit()
}