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

Do not show (running) when opening picker #8148

Merged
merged 2 commits into from
Sep 6, 2023
Merged

Do not show (running) when opening picker #8148

merged 2 commits into from
Sep 6, 2023

Conversation

pascalkuthe
Copy link
Member

Closes #8142

There were actually two issues here:

  • nucleo had a bug where it would start the matcher but not wait for it to finish on the first call to tick. I fixed this upstream and also updated the Cargo.lock file a bit (using cargo update) to remove some duplicate dependencies.
  • For the file picker the (running) indicator would still always appear because starting a background thread takes a while causing a timeout. I fixed this by running the FS transversal on the UI thread for up to 30ms. This is short enough to not cause UI lag but long enough for most reasonable directories to finish.

For the global search picker the problem persists, but since the global search runs eagerly there is no way to fix that (one we start the search it will always block the main thread until its complete). I think its ultimately not a huge issue.

If the file transversal is longer shorter 30ms it will now be performed
on the main thread. Spawning a thread can take a while (or rather it
takes a while until that thread is scheduled) so the files can actually
take a while to show up. This prevents the `(running)` indicator from
briefly showing up when opening the file picker in a small directory.
@pascalkuthe pascalkuthe added this to the 23.9 milestone Sep 2, 2023
@pascalkuthe pascalkuthe added E-easy Call for participation: Experience needed to fix: Easy / not much S-waiting-on-review Status: Awaiting review from a maintainer. A-command Area: Commands labels Sep 2, 2023
@gabydd
Copy link
Member

gabydd commented Sep 6, 2023

can confirm this works beautifully (probably should have mentioned this in the initial pr whoops)

@archseer archseer merged commit 0cfd46c into master Sep 6, 2023
6 checks passed
@archseer archseer deleted the picker_timeout branch September 6, 2023 05:01
dgkf pushed a commit to dgkf/helix that referenced this pull request Jan 30, 2024
* only stream from background thread if necessary

If the file transversal is longer shorter 30ms it will now be performed
on the main thread. Spawning a thread can take a while (or rather it
takes a while until that thread is scheduled) so the files can actually
take a while to show up. This prevents the `(running)` indicator from
briefly showing up when opening the file picker in a small directory.

* run partial cargo update
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
* only stream from background thread if necessary

If the file transversal is longer shorter 30ms it will now be performed
on the main thread. Spawning a thread can take a while (or rather it
takes a while until that thread is scheduled) so the files can actually
take a while to show up. This prevents the `(running)` indicator from
briefly showing up when opening the file picker in a small directory.

* run partial cargo update
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
* only stream from background thread if necessary

If the file transversal is longer shorter 30ms it will now be performed
on the main thread. Spawning a thread can take a while (or rather it
takes a while until that thread is scheduled) so the files can actually
take a while to show up. This prevents the `(running)` indicator from
briefly showing up when opening the file picker in a small directory.

* run partial cargo update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-command Area: Commands E-easy Call for participation: Experience needed to fix: Easy / not much S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop (running) flickering on and off when opening the new picker
5 participants