chore: housekeeping — linter & formatter setup
Add .prettierrc.json, .markdownlint.json, .yamllint.yaml, .gitattributes Run CSharpier, Prettier and markdownlint across the entire codebase. No logic changes — formatting, using order and line endings only.
This commit is contained in:
+31
-16
@@ -35,9 +35,10 @@ internal sealed class StatusBar
|
||||
{
|
||||
// InvariantCulture: User-System-Locale darf das Format nicht
|
||||
// verändern (de_DE würde sonst "1,2k" statt "1.2k" liefern).
|
||||
var msgPart = messages >= 1000
|
||||
? string.Format(CultureInfo.InvariantCulture, "{0:0.0}k msg", messages / 1000.0)
|
||||
: $"{messages} msg";
|
||||
var msgPart =
|
||||
messages >= 1000
|
||||
? string.Format(CultureInfo.InvariantCulture, "{0:0.0}k msg", messages / 1000.0)
|
||||
: $"{messages} msg";
|
||||
var tabsPart = $"{tabs} {(tabs == 1 ? "tab" : "tabs")}";
|
||||
return $"{tabsPart} · {msgPart}";
|
||||
}
|
||||
@@ -48,7 +49,8 @@ internal sealed class StatusBar
|
||||
/// </summary>
|
||||
public static string FormatTells(int count)
|
||||
{
|
||||
if (count <= 0) return string.Empty;
|
||||
if (count <= 0)
|
||||
return string.Empty;
|
||||
return $"{count} {(count == 1 ? "tell" : "tells")}";
|
||||
}
|
||||
|
||||
@@ -56,11 +58,13 @@ internal sealed class StatusBar
|
||||
// helper so a future LINQ regression gets pinned by xUnit.
|
||||
internal static (int messages, int tells) AggregateForStatusBar(IList<Tab> tabs)
|
||||
{
|
||||
int messages = 0, tells = 0;
|
||||
int messages = 0,
|
||||
tells = 0;
|
||||
foreach (var t in tabs)
|
||||
{
|
||||
messages += t.Messages.Count;
|
||||
if (t.IsTempTab) tells++;
|
||||
if (t.IsTempTab)
|
||||
tells++;
|
||||
}
|
||||
return (messages, tells);
|
||||
}
|
||||
@@ -69,7 +73,12 @@ internal sealed class StatusBar
|
||||
/// Test-Hook: Cache-Logic ohne reale Time-Source verifizieren.
|
||||
/// Nicht für Production-Render.
|
||||
/// </summary>
|
||||
internal (string counts, string tells) SnapshotForTest(long now, int tabs, int messages, int tells)
|
||||
internal (string counts, string tells) SnapshotForTest(
|
||||
long now,
|
||||
int tabs,
|
||||
int messages,
|
||||
int tells
|
||||
)
|
||||
{
|
||||
UpdateCacheIfDue(now, tabs, messages, tells);
|
||||
return (_cachedCountsText, _cachedTellsText);
|
||||
@@ -105,11 +114,14 @@ internal sealed class StatusBar
|
||||
var cursorY = ImGui.GetCursorScreenPos().Y;
|
||||
var winLeft = ImGui.GetWindowPos().X;
|
||||
var winRight = winLeft + ImGui.GetWindowSize().X;
|
||||
ImGui.GetWindowDrawList().AddLine(
|
||||
new Vector2(winLeft, cursorY),
|
||||
new Vector2(winRight, cursorY),
|
||||
ColourUtil.RgbaToAbgr(theme.Colors.Border),
|
||||
1f);
|
||||
ImGui
|
||||
.GetWindowDrawList()
|
||||
.AddLine(
|
||||
new Vector2(winLeft, cursorY),
|
||||
new Vector2(winRight, cursorY),
|
||||
ColourUtil.RgbaToAbgr(theme.Colors.Border),
|
||||
1f
|
||||
);
|
||||
|
||||
ImGui.Dummy(new Vector2(0, 2)); // BorderTop-Spacing
|
||||
|
||||
@@ -169,10 +181,13 @@ internal sealed class StatusBar
|
||||
{
|
||||
var pos = ImGui.GetCursorScreenPos();
|
||||
const float radius = 4f;
|
||||
ImGui.GetWindowDrawList().AddCircleFilled(
|
||||
new Vector2(pos.X + radius, pos.Y + ImGui.GetTextLineHeight() / 2f),
|
||||
radius,
|
||||
ColourUtil.RgbaToAbgr(rgba));
|
||||
ImGui
|
||||
.GetWindowDrawList()
|
||||
.AddCircleFilled(
|
||||
new Vector2(pos.X + radius, pos.Y + ImGui.GetTextLineHeight() / 2f),
|
||||
radius,
|
||||
ColourUtil.RgbaToAbgr(rgba)
|
||||
);
|
||||
ImGui.Dummy(new Vector2(radius * 2 + 4, ImGui.GetTextLineHeight()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user