From 21155716e2eedd5ba8ab97168e5eed7cd50d2ad8 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Tue, 7 Jun 2022 00:10:06 +0800 Subject: [PATCH] Fix typos (#675) --- CHANGELOG.md | 12 ++++++------ examples/README.md | 2 +- examples/event-poll-read.rs | 2 +- src/event.rs | 4 ++-- src/event/source/unix.rs | 2 +- src/event/sys/unix/parse.rs | 2 +- src/style/sys/windows.rs | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31402ea..9cd5849 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -400,7 +400,7 @@ As a preparation for crossterm 0.1.0 we have moved crossterm to an organisation ## Version 0.9.2 - Terminal size linux was not 0-based -- Windows mouse input event position was 0-based ans should be 1-based +- Windows mouse input event position was 0-based and should be 1-based - Result, ErrorKind are made re-exported - Fixed some special key combination detections for UNIX systems - Made FreeBSD compile @@ -511,7 +511,7 @@ This release is all about moving to a stabilized API for 1.0. - Bug fix resetting console color. - Bug fix whit undoing raw modes. - More correct error handling. -- Overall commend improvement. +- Overall command improvement. - Overall refactor of code. # Version 0.3.0 @@ -608,7 +608,7 @@ __Now the user has to pass an context type to the modules of Crossterm like this let terminal = terminal(&context); let color = color(&context); -Because this looks a little odd I will provide a type withs will manage the `Context` for you. You can call the different modules like the following: +Because this looks a little odd I will provide a type widths will manage the `Context` for you. You can call the different modules like the following: let crossterm = Crossterm::new(); let color = crossterm.color(); @@ -624,7 +624,7 @@ _Create alternate screen from `Context`_ // create context. let context = crossterm::Context::new(); - // create instance of Alternatescreen by the given context, this wil also switch to it. + // create instance of Alternatescreen by the given context, this will also switch to it. let mut screen = crossterm::AlternateScreen::from(context.clone()); // write to the alternate screen. write!(screen, "test"); @@ -633,7 +633,7 @@ _Create alternate screen from `Crossterm`:_ // create context. let crossterm = ::crossterm::Crossterm::new(); - // create instance of Alternatescreen by the given refrence to crossterm, this wil also switch to it. + // create instance of Alternatescreen by the given reference to crossterm, this will also switch to it. let mut screen = crossterm::AlternateScreen::from(&crossterm); // write to the alternate screen. write!(screen, "test"); @@ -657,7 +657,7 @@ If you don't use the same `Context` in `cursor(), color(), terminal()` than thes # Version 0.2 - 256 color support. -- Text Attributes like: bold, italic, underscore and crossed word ect. +- Text Attributes like: bold, italic, underscore and crossed word etc. - Custom ANSI color code input to set fore- and background color for unix. - Storing the current cursor position and resetting to that stored cursor position later. - Resizing the terminal. diff --git a/examples/README.md b/examples/README.md index 2b0fc88..c9884ec 100644 --- a/examples/README.md +++ b/examples/README.md @@ -14,7 +14,7 @@ The examples are compatible with the latest release. ``` | File Name | Description | Topics | |:----------------------------|:-------------------------------|:------------------------------------------| -| `examples/interactive-test` | interactive, walk trough, demo | cursor, style, event | +| `examples/interactive-test` | interactive, walk through, demo | cursor, style, event | | `event-*` | event reading demos | (async) event reading | | `stderr` | crossterm over stderr demo | raw mode, alternate screen, custom output | | `is_tty` | Is this instance a tty ? | tty | diff --git a/examples/event-poll-read.rs b/examples/event-poll-read.rs index 345a301..a901182 100644 --- a/examples/event-poll-read.rs +++ b/examples/event-poll-read.rs @@ -23,7 +23,7 @@ fn print_events() -> Result<()> { loop { // Wait up to 1s for another event if poll(Duration::from_millis(1_000))? { - // It's guaranteed that read() wont block if `poll` returns `Ok(true)` + // It's guaranteed that read() won't block if `poll` returns `Ok(true)` let event = read()?; println!("Event::{:?}\r", event); diff --git a/src/event.rs b/src/event.rs index 56ddf26..c7d372d 100644 --- a/src/event.rs +++ b/src/event.rs @@ -119,7 +119,7 @@ fn try_lock_internal_event_reader_for( /// Returns `Ok(true)` if an [`Event`](enum.Event.html) is available otherwise it returns `Ok(false)`. /// /// `Ok(true)` guarantees that subsequent call to the [`read`](fn.read.html) function -/// wont block. +/// won't block. /// /// # Arguments /// @@ -188,7 +188,7 @@ pub fn poll(timeout: Duration) -> Result { /// fn print_events() -> Result { /// loop { /// if poll(Duration::from_millis(100))? { -/// // It's guaranteed that `read` wont block, because `poll` returned +/// // It's guaranteed that `read` won't block, because `poll` returned /// // `Ok(true)`. /// println!("{:?}", read()?); /// } else { diff --git a/src/event/source/unix.rs b/src/event/source/unix.rs index ba28208..645e2cc 100644 --- a/src/event/source/unix.rs +++ b/src/event/source/unix.rs @@ -173,7 +173,7 @@ impl EventSource for UnixInternalEventSource { // // Following `Parser` structure exists for two reasons: // -// * mimick anes Parser interface +// * mimic anes Parser interface // * move the advancing, parsing, ... stuff out of the `try_read` method // #[derive(Debug)] diff --git a/src/event/sys/unix/parse.rs b/src/event/sys/unix/parse.rs index d957e09..ff64ce0 100644 --- a/src/event/sys/unix/parse.rs +++ b/src/event/sys/unix/parse.rs @@ -407,7 +407,7 @@ pub(crate) fn parse_csi_sgr_mouse(buffer: &[u8]) -> Result // When button 3 in Cb is used to represent mouse release, you can't tell which button was // released. SGR mode solves this by having the sequence end with a lowercase m if it's a - // button release and an uppercase M if it's a buton press. + // button release and an uppercase M if it's a button press. // // We've already checked that the last character is a lowercase or uppercase M at the start of // this function, so we just need one if. diff --git a/src/style/sys/windows.rs b/src/style/sys/windows.rs index 91cc2df..77a51a9 100644 --- a/src/style/sys/windows.rs +++ b/src/style/sys/windows.rs @@ -33,7 +33,7 @@ pub(crate) fn set_foreground_color(fg_color: Color) -> Result<()> { let mut color = color_value | bg_color; // background intensity is a separate value in attrs, - // wee need to check if this was applied to the current bg color. + // we need to check if this was applied to the current bg color. if (attrs & wincon::BACKGROUND_INTENSITY as u16) != 0 { color |= wincon::BACKGROUND_INTENSITY as u16; } @@ -51,7 +51,7 @@ pub(crate) fn set_background_color(bg_color: Color) -> Result<()> { let csbi = screen_buffer.info()?; // Notice that the color values are stored in wAttribute. - // So wee need to use bitwise operators to check if the values exists or to get current console colors. + // So we need to use bitwise operators to check if the values exists or to get current console colors. let attrs = csbi.attributes(); let fg_color = attrs & 0x0007; let mut color = fg_color | color_value;