Skip to content

Fix highlighting in picker with multiple columns - #6333

Merged
the-mikedavis merged 1 commit into
helix-editor:masterfrom
exp80:master
Mar 18, 2023
Merged

Fix highlighting in picker with multiple columns#6333
the-mikedavis merged 1 commit into
helix-editor:masterfrom
exp80:master

Conversation

@exp80

@exp80 exp80 commented Mar 16, 2023

Copy link
Copy Markdown
Contributor

Fixes #6254

This could be probably done in a less hacky way, but I didn't want to overcomplicate things.

@the-mikedavis the-mikedavis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding to cell_start_byte_offset in the None branch is a nice catch and that should stay 👍. The other change is not the right fix though. The offset is caused by Row::cell_text appending newlines to each cell's text and that should be fixed directly instead. It's caused by a bug introduced in b2837ff in impl<'a> From<&Text<'a>> for String where each line gets a newline appended. That newline should only be added between lines though. There's a small refactor of that for that fixes the issue:

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

@the-mikedavis the-mikedavis added C-bug Category: This is a bug S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 18, 2023
@the-mikedavis the-mikedavis added this to the next milestone Mar 18, 2023
@exp80

exp80 commented Mar 18, 2023

Copy link
Copy Markdown
Contributor Author

Thanks, I didn't know if that was intentional or not. Fixed.

@exp80
exp80 requested a review from the-mikedavis March 18, 2023 15:42
@the-mikedavis
the-mikedavis merged commit 7704965 into helix-editor:master Mar 18, 2023
sagnibak pushed a commit to sagnibak/helix that referenced this pull request Mar 21, 2023
icecreammatt pushed a commit to icecreammatt/helix that referenced this pull request Apr 19, 2023
wes-adams pushed a commit to wes-adams/helix that referenced this pull request Jul 4, 2023
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug Category: This is a bug S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Picker fuzzy highlighting is offset when using more than one column

2 participants