We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When there's an empty line (i.e. "\n"), the BufferLine loses Attrs information from the source. This results in a couple issues:
"\n"
BufferLine
Attrs
Example reproduction: Replace the set_buffer_text function in the rich-text example with the below.
set_buffer_text
fn set_buffer_text<'a>(buffer: &mut BorrowedWithFontSystem<'a, Buffer>) { let attrs = Attrs::new(); let spans: &[(&str, Attrs)] = &[ ("Line 1\n", attrs.color(Color::rgb(0xFF, 0xFF, 0x00))), ("Line 2\n", attrs.color(Color::rgb(0xFF, 0x7F, 0x00))), ("x\n", attrs.color(Color::rgb(0xFF, 0x00, 0x00))), ("Line 4", attrs.color(Color::rgb(0x00, 0xFF, 0x00))), ]; buffer.set_rich_text(spans.iter().copied(), attrs, Shaping::Advanced); }
Delete x, type a, it's a different Attrs (the buffer's default Attrs).
x
a
Preferred solution is that there is always enforced one span per buffer line, even if it is a zero length span.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When there's an empty line (i.e.
"\n"
), theBufferLine
losesAttrs
information from the source. This results in a couple issues:Attrs
.Attrs
for the empty line it's not possible to recreate the source representation from the buffer representation.Reproduction
Example reproduction: Replace the
set_buffer_text
function in the rich-text example with the below.Delete
x
, typea
, it's a differentAttrs
(the buffer's defaultAttrs
).Solution
Preferred solution is that there is always enforced one span per buffer line, even if it is a zero length span.
The text was updated successfully, but these errors were encountered: