Fix typos (#675)
This commit is contained in:
parent
39e6f1c3a1
commit
21155716e2
12
CHANGELOG.md
12
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.
|
||||
|
@ -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 |
|
||||
|
@ -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);
|
||||
|
@ -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<bool> {
|
||||
/// fn print_events() -> Result<bool> {
|
||||
/// 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 {
|
||||
|
@ -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)]
|
||||
|
@ -407,7 +407,7 @@ pub(crate) fn parse_csi_sgr_mouse(buffer: &[u8]) -> Result<Option<InternalEvent>
|
||||
|
||||
// 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.
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user