Skip to content

Commit

Permalink
Fix typos (#630)
Browse files Browse the repository at this point in the history
  • Loading branch information
zohnannor committed Feb 17, 2022
1 parent 9a50fd2 commit 9bc5cd3
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/ansi_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ 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.
///
/// 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).
Expand Down
2 changes: 1 addition & 1 deletion src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ pub enum KeyCode {
End,
/// Page up key.
PageUp,
/// Page dow key.
/// Page down key.
PageDown,
/// Tab key.
Tab,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
//!
//! ### Attributes
//!
//! How to appy terminal attributes to text.
//! How to apply terminal attributes to text.
//!
//! Command API:
//!
Expand Down Expand Up @@ -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())
}
2 changes: 1 addition & 1 deletion src/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/tty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9bc5cd3

Please sign in to comment.