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.
This commit is contained in:
Ron Harel 2025-05-12 18:04:46 +03:00 committed by GitHub
parent 93b6fdb8e5
commit 6592314984
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -16520,7 +16520,7 @@ async fn test_indent_guide_tabs(cx: &mut TestAppContext) {
assert_indent_guides(
0..6,
vec![
indent_guide(buffer_id, 1, 6, 0),
indent_guide(buffer_id, 1, 5, 0),
indent_guide(buffer_id, 3, 4, 1),
],
None,

View file

@ -5793,7 +5793,7 @@ impl MultiBufferSnapshot {
line_indent.len(tab_size) / tab_size
+ ((line_indent.len(tab_size) % tab_size) > 0) as u32
} else {
current_depth
0
};
match depth.cmp(&current_depth) {