From 096489dee46f88a6c0496e7d36e2b14fc43bd2a1 Mon Sep 17 00:00:00 2001 From: Arijit Basu Date: Thu, 4 Mar 2021 20:50:33 +0530 Subject: [PATCH] Use "esc" instead of "escape" --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/app.rs | 6 ++++-- src/config.rs | 2 +- src/input.rs | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e17cd3b..173a02f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1133,7 +1133,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "xplr" -version = "0.1.9" +version = "0.1.10" dependencies = [ "criterion", "crossterm", diff --git a/Cargo.toml b/Cargo.toml index 1637e8a..4b943b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xplr" -version = "0.1.9" # Update app.rs +version = "0.1.10" # Update app.rs authors = ["Arijit Basu "] edition = "2018" description = "An experimental, minimal, configurable TUI file explorer, stealing ideas from nnn and fzf." diff --git a/src/app.rs b/src/app.rs index 27344c7..7d477cd 100644 --- a/src/app.rs +++ b/src/app.rs @@ -12,7 +12,7 @@ use std::io::BufReader; use std::path::Path; use std::path::PathBuf; -pub const VERSION: &str = "v0.1.8"; // Update Cargo.toml +pub const VERSION: &str = "v0.1.10"; // Update Cargo.toml pub const UNSUPPORTED_STR: &str = "???"; pub const TOTAL_ROWS: usize = 50; @@ -341,10 +341,12 @@ impl App { pub fn exit_submode(self) -> Result { let mode = match self.mode { + Mode::Explore => Mode::Explore, Mode::ExploreSubmode(_) => Mode::Explore, + Mode::Select => Mode::Select, Mode::SelectSubmode(_) => Mode::Select, - m => m, }; + Self::new( &self.config, &self.directory_buffer.pwd, diff --git a/src/config.rs b/src/config.rs index e29d03c..35a738d 100644 --- a/src/config.rs +++ b/src/config.rs @@ -268,7 +268,7 @@ impl Default for KeyBindings { - Call: command: bash - escape: + esc: help: quit actions: - Quit diff --git a/src/input.rs b/src/input.rs index f55e252..8983d61 100644 --- a/src/input.rs +++ b/src/input.rs @@ -19,7 +19,7 @@ pub enum Key { Return, Space, Tab, - Escape, + Esc, Zero, One, @@ -270,7 +270,7 @@ impl Key { TermionKey::Char('\n') => Key::Return, TermionKey::Char(' ') => Key::Space, TermionKey::Char('\t') => Key::Tab, - TermionKey::Esc => Key::Escape, + TermionKey::Esc => Key::Esc, TermionKey::Char('0') => Key::Zero, TermionKey::Char('1') => Key::One,