Fix highlighting in picker with multiple columns (#6333)

pull/6372/head
exp80 2 years ago committed by GitHub
parent ac2a7731a6
commit 770496511c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -812,7 +812,10 @@ impl<T: Item + 'static> Component for Picker<T> {
for cell in row.cells.iter_mut() { for cell in row.cells.iter_mut() {
let spans = match cell.content.lines.get(0) { let spans = match cell.content.lines.get(0) {
Some(s) => s, Some(s) => s,
None => continue, None => {
cell_start_byte_offset += TEMP_CELL_SEP.len();
continue;
}
}; };
let mut cell_len = 0; let mut cell_len = 0;

@ -453,10 +453,12 @@ impl<'a> From<&Text<'a>> for String {
let mut output = String::with_capacity(size); let mut output = String::with_capacity(size);
for spans in &text.lines { for spans in &text.lines {
if !output.is_empty() {
output.push('\n');
}
for span in &spans.0 { for span in &spans.0 {
output.push_str(&span.content); output.push_str(&span.content);
} }
output.push('\n');
} }
output output
} }

Loading…
Cancel
Save