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 Fenner 2025-06-02 19:35:00 +02:00 committed by GitHub
parent 9dd18e5ee1
commit ec69b68e72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 60 additions and 2 deletions

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);