Skip to content

Commit

Permalink
wip: tui test adjustement
Browse files Browse the repository at this point in the history
  • Loading branch information
gwen-lg committed Oct 23, 2024
1 parent 827e23a commit cba9940
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub enum Error {
/// Will forward error from `ocr` processing and [`check_subtitles`] if any.
#[profiling::function]
pub fn run(opt: &Opt, terminal: Terminal<impl Backend>) -> Result<(), Error> {
let mut picker = Picker::new((2, 3)); // (16, 24) Picker::from_termios().map_err(|source| Error::Picker(source.to_string()))?;
let mut picker = Picker::from_termios().unwrap_or_else(|_| Picker::new((2, 3))); // (16, 24) .map_err(|source| Error::Picker(source.to_string()))?;
picker.guess_protocol();

rayon::ThreadPoolBuilder::new()
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use anyhow::Context;
use clap::Parser;
use crossterm::{
execute,
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
terminal::{EnterAlternateScreen, LeaveAlternateScreen},
};
use log::LevelFilter;
use ratatui::{
Expand Down Expand Up @@ -58,12 +58,12 @@ fn init_panic_hook() {
}));
}
fn init_tui() -> io::Result<Terminal<impl Backend>> {
enable_raw_mode()?;
//enable_raw_mode()?;
execute!(stdout(), EnterAlternateScreen)?;
Terminal::new(CrosstermBackend::new(stdout()))
}
fn restore_tui() -> io::Result<()> {
disable_raw_mode()?;
//disable_raw_mode()?;
execute!(stdout(), LeaveAlternateScreen)?;
Ok(())
}
Expand Down

0 comments on commit cba9940

Please sign in to comment.