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

Multibuffer doesn't always highlight all search results #18254

Closed
1 task done
notpeter opened this issue Sep 24, 2024 · 3 comments · Fixed by #18273
Closed
1 task done

Multibuffer doesn't always highlight all search results #18254

notpeter opened this issue Sep 24, 2024 · 3 comments · Fixed by #18273
Labels
defect [core label] regression A bug that was introduced in a recent release search / project search Feedback for in-file search, multi-buffer global search, etc

Comments

@notpeter
Copy link
Member

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Steps to reproduce:

  1. Checkout zed repo and open it in Zed
  2. cmd-shift-f for save_as and press enter
  3. Scroll down and some of the results are not highlighted.

It's not always the same results, but it's quite consistent.

I did the git bisect and I believe it broke v0.151.0-pre due to commit 1d868e1 from PR #16960:

CC: @mrnugget

Environment

Zed: v0.155.0 (Zed Nightly bb7d9d3)
OS: macOS 14.7.0
Memory: 64 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

Screenshot 2024-09-23 at 22 00 50

If applicable, attach your Zed.log file to this issue.

Zed.log
@notpeter notpeter added defect [core label] triage Maintainer needs to classify the issue admin read Pending admin review regression A bug that was introduced in a recent release search / project search Feedback for in-file search, multi-buffer global search, etc and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Sep 24, 2024
@CharlesChen0823
Copy link
Contributor

CharlesChen0823 commented Sep 24, 2024

@failable
Copy link

failable commented Sep 24, 2024

mrnugget added a commit that referenced this issue Sep 24, 2024
Closes #18254.
Closes #18219.
Closes #17690.

This fixes the project search not highlighting all results.

The problem was relatively simple, even though it took a while to find
it: we inserted multiple excerpts concurrently and the order in the
multi-buffer ended up being wrong. Sorting the resulting `match_ranges`
fixed the problem, but as it turns out, we can do a better job
by moving the concurrency into the method on the MultiBuffer.

Performance is the same, but now the problem is fixed.

Co-authored-by: Bennet <bennet@zed.dev>
mrnugget added a commit that referenced this issue Sep 24, 2024
Closes #18254
Closes #18219
Closes #17690

This fixes the project search not highlighting all results.

The problem was relatively simple, even though it took a while to find
it: we inserted multiple excerpts concurrently and the order in the
multi-buffer ended up being wrong. Sorting the resulting `match_ranges`
fixed the problem, but as it turns out, we can do a better job by moving
the concurrency into the method on the MultiBuffer.

Performance is the same, but now the problem is fixed.

Release Notes:

- Fixed search results in project-wide search not being highlighted
consistently and navigation sometimes being broken (#18254, #18219,

---------

Co-authored-by: Bennet <bennet@zed.dev>
mrnugget added a commit that referenced this issue Sep 24, 2024
Closes #18254
Closes #18219
Closes #17690

This fixes the project search not highlighting all results.

The problem was relatively simple, even though it took a while to find
it: we inserted multiple excerpts concurrently and the order in the
multi-buffer ended up being wrong. Sorting the resulting `match_ranges`
fixed the problem, but as it turns out, we can do a better job by moving
the concurrency into the method on the MultiBuffer.

Performance is the same, but now the problem is fixed.

Release Notes:

- Fixed search results in project-wide search not being highlighted
consistently and navigation sometimes being broken (#18254, #18219,

---------

Co-authored-by: Bennet <bennet@zed.dev>
@notpeter
Copy link
Member Author

Thanks for reporting. Updates for Zed Stable and Zed Preview including the fix are building now and should be available shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] regression A bug that was introduced in a recent release search / project search Feedback for in-file search, multi-buffer global search, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants