Skip to content

Commit

Permalink
Fix typos and grammar mistakes (#743)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
cactusdualcore authored Feb 8, 2024
1 parent 62fdea8 commit e0aa40a
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/completion/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {}

Expand Down
2 changes: 1 addition & 1 deletion src/core_editor/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion src/core_editor/line_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/edit_mode/keybindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?;

Expand Down
2 changes: 1 addition & 1 deletion src/external_printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
10 changes: 5 additions & 5 deletions src/highlighter/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down Expand Up @@ -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
Expand All @@ -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,
}
}
Expand All @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/history/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/menu/ide_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
)
})
Expand Down
2 changes: 1 addition & 1 deletion src/painting/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/prompt/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit e0aa40a

Please sign in to comment.