[text-object/indent] fix: range should work both directions

pull/14004/head
ktunprasert 2025-07-19 15:06:16 +01:00
parent c0062c9c37
commit 3402f45742
1 changed files with 1 additions and 1 deletions

View File

@ -3928,7 +3928,7 @@ fn goto_indent_impl(cx: &mut Context, movement: Movement, direction: Direction)
Direction::Backward => target_idx.saturating_add(1),
};
let indents: Vec<u64> = (line_idx..target_idx)
let indents: Vec<u64> = (line_idx.min(target_idx)..=line_idx.max(target_idx))
.map(|i| text.line(i))
.map(|l| l.chars().map_while(count_indent).sum()).collect();