Skip to content

Commit

Permalink
Cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
EpocSquadron committed Jan 28, 2023
1 parent d2075e2 commit eb953c3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2069,7 +2069,7 @@ fn extend_line_impl(cx: &mut Context, extend: Extend) {
let start = text.line_to_char(start_line);
let end = text.line_to_char(
(end_line + 1) // newline of end_line
.min(text.len_lines()),
.min(text.len_lines()),
);

// extend to previous/next line if current line is selected
Expand Down Expand Up @@ -5099,10 +5099,10 @@ fn increment_impl(cx: &mut Context, increment_direction: IncrementDirection) {
let selected_text: Cow<str> = range.fragment(text);
let new_from = ((range.from() as i128) + cumulative_length_diff) as usize;
let incremented = [increment::integer, increment::date_time]
.iter()
.iter()
.find_map(|incrementor| incrementor(selected_text.as_ref(), amount));

amount += increase_by;
amount += increase_by;

match incremented {
None => {
Expand All @@ -5111,14 +5111,14 @@ fn increment_impl(cx: &mut Context, increment_direction: IncrementDirection) {
(range.to() as i128 + cumulative_length_diff) as usize,
);
new_selection_ranges.push(new_range);
}
}
Some(new_text) => {
let new_range = Range::new(new_from, new_from + new_text.len());
cumulative_length_diff += new_text.len() as i128 - selected_text.len() as i128;
new_selection_ranges.push(new_range);
changes.push((range.from(), range.to(), Some(new_text.into())));
}
}
}
}

if !changes.is_empty() {
Expand Down

0 comments on commit eb953c3

Please sign in to comment.