mirror of
https://github.com/nushell/reedline.git
synced 2024-10-27 01:45:51 +03:00
Bump crossterm
to 0.27.0 (#625)
* Bump `crossterm` to 0.27.0 Waiting for nushell as ratatui (used in nu-explore) is still on 0.26 * Cargo fmt * Fix examples
This commit is contained in:
parent
6143b01b7b
commit
31257a4c54
9
Cargo.lock
generated
9
Cargo.lock
generated
@ -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",
|
||||
|
@ -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"
|
||||
|
@ -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");
|
||||
|
@ -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))? {
|
||||
|
@ -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,
|
||||
},
|
||||
};
|
||||
|
@ -1,16 +1,12 @@
|
||||
use {
|
||||
crossterm::Result,
|
||||
reedline::{
|
||||
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
|
||||
|
@ -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
|
||||
|
@ -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};
|
||||
|
Loading…
Reference in New Issue
Block a user