indent guides: Fix issue with entirely-whitespace lines (#31916)

Closes #26957

Release Notes:

- Fix an edge case where indent guides would be rendered incorrectly if
lines consisted of entirely whitespace

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
This commit is contained in:
Bennet Bo FennerandBen Brandt authored and GitHub committed 2025-06-02 17:35:00 +00:00
1 parent fa60f7d03a
commit a4537ae59e
2 files changed
+60 -2

No files matched your search

+2 -2
View File
@@ -5780,7 +5780,7 @@ impl MultiBufferSnapshot {
// then add to the indent stack with the depth found
let mut found_indent = false;
let mut last_row = first_row;
if line_indent.is_line_empty() {
if line_indent.is_line_blank() {
while !found_indent {
let Some((target_row, new_line_indent, _)) = row_indents.next() else {
break;
@@ -5790,7 +5790,7 @@ impl MultiBufferSnapshot {
break;
}
if new_line_indent.is_line_empty() {
if new_line_indent.is_line_blank() {
continue;
}
last_row = target_row.min(end_row);