Fix typos (#630)

This commit is contained in:
zohnannor 2022-02-17 14:49:41 +02:00 committed by GitHub
parent 9a50fd2ce2
commit 9bc5cd3527
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 11 deletions

View File

@ -31,7 +31,7 @@ fn enable_vt_processing() -> Result<()> {
static SUPPORTS_ANSI_ESCAPE_CODES: AtomicBool = AtomicBool::new(false);
static INITIALIZER: Once = Once::new();
/// Checks if the current terminal supports ansi escape sequences
/// Checks if the current terminal supports ANSI escape sequences
pub fn supports_ansi() -> bool {
INITIALIZER.call_once(|| {
// Some terminals on Windows like GitBash can't use WinAPI calls directly

View File

@ -8,13 +8,13 @@ use super::error::Result;
/// Crossterm provides a set of commands,
/// and there is no immediate reason to implement a command yourself.
/// In order to understand how to use and execute commands,
/// it is recommended that you take a look at [Command Api](../#command-api) chapter.
/// it is recommended that you take a look at [Command API](../#command-api) chapter.
pub trait Command {
/// Write an ANSI representation of this command to the given writer.
/// An ANSI code can manipulate the terminal by writing it to the terminal buffer.
/// However, only Windows 10 and UNIX systems support this.
///
/// This method does not need to be accessed manually, as it is used by the crossterm's [Command Api](../#command-api)
/// This method does not need to be accessed manually, as it is used by the crossterm's [Command API](../#command-api)
fn write_ansi(&self, f: &mut impl fmt::Write) -> fmt::Result;
/// Execute this command.
@ -22,11 +22,11 @@ pub trait Command {
/// Windows versions lower than windows 10 do not support ANSI escape codes,
/// therefore a direct WinAPI call is made.
///
/// This method does not need to be accessed manually, as it is used by the crossterm's [Command Api](../#command-api)
/// This method does not need to be accessed manually, as it is used by the crossterm's [Command API](../#command-api)
#[cfg(windows)]
fn execute_winapi(&self) -> Result<()>;
/// Returns whether the ansi code representation of this command is supported by windows.
/// Returns whether the ANSI code representation of this command is supported by windows.
///
/// A list of supported ANSI escape codes
/// can be found [here](https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences).

View File

@ -472,7 +472,7 @@ pub enum KeyCode {
End,
/// Page up key.
PageUp,
/// Page dow key.
/// Page down key.
PageDown,
/// Tab key.
Tab,

View File

@ -250,7 +250,7 @@ pub mod terminal;
pub mod tty;
#[cfg(windows)]
/// A module that exposes one function to check if the current terminal supports ansi sequences.
/// A module that exposes one function to check if the current terminal supports ANSI sequences.
pub mod ansi_support;
mod command;
mod error;

View File

@ -61,7 +61,7 @@
//!
//! ### Attributes
//!
//! How to appy terminal attributes to text.
//! How to apply terminal attributes to text.
//!
//! Command API:
//!
@ -427,7 +427,7 @@ impl_display!(for PrintStyledContent<&'static str>);
impl_display!(for ResetColor);
/// Utility function for ANSI parsing in Color and Colored.
/// Gets the next element of `iter` and tries to parse it as a u8.
/// Gets the next element of `iter` and tries to parse it as a `u8`.
fn parse_next_u8<'a>(iter: &mut impl Iterator<Item = &'a str>) -> Option<u8> {
iter.next().and_then(|s| s.parse().ok())
}

View File

@ -55,7 +55,7 @@
//! - Input will not be forwarded to screen
//! - Input will not be processed on enter press
//! - Input will not be line buffered (input sent byte-by-byte to input buffer)
//! - Special keys like backspace and CTL+C will not be processed by terminal driver
//! - Special keys like backspace and CTRL+C will not be processed by terminal driver
//! - New line character will not be processed therefore `println!` can't be used, use `write!` instead
//!
//! Raw mode can be enabled/disabled with the [enable_raw_mode](terminal::enable_raw_mode) and [disable_raw_mode](terminal::disable_raw_mode) functions.

View File

@ -24,7 +24,7 @@ pub trait IsTty {
fn is_tty(&self) -> bool;
}
/// On unix, the `isatty()` function returns true if a file
/// On UNIX, the `isatty()` function returns true if a file
/// descriptor is a terminal.
#[cfg(unix)]
impl<S: AsRawFd> IsTty for S {