diff --git a/src/completion/history.rs b/src/completion/history.rs index 015381ac..7302e2df 100644 --- a/src/completion/history.rs +++ b/src/completion/history.rs @@ -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> {} diff --git a/src/core_editor/editor.rs b/src/core_editor/editor.rs index 5e96b160..c39e6550 100644 --- a/src/core_editor/editor.rs +++ b/src/core_editor/editor.rs @@ -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")] diff --git a/src/core_editor/line_buffer.rs b/src/core_editor/line_buffer.rs index 6c929a63..ce5dc889 100644 --- a/src/core_editor/line_buffer.rs +++ b/src/core_editor/line_buffer.rs @@ -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 diff --git a/src/edit_mode/keybindings.rs b/src/edit_mode/keybindings.rs index 7dcccd89..bd9f95cd 100644 --- a/src/edit_mode/keybindings.rs +++ b/src/edit_mode/keybindings.rs @@ -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, diff --git a/src/engine.rs b/src/engine.rs index e7bcceb7..f5db1cdb 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -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()?; diff --git a/src/external_printer.rs b/src/external_printer.rs index f4c71e7c..1b6c5d2e 100644 --- a/src/external_printer.rs +++ b/src/external_printer.rs @@ -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 { self.receiver.try_recv().ok() } diff --git a/src/highlighter/example.rs b/src/highlighter/example.rs index 1f1c9aee..816c657a 100644 --- a/src/highlighter/example.rs +++ b/src/highlighter/example.rs @@ -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, 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; } } diff --git a/src/history/cursor.rs b/src/history/cursor.rs index ab41ba4f..f424cebb 100644 --- a/src/history/cursor.rs +++ b/src/history/cursor.rs @@ -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(); diff --git a/src/menu/ide_menu.rs b/src/menu/ide_menu.rs index 1e36069f..2ce711f6 100644 --- a/src/menu/ide_menu.rs +++ b/src/menu/ide_menu.rs @@ -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 ) }) diff --git a/src/painting/utils.rs b/src/painting/utils.rs index b0df1228..541e6177 100644 --- a/src/painting/utils.rs +++ b/src/painting/utils.rs @@ -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 { diff --git a/src/prompt/base.rs b/src/prompt/base.rs index 01d91658..db69f2e0 100644 --- a/src/prompt/base.rs +++ b/src/prompt/base.rs @@ -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 }