From ae12c58f0ff924e9cc512f0368e5fca858566cdd Mon Sep 17 00:00:00 2001 From: Ryan Russell Date: Wed, 1 Jun 2022 12:01:37 -0500 Subject: Improve Readability (#2639) --- helix-core/src/graphemes.rs | 2 +- helix-core/src/history.rs | 6 +++--- helix-core/src/increment/number.rs | 2 +- helix-core/src/lib.rs | 2 +- helix-core/src/selection.rs | 2 +- helix-core/src/surround.rs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) (limited to 'helix-core') diff --git a/helix-core/src/graphemes.rs b/helix-core/src/graphemes.rs index c0c61775..675f5750 100644 --- a/helix-core/src/graphemes.rs +++ b/helix-core/src/graphemes.rs @@ -14,7 +14,7 @@ pub fn grapheme_width(g: &str) -> usize { // Point 1: theoretically, ascii control characters should have zero // width, but in our case we actually want them to have width: if they // show up in text, we want to treat them as textual elements that can - // be editied. So we can get away with making all ascii single width + // be edited. So we can get away with making all ascii single width // here. // Point 2: we're only examining the first codepoint here, which means // we're ignoring graphemes formed with combining characters. However, diff --git a/helix-core/src/history.rs b/helix-core/src/history.rs index 3f324e34..b608097c 100644 --- a/helix-core/src/history.rs +++ b/helix-core/src/history.rs @@ -177,7 +177,7 @@ impl History { } } - /// List of nodes on the way from `n` to 'a`. Doesn`t include `a`. + /// List of nodes on the way from `n` to 'a`. Doesn't include `a`. /// Includes `n` unless `a == n`. `a` must be an ancestor of `n`. fn path_up(&self, mut n: usize, a: usize) -> Vec { let mut path = Vec::new(); @@ -546,8 +546,8 @@ mod test { // Units are validated. assert_eq!( - "1 millenium".parse::(), - Err("incorrect time unit: millenium".to_string()) + "1 millennium".parse::(), + Err("incorrect time unit: millennium".to_string()) ); // Units can't be specified twice. diff --git a/helix-core/src/increment/number.rs b/helix-core/src/increment/number.rs index 57171f67..62b4a19d 100644 --- a/helix-core/src/increment/number.rs +++ b/helix-core/src/increment/number.rs @@ -377,7 +377,7 @@ mod test { } #[test] - fn test_increment_basic_hexadedimal_numbers() { + fn test_increment_basic_hexadecimal_numbers() { let tests = [ ("0x0100", 1, "0x0101"), ("0x0100", -1, "0x00ff"), diff --git a/helix-core/src/lib.rs b/helix-core/src/lib.rs index 7d857b0f..627b73bb 100644 --- a/helix-core/src/lib.rs +++ b/helix-core/src/lib.rs @@ -43,7 +43,7 @@ pub fn find_first_non_whitespace_char(line: RopeSlice) -> Option { /// /// Order of detection: /// * Top-most folder containing a root marker in current git repository -/// * Git repostory root if no marker detected +/// * Git repository root if no marker detected /// * Top-most folder containing a root marker if not git repository detected /// * Current working directory as fallback pub fn find_root(root: Option<&str>, root_markers: &[String]) -> Option { diff --git a/helix-core/src/selection.rs b/helix-core/src/selection.rs index c6eceb4b..1b2416f5 100644 --- a/helix-core/src/selection.rs +++ b/helix-core/src/selection.rs @@ -830,7 +830,7 @@ mod test { } #[test] - fn test_graphem_aligned() { + fn test_grapheme_aligned() { let r = Rope::from_str("\r\nHi\r\n"); let s = r.slice(..); diff --git a/helix-core/src/surround.rs b/helix-core/src/surround.rs index db51b8f1..6244b380 100644 --- a/helix-core/src/surround.rs +++ b/helix-core/src/surround.rs @@ -66,7 +66,7 @@ pub fn find_nth_closest_pairs_pos( for ch in text.chars_at(pos) { if is_open_pair(ch) { // Track open pairs encountered so that we can step over - // the correspoding close pairs that will come up further + // the corresponding close pairs that will come up further // down the loop. We want to find a lone close pair whose // open pair is before the cursor position. stack.push(ch); -- cgit v1.2.3-70-g09d2