|
|
|
@ -13,21 +13,22 @@
|
|
|
|
|
#[allow(dead_code)]
|
|
|
|
|
mod util;
|
|
|
|
|
|
|
|
|
|
use std::io::{self, Write};
|
|
|
|
|
|
|
|
|
|
use termion::cursor::Goto;
|
|
|
|
|
use termion::event::Key;
|
|
|
|
|
use termion::input::MouseTerminal;
|
|
|
|
|
use termion::raw::IntoRawMode;
|
|
|
|
|
use termion::screen::AlternateScreen;
|
|
|
|
|
use tui::backend::TermionBackend;
|
|
|
|
|
use tui::layout::{Constraint, Direction, Layout};
|
|
|
|
|
use tui::style::{Color, Style};
|
|
|
|
|
use tui::widgets::{Block, Borders, List, Paragraph, Text};
|
|
|
|
|
use tui::Terminal;
|
|
|
|
|
use unicode_width::UnicodeWidthStr;
|
|
|
|
|
|
|
|
|
|
use crate::util::event::{Event, Events};
|
|
|
|
|
use std::{
|
|
|
|
|
error::Error,
|
|
|
|
|
io::{self, Write},
|
|
|
|
|
};
|
|
|
|
|
use termion::{
|
|
|
|
|
cursor::Goto, event::Key, input::MouseTerminal, raw::IntoRawMode, screen::AlternateScreen,
|
|
|
|
|
};
|
|
|
|
|
use tui::{
|
|
|
|
|
backend::TermionBackend,
|
|
|
|
|
layout::{Constraint, Direction, Layout},
|
|
|
|
|
style::{Color, Style},
|
|
|
|
|
widgets::{Block, Borders, List, Paragraph, Text},
|
|
|
|
|
Terminal,
|
|
|
|
|
};
|
|
|
|
|
use unicode_width::UnicodeWidthStr;
|
|
|
|
|
|
|
|
|
|
enum InputMode {
|
|
|
|
|
Normal,
|
|
|
|
@ -54,7 +55,7 @@ impl Default for App {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() -> Result<(), failure::Error> {
|
|
|
|
|
fn main() -> Result<(), Box<dyn Error>> {
|
|
|
|
|
// Terminal initialization
|
|
|
|
|
let stdout = io::stdout().into_raw_mode()?;
|
|
|
|
|
let stdout = MouseTerminal::from(stdout);
|
|
|
|
|