Use the rexported crossterm from ratatui

This commit is contained in:
mo8it
2024-07-25 16:26:48 +02:00
parent 8beb290842
commit 1937b4bf66
10 changed files with 38 additions and 37 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
use anyhow::{bail, Context, Result};
use crossterm::style::Stylize;
use ratatui::crossterm::style::Stylize;
use serde::Deserialize;
use std::{
fs::{self, File},
+1 -1
View File
@@ -1,5 +1,5 @@
use anyhow::Result;
use crossterm::style::{style, StyledContent, Stylize};
use ratatui::crossterm::style::{style, StyledContent, Stylize};
use std::{
fmt::{self, Display, Formatter},
io::Write,
+1 -1
View File
@@ -1,5 +1,5 @@
use anyhow::{bail, Context, Result};
use crossterm::style::Stylize;
use ratatui::crossterm::style::Stylize;
use std::{
env::set_current_dir,
fs::{self, create_dir},
+8 -5
View File
@@ -1,10 +1,13 @@
use anyhow::Result;
use crossterm::{
event::{self, Event, KeyCode, KeyEventKind},
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
ExecutableCommand,
use ratatui::{
backend::CrosstermBackend,
crossterm::{
event::{self, Event, KeyCode, KeyEventKind},
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
ExecutableCommand,
},
Terminal,
};
use ratatui::{backend::CrosstermBackend, Terminal};
use std::io;
use crate::app_state::AppState;
+1 -1
View File
@@ -14,7 +14,7 @@ const PROGRESS_EXCEEDS_MAX_ERR: &str =
/// Terminal progress bar to be used when not using Ratataui.
pub fn progress_bar(progress: u16, total: u16, line_width: u16) -> Result<String> {
use crossterm::style::Stylize;
use ratatui::crossterm::style::Stylize;
if progress > total {
bail!(PROGRESS_EXCEEDS_MAX_ERR);
+1 -1
View File
@@ -1,5 +1,5 @@
use anyhow::{bail, Result};
use crossterm::style::{style, Stylize};
use ratatui::crossterm::style::{style, Stylize};
use std::io::{self, Write};
use crate::{
+1 -1
View File
@@ -1,5 +1,5 @@
use anyhow::Result;
use crossterm::{
use ratatui::crossterm::{
style::{style, Stylize},
terminal,
};
+1 -1
View File
@@ -1,4 +1,4 @@
use crossterm::event::{self, Event, KeyCode, KeyEventKind, KeyModifiers};
use ratatui::crossterm::event::{self, Event, KeyCode, KeyEventKind, KeyModifiers};
use std::sync::mpsc::Sender;
use super::WatchEvent;