Fix no whitespace displaying after an "à " (#22403)
fixed a bug where with the "show_whitespaces": "boundary" option, when there was an "à" followed by a space, a white space was displayed, and when "à" was at the end of the line, a white space was added Release Notes: - N/A --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
d67f2d3eab
commit
811b872f4e
1 changed files with 15 additions and 15 deletions
|
@ -5578,21 +5578,21 @@ impl LineWithInvisibles {
|
|||
});
|
||||
}
|
||||
} else {
|
||||
invisibles.extend(
|
||||
line_chunk
|
||||
.bytes()
|
||||
.enumerate()
|
||||
.filter(|(_, line_byte)| {
|
||||
let is_whitespace =
|
||||
(*line_byte as char).is_whitespace();
|
||||
non_whitespace_added |= !is_whitespace;
|
||||
is_whitespace
|
||||
&& (non_whitespace_added || !is_soft_wrapped)
|
||||
})
|
||||
.map(|(whitespace_index, _)| Invisible::Whitespace {
|
||||
line_offset: line.len() + whitespace_index,
|
||||
}),
|
||||
)
|
||||
invisibles.extend(line_chunk.char_indices().filter_map(
|
||||
|(index, c)| {
|
||||
let is_whitespace = c.is_whitespace();
|
||||
non_whitespace_added |= !is_whitespace;
|
||||
if is_whitespace
|
||||
&& (non_whitespace_added || !is_soft_wrapped)
|
||||
{
|
||||
Some(Invisible::Whitespace {
|
||||
line_offset: line.len() + index,
|
||||
})
|
||||
} else {
|
||||
None
|
||||
}
|
||||
},
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue