chore: reformat after editorconfig update
Security / scan (push) Successful in 12s

Updated .editorconfig to set indent_style=space and indent_size=4 for C# files. Reformat all .cs files to apply the new indentation settings. No code logic changes, just whitespace reformatting.
also updated some comments in files in shorter and Precise way. No logic changes, just comment rewording for clarity and conciseness.
This commit is contained in:
2026-05-10 19:54:39 +02:00
parent 3cabdf3e15
commit 4000bbd199
23 changed files with 203 additions and 800 deletions
+7 -10
View File
@@ -29,7 +29,7 @@ public sealed class ThemeRegistry
{ SynthwaveSunset.Slug, SynthwaveSunset.Build() },
};
// Centralised so the ten .Build() factories stay free of cache plumbing.
// Centralised so Build() factories stay free of cache plumbing.
foreach (var theme in _builtIns.Values)
theme.RecomputeAbgrCache();
@@ -58,14 +58,13 @@ public sealed class ThemeRegistry
public void Switch(string slug)
{
var theme = Get(slug);
// Defensive — idempotent and cheap, so any future theme source
// that forgets the cache fill still ends up with a populated one.
// Defensive — ensures any future theme source always gets a populated cache.
theme.RecomputeAbgrCache();
_active = theme;
}
// 0x80070020 = SHARING_VIOLATION, 0x80070021 = LOCK_VIOLATION. Other
// IO failures are permanent and get the theme dropped instead of retried.
// 0x80070020 = SHARING_VIOLATION, 0x80070021 = LOCK_VIOLATION.
// Other IO failures are permanent theme is dropped instead of retried.
internal static bool IsRecoverableFileLock(Exception? ex)
{
if (ex is not IOException io)
@@ -74,9 +73,8 @@ public sealed class ThemeRegistry
return code == 0x80070020u || code == 0x80070021u;
}
// Custom-Themes werden lazy aus dem Verzeichnis geladen, Cache mit
// LastWriteTime-Token. Eine geänderte JSON wird beim nächsten Lookup
// neu eingelesen.
// Custom themes are loaded lazily, cached by LastWriteTime.
// A changed JSON is reloaded on the next lookup.
private Theme? LoadCustomBySlug(string slug)
{
if (_customThemesDir is null)
@@ -115,8 +113,7 @@ public sealed class ThemeRegistry
}
catch (Exception ex) when (IsRecoverableFileLock(ex))
{
// Editor mid-save: keep the cached snapshot, leave the stamp
// alone so the next refresh retries automatically.
// Editor mid-save: keep last known good, retry on next refresh.
Plugin.Log.Debug(
$"Custom theme {Path.GetFileName(path)} is locked, keeping last known good"
);