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

Conversation

exp80
Copy link
Contributor

@exp80 exp80 commented Mar 16, 2023

Fixes #6254

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

Copy link
Member

@the-mikedavis the-mikedavis left a comment

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
Copy link
Contributor Author

exp80 commented Mar 18, 2023

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

@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