From 0bb7c5f49b5f2c12aeee9281ee4871995e1fdb60 Mon Sep 17 00:00:00 2001 From: shockrah Date: Mon, 5 Apr 2021 14:24:21 -0700 Subject: [PATCH] adding / to start commands now --- tui/src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tui/src/main.rs b/tui/src/main.rs index 05710c4..4c5e4f1 100644 --- a/tui/src/main.rs +++ b/tui/src/main.rs @@ -3,6 +3,7 @@ mod command; mod config; mod api_types; mod cache; +mod net; #[macro_use] mod common; use crate::util::event::{Event, Events}; @@ -159,7 +160,7 @@ async fn main() -> Result<(), Box> { &lines.push(cmd.styled()); } - let mut list = if border_opt { + let list = if border_opt { Paragraph::new(lines) .wrap(Wrap { trim: false }) .block(Block::default() @@ -195,8 +196,9 @@ async fn main() -> Result<(), Box> { if let Event::Input(input) = events.next()? { match app.input_mode { InputMode::Normal => match input { - Key::Char('i') => { + Key::Char('i') | Key::Char('/') => { app.input_mode = InputMode::Editing; + app.input.push('/'); events.disable_exit_key(); } Key::Char('q') => { @@ -218,6 +220,7 @@ async fn main() -> Result<(), Box> { Command::Server(host) => app.cache.switch_server(&host).await, Command::Message(msg) => app.cache.send_message(&msg).await, Command::ListHost => app.cache.list_hosts(), + Command::ListChannel => app.cache.list_channels(), _ => cmd }); }