Skip to content

Commit

Permalink
Update and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sayanarijit committed May 23, 2023
1 parent ff89441 commit 8680ca4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tui-input"
version = "0.7.0"
version = "0.7.1"
edition = "2021"
authors = ["Arijit Basu <[email protected]>"]
description = "TUI input library supporting multiple backends"
Expand All @@ -17,7 +17,7 @@ default = ["crossterm"]

[dependencies]
crossterm = { version = "0.26.1", optional = true }
serde = { version = "1.0.158", optional = true, features = ["derive"] }
serde = { version = "1.0.163", optional = true, features = ["derive"] }
termion = { version = "2.0.1", optional = true }
unicode-width = "0.1.10"

Expand Down
7 changes: 3 additions & 4 deletions examples/crossterm_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ fn main() -> Result<()> {
loop {
let event = read()?;

match event {
Event::Key(KeyEvent { code, .. }) => match code {
if let Event::Key(KeyEvent { code, .. }) = event {
match code {
KeyCode::Esc | KeyCode::Enter => {
break;
}
Expand All @@ -42,8 +42,7 @@ fn main() -> Result<()> {
stdout.flush()?;
}
}
},
_ => {}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/ratatui-input/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fn main() -> Result<(), Box<dyn Error>> {

fn run_app<B: Backend>(terminal: &mut Terminal<B>, mut app: App) -> io::Result<()> {
loop {
terminal.draw(|f| ui(f, &mut app))?;
terminal.draw(|f| ui(f, &app))?;

if let Event::Key(key) = event::read()? {
match app.input_mode {
Expand Down
4 changes: 3 additions & 1 deletion src/backend/crossterm.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use crate::{Input, InputRequest, StateChanged};
use crossterm::event::{Event as CrosstermEvent, KeyCode, KeyEvent, KeyEventKind, KeyModifiers};
use crossterm::event::{
Event as CrosstermEvent, KeyCode, KeyEvent, KeyEventKind, KeyModifiers,
};
use crossterm::{
cursor::MoveTo,
queue,
Expand Down

0 comments on commit 8680ca4

Please sign in to comment.