summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-07-25 16:26:48 +0200
committermo8it <mo8it@proton.me>2024-07-25 16:26:48 +0200
commit1937b4bf664568afcdb2c73247b593299d3fca6d (patch)
tree4af8ef68950c1d02238e962ac96f6d97dc947b83 /src
parent8beb2908420b0225aabe983e3425055db761b356 (diff)
Use the rexported crossterm from ratatui
Diffstat (limited to 'src')
-rw-r--r--src/app_state.rs2
-rw-r--r--src/exercise.rs2
-rw-r--r--src/init.rs2
-rw-r--r--src/list.rs13
-rw-r--r--src/progress_bar.rs2
-rw-r--r--src/run.rs2
-rw-r--r--src/watch/state.rs2
-rw-r--r--src/watch/terminal_event.rs2
8 files changed, 15 insertions, 12 deletions
diff --git a/src/app_state.rs b/src/app_state.rs
index e08f94c..8995e81 100644
--- a/src/app_state.rs
+++ b/src/app_state.rs
@@ -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},
diff --git a/src/exercise.rs b/src/exercise.rs
index b6adc14..960eec0 100644
--- a/src/exercise.rs
+++ b/src/exercise.rs
@@ -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,
diff --git a/src/init.rs b/src/init.rs
index 4063ca7..bfa0ab8 100644
--- a/src/init.rs
+++ b/src/init.rs
@@ -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},
diff --git a/src/list.rs b/src/list.rs
index 790c02f..15836a4 100644
--- a/src/list.rs
+++ b/src/list.rs
@@ -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;
diff --git a/src/progress_bar.rs b/src/progress_bar.rs
index 4a54170..7f07ad5 100644
--- a/src/progress_bar.rs
+++ b/src/progress_bar.rs
@@ -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);
diff --git a/src/run.rs b/src/run.rs
index 899d0a9..3965a0d 100644
--- a/src/run.rs
+++ b/src/run.rs
@@ -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::{
diff --git a/src/watch/state.rs b/src/watch/state.rs
index 78af30a..26ff411 100644
--- a/src/watch/state.rs
+++ b/src/watch/state.rs
@@ -1,5 +1,5 @@
use anyhow::Result;
-use crossterm::{
+use ratatui::crossterm::{
style::{style, Stylize},
terminal,
};
diff --git a/src/watch/terminal_event.rs b/src/watch/terminal_event.rs
index f54af17..3a1762d 100644
--- a/src/watch/terminal_event.rs
+++ b/src/watch/terminal_event.rs
@@ -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;