Fix highlighting in picker with multiple columns (#6333)
commit770496511c67cf276f0b0a292e7a82fbd1b5f778
authorexp80 <62665970+exp80@users.noreply.github.com>
dateSat 18 Mar 2023, 17:16 (4 years ago)
parentac2a773
helix-term/src/ui/picker.rs+4−1
@@ -812,7 +812,10 @@ impl<T: Item + 'static> Component for Picker<T> {
812812 for cell in row.cells.iter_mut() {
813813 let spans = match cell.content.lines.get(0) {
814814 Some(s) => s,
815− None => continue,
815+ None => {
816+ cell_start_byte_offset += TEMP_CELL_SEP.len();
817+ continue;
818+ }
816819 };
817820
818821 let mut cell_len = 0;
helix-tui/src/text.rs+3−1
@@ -453,10 +453,12 @@ impl<'a> From<&Text<'a>> for String {
453453 let mut output = String::with_capacity(size);
454454
455455 for spans in &text.lines {
456+ if !output.is_empty() {
457+ output.push('\n');
458+ }
456459 for span in &spans.0 {
457460 output.push_str(&span.content);
458461 }
459− output.push('\n');
460462 }
461463 output
462464 }