[text-object/indent] fix: final target should be less indent scope

pull/14004/head
ktunprasert 2025-07-19 14:53:18 +01:00
parent f63e0a5a51
commit 851f9c73dd
1 changed files with 3 additions and 3 deletions

View File

@ -3900,7 +3900,7 @@ fn goto_indent_impl(cx: &mut Context, movement: Movement, direction: Direction)
}; };
if target_idx >= text.len_lines() || target_idx == 0 { if target_idx >= text.len_lines() || target_idx == 0 {
break break;
} }
let target_line = text.line(target_idx); let target_line = text.line(target_idx);
@ -3911,8 +3911,8 @@ fn goto_indent_impl(cx: &mut Context, movement: Movement, direction: Direction)
continue; continue;
} }
// Stop when indentation changes // Stop when scoped up
if target_first_char_pos != first_char_pos { if target_first_char_pos < first_char_pos {
break; break;
} }
} }