Skip to content

Commit

Permalink
feat: migrate from crossterm to ratatui::crossterm
Browse files Browse the repository at this point in the history
  • Loading branch information
p0kR authored and sayanarijit committed Aug 8, 2024
1 parent 114a5d6 commit 9006fbc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ autoexamples = true

[features]
default = ["crossterm"]
crossterm = ["dep:ratatui"]

[dependencies]
crossterm = { version = "0.27.0", optional = true }
ratatui = { version = "0.28", optional = true }
serde = { version = "1.0.203", optional = true, features = ["derive"] }
termion = { version = "4.0.2", optional = true }
unicode-width = "0.1.13"
Expand Down
2 changes: 1 addition & 1 deletion examples/crossterm_input.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crossterm::{
use ratatui::crossterm::{
cursor::{Hide, Show},
event::{read, DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEvent},
execute,
Expand Down
3 changes: 1 addition & 2 deletions examples/ratatui-input/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ publish = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
crossterm = "0.27"
ratatui = "0.27"
ratatui = "0.28"
tui-input = { path = "../../" }
unicode-width = "0.1.13"
6 changes: 3 additions & 3 deletions src/backend/crossterm.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::{Input, InputRequest, StateChanged};
use crossterm::event::{
use ratatui::crossterm::event::{
Event as CrosstermEvent, KeyCode, KeyEvent, KeyEventKind, KeyModifiers,
};
use crossterm::{
use ratatui::crossterm::{
cursor::MoveTo,
queue,
style::{Attribute as CAttribute, Print, SetAttribute},
Expand Down Expand Up @@ -117,7 +117,7 @@ impl EventHandler for Input {

#[cfg(test)]
mod tests {
use crossterm::event::{KeyEventKind, KeyEventState};
use ratatui::crossterm::event::{KeyEventKind, KeyEventState};

use super::*;

Expand Down

0 comments on commit 9006fbc

Please sign in to comment.