diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 8531525891..54691f2254 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -449,7 +449,7 @@ async fn watch_themes( mut cx: AsyncAppContext, ) -> Option<()> { let mut events = fs - .watch("styles/src".as_ref(), Duration::from_millis(250)) + .watch("styles/src".as_ref(), Duration::from_millis(100)) .await; while let Some(_) = events.next().await { let output = Command::new("npm") diff --git a/styles/src/buildThemes.ts b/styles/src/buildThemes.ts index dad56046a9..c43be067a8 100644 --- a/styles/src/buildThemes.ts +++ b/styles/src/buildThemes.ts @@ -11,7 +11,10 @@ const tempDirectory = fs.mkdtempSync(path.join(tmpdir(), 'build-themes')); // Clear existing themes for (const file of fs.readdirSync(themeDirectory)) { if (file.endsWith('.json')) { - fs.unlinkSync(path.join(themeDirectory, file)); + const name = file.replace(/\.json$/, ''); + if (!themes.find(theme => theme.name === name)) { + fs.unlinkSync(path.join(themeDirectory, file)); + } } }