adding / to start commands now
This commit is contained in:
parent
3c10d342eb
commit
0bb7c5f49b
@ -3,6 +3,7 @@ mod command;
|
|||||||
mod config;
|
mod config;
|
||||||
mod api_types;
|
mod api_types;
|
||||||
mod cache;
|
mod cache;
|
||||||
|
mod net;
|
||||||
#[macro_use] mod common;
|
#[macro_use] mod common;
|
||||||
|
|
||||||
use crate::util::event::{Event, Events};
|
use crate::util::event::{Event, Events};
|
||||||
@ -159,7 +160,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
&lines.push(cmd.styled());
|
&lines.push(cmd.styled());
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut list = if border_opt {
|
let list = if border_opt {
|
||||||
Paragraph::new(lines)
|
Paragraph::new(lines)
|
||||||
.wrap(Wrap { trim: false })
|
.wrap(Wrap { trim: false })
|
||||||
.block(Block::default()
|
.block(Block::default()
|
||||||
@ -195,8 +196,9 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
if let Event::Input(input) = events.next()? {
|
if let Event::Input(input) = events.next()? {
|
||||||
match app.input_mode {
|
match app.input_mode {
|
||||||
InputMode::Normal => match input {
|
InputMode::Normal => match input {
|
||||||
Key::Char('i') => {
|
Key::Char('i') | Key::Char('/') => {
|
||||||
app.input_mode = InputMode::Editing;
|
app.input_mode = InputMode::Editing;
|
||||||
|
app.input.push('/');
|
||||||
events.disable_exit_key();
|
events.disable_exit_key();
|
||||||
}
|
}
|
||||||
Key::Char('q') => {
|
Key::Char('q') => {
|
||||||
@ -218,6 +220,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
Command::Server(host) => app.cache.switch_server(&host).await,
|
Command::Server(host) => app.cache.switch_server(&host).await,
|
||||||
Command::Message(msg) => app.cache.send_message(&msg).await,
|
Command::Message(msg) => app.cache.send_message(&msg).await,
|
||||||
Command::ListHost => app.cache.list_hosts(),
|
Command::ListHost => app.cache.list_hosts(),
|
||||||
|
Command::ListChannel => app.cache.list_channels(),
|
||||||
_ => cmd
|
_ => cmd
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user