diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-05-01 12:55:50 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-05-01 12:58:36 -0400 |
commit | 6b013bb91969d7e269aa5a08da729a8370a31900 (patch) | |
tree | 3a1173b052e5abb7826509c380668d3e2e9c4be5 /src/run.rs | |
parent | ef98d3d408f9a741433523ccf557b26aa7380dbc (diff) |
add ConfigStructure trait
- make JoshutoKeymap just an alias for HashMap<i32, CommandKeybind>
- change keymap.toml to use ascii values rather than strings that
needs reparsing
Diffstat (limited to 'src/run.rs')
-rw-r--r-- | src/run.rs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -3,7 +3,7 @@ use std::process; use std::time; use crate::commands::{CommandKeybind, FileOperationThread, JoshutoCommand}; -use crate::config; +use crate::config::{self, JoshutoConfig, JoshutoKeymap}; use crate::context::JoshutoContext; use crate::error::JoshutoError; use crate::tab::JoshutoTab; @@ -157,7 +157,7 @@ fn init_context(context: &mut JoshutoContext, view: &JoshutoView) { } } -pub fn run(config_t: config::JoshutoConfig, keymap_t: config::JoshutoKeymap) { +pub fn run(config_t: JoshutoConfig, keymap_t: JoshutoKeymap) { ui::init_ncurses(); let mut context = JoshutoContext::new(config_t); @@ -190,7 +190,7 @@ pub fn run(config_t: config::JoshutoConfig, keymap_t: config::JoshutoKeymap) { let keycommand: &Box<JoshutoCommand>; - match keymap_t.keymaps.get(&ch) { + match keymap_t.get(&ch) { Some(CommandKeybind::CompositeKeybind(m)) => match recurse_get_keycommand(&m) { Some(s) => keycommand = s, None => continue, |