Skip to content
New issue

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

Fix highlighting in picker with multiple columns #6333

Merged
merged 1 commit into from
Mar 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion helix-term/src/ui/picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,10 @@ impl<T: Item + 'static> Component for Picker<T> {
for cell in row.cells.iter_mut() {
let spans = match cell.content.lines.get(0) {
Some(s) => s,
None => continue,
None => {
cell_start_byte_offset += TEMP_CELL_SEP.len();
continue;
}
};

let mut cell_len = 0;
Expand Down
4 changes: 3 additions & 1 deletion helix-tui/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,12 @@ impl<'a> From<&Text<'a>> for String {
let mut output = String::with_capacity(size);

for spans in &text.lines {
if !output.is_empty() {
output.push('\n');
}
for span in &spans.0 {
output.push_str(&span.content);
}
output.push('\n');
}
output
}
Expand Down