Add typo detection to CI (#4107)
Adding the typos crate to our CI will take some doing, as we have several tests which rely on typos in various ways (e.g. checking state as the user types), but I thought I'd take a first stab at fixing what it finds. Release Notes: - N/A
This commit is contained in:
commit
aa7351041d
64 changed files with 146 additions and 114 deletions
|
@ -152,7 +152,7 @@ pub(crate) fn repeat(cx: &mut WindowContext, from_insert_mode: bool) {
|
|||
|
||||
let mut count = Vim::read(cx).workspace_state.recorded_count.unwrap_or(1);
|
||||
|
||||
// if we came from insert mode we're just doing repititions 2 onwards.
|
||||
// if we came from insert mode we're just doing repetitions 2 onwards.
|
||||
if from_insert_mode {
|
||||
count -= 1;
|
||||
new_actions[0] = actions[0].clone();
|
||||
|
|
|
@ -278,7 +278,7 @@ fn parse_replace_all(query: &str) -> Replacement {
|
|||
return Replacement::default();
|
||||
}
|
||||
|
||||
let Some(delimeter) = chars.next() else {
|
||||
let Some(delimiter) = chars.next() else {
|
||||
return Replacement::default();
|
||||
};
|
||||
|
||||
|
@ -301,13 +301,13 @@ fn parse_replace_all(query: &str) -> Replacement {
|
|||
buffer.push('$')
|
||||
// unescape escaped parens
|
||||
} else if phase == 0 && c == '(' || c == ')' {
|
||||
} else if c != delimeter {
|
||||
} else if c != delimiter {
|
||||
buffer.push('\\')
|
||||
}
|
||||
buffer.push(c)
|
||||
} else if c == '\\' {
|
||||
escaped = true;
|
||||
} else if c == delimeter {
|
||||
} else if c == delimiter {
|
||||
if phase == 0 {
|
||||
buffer = &mut replacement;
|
||||
phase = 1;
|
||||
|
|
|
@ -359,7 +359,7 @@ impl NeovimConnection {
|
|||
// to add one to the end in visual mode.
|
||||
match mode {
|
||||
Some(Mode::VisualBlock) if selection_row != cursor_row => {
|
||||
// in zed we fake a block selecrtion by using multiple cursors (one per line)
|
||||
// in zed we fake a block selection by using multiple cursors (one per line)
|
||||
// this code emulates that.
|
||||
// to deal with casees where the selection is not perfectly rectangular we extract
|
||||
// the content of the selection via the "a register to get the shape correctly.
|
||||
|
|
|
@ -332,7 +332,7 @@ impl Vim {
|
|||
}
|
||||
}
|
||||
|
||||
/// Explicitly record one action (equiavlent to start_recording and stop_recording)
|
||||
/// Explicitly record one action (equivalents to start_recording and stop_recording)
|
||||
pub fn record_current_action(&mut self, cx: &mut WindowContext) {
|
||||
self.start_recording(cx);
|
||||
self.stop_recording();
|
||||
|
|
|
@ -201,15 +201,13 @@ pub fn visual_block_motion(
|
|||
let mut row = tail.row();
|
||||
|
||||
loop {
|
||||
let layed_out_line = map.layout_row(row, &text_layout_details);
|
||||
let laid_out_line = map.layout_row(row, &text_layout_details);
|
||||
let start = DisplayPoint::new(
|
||||
row,
|
||||
layed_out_line.closest_index_for_x(positions.start) as u32,
|
||||
);
|
||||
let mut end = DisplayPoint::new(
|
||||
row,
|
||||
layed_out_line.closest_index_for_x(positions.end) as u32,
|
||||
laid_out_line.closest_index_for_x(positions.start) as u32,
|
||||
);
|
||||
let mut end =
|
||||
DisplayPoint::new(row, laid_out_line.closest_index_for_x(positions.end) as u32);
|
||||
if end <= start {
|
||||
if start.column() == map.line_len(start.row()) {
|
||||
end = start;
|
||||
|
@ -218,7 +216,7 @@ pub fn visual_block_motion(
|
|||
}
|
||||
}
|
||||
|
||||
if positions.start <= layed_out_line.width {
|
||||
if positions.start <= laid_out_line.width {
|
||||
let selection = Selection {
|
||||
id: s.new_selection_id(),
|
||||
start: start.to_point(map),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue