Fix slop remains (#4640)

* Fix slop remains

Chris likes to vibe code. AI likes to use different types of dashes (em-dashes, en-dashes), instead of regular dashes (-).

On PowerShell 7 this appears to work. The parser doesn't care. But, what about PowerShell 5? It begins throwing errors about the ampersand. Loading it in the ISE reveals how it stops parsing the syntax correctly when it encounters em-dashes. Rather than displaying them as such, the ISE displays them as —.

Chris, if you want to vibe code, I don't mind. But at least use regular dashes.

Anyway, I won't fix the AI code. I just want to make it work on my beloved powershell 5.

* Apparently this file is important
This commit is contained in:
CodingWonders
2026-06-08 16:43:04 +02:00
committed by GitHub
parent 9fdf944ef9
commit 297b3079e5
4 changed files with 29 additions and 29 deletions
@@ -23,9 +23,9 @@ function Find-TweaksByNameOrDescription {
[string]$SearchString = ""
)
# ──────────────────────────────────────────────────────────────────────────────
# ------------------------------------------------------------------------------
# 1. RESOLVE $SYNC WITH MULTI-LEVEL FALLBACK
# ──────────────────────────────────────────────────────────────────────────────
# ------------------------------------------------------------------------------
if ($null -eq $Sync) {
$Sync = $global:sync
@@ -45,9 +45,9 @@ function Find-TweaksByNameOrDescription {
return
}
# ──────────────────────────────────────────────────────────────────────────────
# ------------------------------------------------------------------------------
# 2. GET REFERENCE TO TWEAKS PANEL
# ──────────────────────────────────────────────────────────────────────────────
# ------------------------------------------------------------------------------
$tweaksPanel = $null
try {
@@ -63,9 +63,9 @@ function Find-TweaksByNameOrDescription {
return
}
# ──────────────────────────────────────────────────────────────────────────────
# ------------------------------------------------------------------------------
# 3. HANDLE EMPTY/WHITESPACE SEARCH STRING - RESET TO DEFAULT STATE
# ──────────────────────────────────────────────────────────────────────────────
# ------------------------------------------------------------------------------
if ([string]::IsNullOrWhiteSpace($SearchString)) {
try {
@@ -114,9 +114,9 @@ function Find-TweaksByNameOrDescription {
return
}
# ──────────────────────────────────────────────────────────────────────────────
# ------------------------------------------------------------------------------
# 4. PERFORM LITERAL SEARCH (NO WILDCARD EXPANSION)
# ──────────────────────────────────────────────────────────────────────────────
# ------------------------------------------------------------------------------
try {
# Normalize search term once for the entire operation
@@ -151,9 +151,9 @@ function Find-TweaksByNameOrDescription {
continue
}
# ────────────────────────────────────────────────────────────
# ------------------------------------------------------------
# Check if this is a category label (usually first Label)
# ────────────────────────────────────────────────────────────
# ------------------------------------------------------------
if ($item -is [Windows.Controls.Label]) {
$categoryLabel = $item
@@ -161,9 +161,9 @@ function Find-TweaksByNameOrDescription {
$item.Visibility = [Windows.Visibility]::Collapsed
}
# ────────────────────────────────────────────────────────────
# ------------------------------------------------------------
# Check if this is a DockPanel containing a tweak checkbox
# ────────────────────────────────────────────────────────────
# ------------------------------------------------------------
elseif ($item -is [Windows.Controls.DockPanel]) {
$checkbox = $null
@@ -211,9 +211,9 @@ function Find-TweaksByNameOrDescription {
}
}
# ────────────────────────────────────────────────────────────
# ------------------------------------------------------------
# Check if this is a StackPanel containing a tweak checkbox
# ────────────────────────────────────────────────────────────
# ------------------------------------------------------------
elseif ($item -is [Windows.Controls.StackPanel]) {
$checkbox = $null
@@ -257,9 +257,9 @@ function Find-TweaksByNameOrDescription {
}
}
# ────────────────────────────────────────────────────────────
# ------------------------------------------------------------
# Update category label visibility and expanded/collapsed state
# ────────────────────────────────────────────────────────────
# ------------------------------------------------------------
if ($categoryHasMatch) {
# Show category label
@@ -282,9 +282,9 @@ function Find-TweaksByNameOrDescription {
}
}
# ────────────────────────────────────────────────────────────────
# ----------------------------------------------------------------
# Set category border visibility based on whether it has matches
# ────────────────────────────────────────────────────────────────
# ----------------------------------------------------------------
if ($categoryHasMatch) {
$categoryBorder.Visibility = [Windows.Visibility]::Visible