zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
47.94k stars 2.83k forks source link

`experimental.theme_overrides` issue when launching Zed #13188

Open failable opened 3 months ago

failable commented 3 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

The experimental.theme_overrides setting has some delays to be applied when launching Zed.

Environment

Zed: v0.140.4 (Zed Preview) OS: macOS 14.5.0 Memory: 32 GiB Architecture: x86_64

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

https://github.com/zed-industries/zed/assets/5475262/26c2f41f-ff12-447b-840f-839803912d85

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

chungweileong94 commented 3 months ago

Even without experiemental.them_overrides, if you happens to have multiple theme extensions (especially "base16" theme extension) installed, you will also see the delay.

chungweileong94 commented 3 months ago

This is one of the scenarios that will cause the theme delay:

Based on what I know, if you have too many theme extensions installed, or in my case, I have the "base16" theme extension, which includes tons of themes, Zed will have a theme delay during startup.

https://github.com/zed-industries/zed/assets/15154097/b261e615-af81-4a22-bbaf-65a8d7a3da38

failable commented 3 months ago

The same issue happens when I only install the "One Hunter Theme". When I only install single other theme, the issue does not happen.

chungweileong94 commented 3 months ago

The same issue happens when I only install the "One Hunter Theme". When I only install single other theme, the issue does not happen.

I'm guessing you are using Intel-based Mac, as It isn't the case for me when I only have "One Hunter Theme" on my M1 Mac machine, but it happens to my Intel Windows machine (I build the Zed from source). Which I think the theming mechanism isn't efficient enough.

failable commented 3 months ago

I'm guessing you are using Intel-based Mac

Yes

Which I think the theming mechanism isn't efficient enough.

Sometimes it takes ~2 seconds to finish.

But this issue did not happen until last week I updated to the latest preview version. (I update Zed every Thursday)

notpeter commented 3 months ago

Interesting. Here are the themes in question:

It appears base16-zed includes 251 themes, while there's just a single one in one-hunter. I'll see if I can reproduce this on an intel mac.