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:
Mikayla Maki
2024-01-17 17:13:47 -08:00
committed by GitHub
64 changed files with 146 additions and 114 deletions
+5 -7
View File
@@ -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),