diff --git a/Cargo.lock b/Cargo.lock index 2f69688..1fe3d3d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -60,6 +60,9 @@ name = "bitflags" version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +dependencies = [ + "serde", +] [[package]] name = "block" @@ -194,11 +197,11 @@ dependencies = [ [[package]] name = "crossterm" -version = "0.26.1" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84cda67535339806297f1b331d6dd6320470d2a0fe65381e79ee9e156dd3d13" +checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.3.3", "crossterm_winapi", "libc", "mio", diff --git a/Cargo.toml b/Cargo.toml index 8ab2fb1..ba4741c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ doctest = true chrono = { version = "0.4.19", default-features = false, features = ["clock"] } clipboard = { version = "0.5.0", optional = true } crossbeam = { version = "0.8.2", optional = true } -crossterm = { version = "0.26.1", features = ["serde"] } +crossterm = { version = "0.27.0", features = ["serde"] } fd-lock = "3.0.3" itertools = "0.10.3" nu-ansi-term = "0.49.0" diff --git a/examples/demo.rs b/examples/demo.rs index 3a856aa..af98c0b 100644 --- a/examples/demo.rs +++ b/examples/demo.rs @@ -2,7 +2,7 @@ use { crossterm::{ cursor::SetCursorStyle, event::{DisableBracketedPaste, KeyCode, KeyModifiers}, - execute, Result, + execute, }, nu_ansi_term::{Color, Style}, reedline::{ @@ -18,7 +18,7 @@ use reedline::CursorConfig; #[cfg(not(any(feature = "sqlite", feature = "sqlite-dynlib")))] use reedline::FileBackedHistory; -fn main() -> Result<()> { +fn main() -> std::io::Result<()> { println!("Ctrl-D to quit"); // quick command like parameter handling let vi_mode = matches!(std::env::args().nth(1), Some(x) if x == "--vi"); diff --git a/examples/event_listener.rs b/examples/event_listener.rs index 30c1ae1..6c7e9cc 100644 --- a/examples/event_listener.rs +++ b/examples/event_listener.rs @@ -1,7 +1,7 @@ use { crossterm::{ event::{poll, Event, KeyCode, KeyEvent}, - terminal, Result, + terminal, }, std::{ io::{stdout, Write}, @@ -9,7 +9,7 @@ use { }, }; -fn main() -> Result<()> { +fn main() -> std::io::Result<()> { println!("Ready to print events (Abort with ESC):"); print_events()?; println!(); @@ -17,7 +17,7 @@ fn main() -> Result<()> { } /// **For debugging purposes only:** Track the terminal events observed by [`Reedline`] and print them. -pub fn print_events() -> Result<()> { +pub fn print_events() -> std::io::Result<()> { stdout().flush()?; terminal::enable_raw_mode()?; let result = print_events_helper(); @@ -31,7 +31,7 @@ pub fn print_events() -> Result<()> { // even seeing the events. if you press a key and no events // are printed, it's a good chance your terminal is eating // those events. -fn print_events_helper() -> Result<()> { +fn print_events_helper() -> std::io::Result<()> { loop { // Wait up to 5s for another event if poll(Duration::from_millis(5_000))? { diff --git a/examples/event_listener_kitty_proto.rs b/examples/event_listener_kitty_proto.rs index 8c0e35e..cbace1a 100644 --- a/examples/event_listener_kitty_proto.rs +++ b/examples/event_listener_kitty_proto.rs @@ -5,10 +5,10 @@ use crossterm::execute; use { crossterm::{ event::{poll, Event, KeyCode, KeyEvent}, - terminal, Result, + terminal, }, std::{ - io::{stdout, Write}, + io::{stdout, Result, Write}, time::Duration, }, }; diff --git a/examples/list_bindings.rs b/examples/list_bindings.rs index 7236d5c..35e6c0e 100644 --- a/examples/list_bindings.rs +++ b/examples/list_bindings.rs @@ -1,16 +1,12 @@ -use { - crossterm::Result, - reedline::{ - get_reedline_default_keybindings, get_reedline_edit_commands, - get_reedline_keybinding_modifiers, get_reedline_keycodes, get_reedline_prompt_edit_modes, - get_reedline_reedline_events, - }, +use reedline::{ + get_reedline_default_keybindings, get_reedline_edit_commands, + get_reedline_keybinding_modifiers, get_reedline_keycodes, get_reedline_prompt_edit_modes, + get_reedline_reedline_events, }; -fn main() -> Result<()> { +fn main() { get_all_keybinding_info(); println!(); - Ok(()) } /// List all keybinding information diff --git a/src/engine.rs b/src/engine.rs index 7ba541a..836bfcb 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -36,9 +36,11 @@ use { cursor::{SetCursorStyle, Show}, event, event::{Event, KeyCode, KeyEvent, KeyModifiers}, - terminal, QueueableCommand, Result, + terminal, QueueableCommand, + }, + std::{ + fs::File, io, io::Result, io::Write, process::Command, time::Duration, time::SystemTime, }, - std::{fs::File, io, io::Write, process::Command, time::Duration, time::SystemTime}, }; // The POLL_WAIT is used to specify for how long the POLL should wait for diff --git a/src/painting/painter.rs b/src/painting/painter.rs index 8bb6171..e6dc79a 100644 --- a/src/painting/painter.rs +++ b/src/painting/painter.rs @@ -11,9 +11,9 @@ use { cursor::{self, MoveTo, RestorePosition, SavePosition}, style::{Attribute, Print, ResetColor, SetAttribute, SetForegroundColor}, terminal::{self, Clear, ClearType}, - QueueableCommand, Result, + QueueableCommand, }, - std::io::Write, + std::io::{Result, Write}, }; #[cfg(feature = "external_printer")] use {crate::LineBuffer, crossterm::cursor::MoveUp};