Fix typos and grammar mistakes (#743)

* Fix typos and grammar mistakes

* Fix broken test for "remove_last_char_works_with_normal_string"

I accidentally "fixed" the missing char in the previous commit.
This commit is contained in:
Paul Buehne 2024-02-08 14:00:30 +01:00 committed by GitHub
parent 62fdea8158
commit e0aa40a1aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 16 additions and 16 deletions

View File

@ -11,7 +11,7 @@ const SELECTION_CHAR: char = '!';
// It pulls data from the object that contains access to the History
pub(crate) struct HistoryCompleter<'menu>(&'menu dyn History);
// Safe to implement Send since the Historycompleter should only be used when
// Safe to implement Send since the HistoryCompleter should only be used when
// updating the menu and that must happen in the same thread
unsafe impl<'menu> Send for HistoryCompleter<'menu> {}

View File

@ -667,7 +667,7 @@ mod test {
#[rstest]
#[case("hello world", 0, 'l', 1, false, "lo world")]
#[case("hello world", 0, 'l', 1, true, "llo world")]
#[ignore = "Deleting two consecutives is not implemented correctly and needs the multiplier explicitly."]
#[ignore = "Deleting two consecutive chars is not implemented correctly and needs the multiplier explicitly."]
#[case("hello world", 0, 'l', 2, false, "o world")]
#[case("hello world", 0, 'h', 1, false, "hello world")]
#[case("hello world", 0, 'l', 3, true, "ld")]

View File

@ -908,7 +908,7 @@ mod test {
#[case("word and another one", 3, 7)] // repeat calling will move
#[case("word and another one", 4, 7)] // Starting from whitespace works
#[case("word\nline two", 0, 3)] // Multiline...
#[case("word\nline two", 3, 8)] // ... contineus to next word end
#[case("word\nline two", 3, 8)] // ... continues to next word end
#[case("weirdö characters", 0, 5)] // Multibyte unicode at the word end (latin UTF-8 should be two bytes long)
#[case("weirdö characters", 5, 17)] // continue with unicode (latin UTF-8 should be two bytes long)
#[case("weirdö", 0, 5)] // Multibyte unicode at the buffer end is fine as well

View File

@ -67,7 +67,7 @@ impl Keybindings {
/// Remove a keybinding
///
/// Returns `Some(ReedlineEvent)` if the keycombination was previously bound to a particular [`ReedlineEvent`]
/// Returns `Some(ReedlineEvent)` if the key combination was previously bound to a particular [`ReedlineEvent`]
pub fn remove_binding(
&mut self,
modifier: KeyModifiers,

View File

@ -657,7 +657,7 @@ impl Reedline {
Ok(())
}
/// Clear the screen and the scollback buffer of the terminal
/// Clear the screen and the scrollback buffer of the terminal
pub fn clear_scrollback(&mut self) -> Result<()> {
self.painter.clear_scrollback()?;

View File

@ -55,7 +55,7 @@ where
self.sender.send(line)
}
/// Convenience method to get a line if any, doesn´t block.
/// Convenience method to get a line if any, doesn't block.
pub fn get_line(&self) -> Option<T> {
self.receiver.try_recv().ok()
}

View File

@ -4,13 +4,13 @@ use nu_ansi_term::{Color, Style};
pub static DEFAULT_BUFFER_MATCH_COLOR: Color = Color::Green;
pub static DEFAULT_BUFFER_NEUTRAL_COLOR: Color = Color::White;
pub static DEFAULT_BUFFER_NOTMATCH_COLOR: Color = Color::Red;
pub static DEFAULT_BUFFER_NOT_MATCH_COLOR: Color = Color::Red;
/// A simple, example highlighter that shows how to highlight keywords
pub struct ExampleHighlighter {
external_commands: Vec<String>,
match_color: Color,
notmatch_color: Color,
not_match_color: Color,
neutral_color: Color,
}
@ -51,7 +51,7 @@ impl Highlighter for ExampleHighlighter {
} else if self.external_commands.is_empty() {
styled_text.push((Style::new().fg(self.neutral_color), line.to_string()));
} else {
styled_text.push((Style::new().fg(self.notmatch_color), line.to_string()));
styled_text.push((Style::new().fg(self.not_match_color), line.to_string()));
}
styled_text
@ -63,7 +63,7 @@ impl ExampleHighlighter {
ExampleHighlighter {
external_commands,
match_color: DEFAULT_BUFFER_MATCH_COLOR,
notmatch_color: DEFAULT_BUFFER_NOTMATCH_COLOR,
not_match_color: DEFAULT_BUFFER_NOT_MATCH_COLOR,
neutral_color: DEFAULT_BUFFER_NEUTRAL_COLOR,
}
}
@ -76,7 +76,7 @@ impl ExampleHighlighter {
neutral_color: Color,
) {
self.match_color = match_color;
self.notmatch_color = notmatch_color;
self.not_match_color = notmatch_color;
self.neutral_color = neutral_color;
}
}

View File

@ -510,7 +510,7 @@ mod tests {
}
#[test]
fn concurrent_histories_dont_erase_eachother() -> Result<()> {
fn concurrent_histories_do_not_erase_each_other() -> Result<()> {
use tempfile::tempdir;
let tmp = tempdir().unwrap();

View File

@ -893,7 +893,7 @@ impl Menu for IdeMenu {
));
}
let decsription_height =
let description_height =
available_lines.min(self.default_details.max_description_height);
let description_lines = self
.get_value()
@ -903,7 +903,7 @@ impl Menu for IdeMenu {
description,
use_ansi_coloring,
self.working_details.description_width,
decsription_height,
description_height,
self.working_details.description_width, // the width has already been calculated
)
})

View File

@ -51,7 +51,7 @@ pub(crate) fn estimate_required_lines(input: &str, screen_width: u16) -> usize {
/// Reports the additional lines needed due to wrapping for the given line.
///
/// Does not account for any potential linebreaks in `line`
/// Does not account for any potential line breaks in `line`
///
/// If `line` fits in `terminal_columns` returns 0
pub(crate) fn estimate_single_line_wraps(line: &str, terminal_columns: u16) -> usize {

View File

@ -101,7 +101,7 @@ pub trait Prompt: Send {
fn get_prompt_color(&self) -> Color {
DEFAULT_PROMPT_COLOR
}
/// Get the default multilince prompt color
/// Get the default multiline prompt color
fn get_prompt_multiline_color(&self) -> nu_ansi_term::Color {
DEFAULT_PROMPT_MULTILINE_COLOR
}