Skip to content

Commit ba6496b

Browse files
ronharel02osiewicz
authored andcommitted
editor: Trim indent guides at last non-empty line (#29482)
Closes #26274 Adjust the end position of indent guides to prevent them from extending through empty space. Also corrected old test values ​​that seemed to have adapted to the indentation's behavior. Release Notes: - Fixed indentation guides extending beyond the final scope in a file.
1 parent 1f123bf commit ba6496b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

crates/editor/src/editor_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16520,7 +16520,7 @@ async fn test_indent_guide_tabs(cx: &mut TestAppContext) {
1652016520
assert_indent_guides(
1652116521
0..6,
1652216522
vec![
16523-
indent_guide(buffer_id, 1, 6, 0),
16523+
indent_guide(buffer_id, 1, 5, 0),
1652416524
indent_guide(buffer_id, 3, 4, 1),
1652516525
],
1652616526
None,

crates/multi_buffer/src/multi_buffer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5793,7 +5793,7 @@ impl MultiBufferSnapshot {
57935793
line_indent.len(tab_size) / tab_size
57945794
+ ((line_indent.len(tab_size) % tab_size) > 0) as u32
57955795
} else {
5796-
current_depth
5796+
0
57975797
};
57985798

57995799
match depth.cmp(&current_depth) {

0 commit comments

Comments
 (0)