Update languages' highlight mapppings when the theme changes

Co-authored-by: Keith Simmons <keith@zed.dev>
This commit is contained in:
Max BrunsfeldandKeith Simmons committed 2022-04-22 12:09:14 -07:00
1 parent 873e654e28
commit 6076904b9b
1 file changed
+10 -2
+10 -2
View File
@@ -169,11 +169,19 @@ fn main() {
.detach();
languages.set_language_server_download_dir(zed::ROOT_PATH.clone());
languages.set_theme(&settings.theme.editor.syntax);
let languages = Arc::new(languages);
cx.observe_global::<Settings, _>({
let languages = languages.clone();
move |settings, _| {
languages.set_theme(&settings.theme.editor.syntax);
}
})
.detach();
cx.set_global(settings);
let app_state = Arc::new(AppState {
languages: Arc::new(languages),
languages,
themes,
channel_list,
client,