From ae12c58f0ff924e9cc512f0368e5fca858566cdd Mon Sep 17 00:00:00 2001 From: Ryan Russell Date: Wed, 1 Jun 2022 12:01:37 -0500 Subject: [PATCH] Improve Readability (#2639) --- book/src/from-vim.md | 2 +- 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 +- helix-term/src/commands.rs | 4 ++-- helix-term/src/commands/lsp.rs | 4 ++-- helix-term/src/keymap.rs | 2 +- helix-view/src/handlers/dap.rs | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/book/src/from-vim.md b/book/src/from-vim.md index 09f33386..ed6155d3 100644 --- a/book/src/from-vim.md +++ b/book/src/from-vim.md @@ -9,4 +9,4 @@ single width selection. See also Kakoune's [Migrating from Vim](https://github.com/mawww/kakoune/wiki/Migrating-from-Vim). -> TODO: Mention texobjects, surround, registers +> TODO: Mention textobjects, surround, registers 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); diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index a692822f..44e2f8c2 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1964,7 +1964,7 @@ fn shrink_to_line_bounds(cx: &mut Context) { // line_to_char gives us the start position of the line, so // we need to get the start position of the next line. In // the editor, this will correspond to the cursor being on - // the EOL whitespace charactor, which is what we want. + // the EOL whitespace character, which is what we want. let mut end = text.line_to_char((end_line + 1).min(text.len_lines())); if start != range.from() { @@ -2929,7 +2929,7 @@ pub mod insert { Transaction::change_by_selection(doc.text(), doc.selection(view.id), |range| { let pos = range.cursor(text); let line_start_pos = text.line_to_char(range.cursor_line(text)); - // considier to delete by indent level if all characters before `pos` are indent units. + // consider to delete by indent level if all characters before `pos` are indent units. let fragment = Cow::from(text.slice(line_start_pos..pos)); if !fragment.is_empty() && fragment.chars().all(|ch| ch.is_whitespace()) { if text.get_char(pos.saturating_sub(1)) == Some('\t') { diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index 90a1ad7f..bf62fd3c 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -416,8 +416,8 @@ pub fn apply_workspace_edit( } lsp::DocumentChanges::Operations(operations) => { log::debug!("document changes - operations: {:?}", operations); - for operateion in operations { - match operateion { + for operation in operations { + match operation { lsp::DocumentChangeOperation::Op(op) => { apply_document_resource_op(op).unwrap(); } diff --git a/helix-term/src/keymap.rs b/helix-term/src/keymap.rs index 37dbc5de..db958833 100644 --- a/helix-term/src/keymap.rs +++ b/helix-term/src/keymap.rs @@ -542,7 +542,7 @@ mod tests { vec![vec![key!('j')], vec![key!('k')]] ), ]), - "Mistmatch" + "Mismatch" ) } } diff --git a/helix-view/src/handlers/dap.rs b/helix-view/src/handlers/dap.rs index 2ea21f62..b17ca353 100644 --- a/helix-view/src/handlers/dap.rs +++ b/helix-view/src/handlers/dap.rs @@ -86,7 +86,7 @@ pub fn breakpoints_changed( path: PathBuf, breakpoints: &mut [Breakpoint], ) -> Result<(), anyhow::Error> { - // TODO: handle capabilities correctly again, by filterin breakpoints when emitting + // TODO: handle capabilities correctly again, by filtering breakpoints when emitting // if breakpoint.condition.is_some() // && !debugger // .caps