From 09a95dc0b9292e5ef90b6e7a107cfd5e0fc47106 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 20 Feb 2026 10:45:34 -0500 Subject: [PATCH 1/2] Fix LT-21845: Find/Replace in Texts doesn't honor match WS initially --- Src/FwCoreDlgs/FwFindReplaceDlg.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Src/FwCoreDlgs/FwFindReplaceDlg.cs b/Src/FwCoreDlgs/FwFindReplaceDlg.cs index e5f214150f..c0f31b4f87 100644 --- a/Src/FwCoreDlgs/FwFindReplaceDlg.cs +++ b/Src/FwCoreDlgs/FwFindReplaceDlg.cs @@ -2643,11 +2643,12 @@ public void ApplyWS(FwTextBox fwTextBox, int hvoWs) { CheckDisposed(); + // Select the text before applying WS (LT-21845). + fwTextBox.Select(); fwTextBox.ApplyWS(hvoWs); if (chkMatchWS.Enabled) chkMatchWS.Checked = true; SetFormatLabels(); - fwTextBox.Select(); } /// ------------------------------------------------------------------------------------ From 00645f6400a4139e0d180f8a192589a058e70634 Mon Sep 17 00:00:00 2001 From: John Lambert Date: Fri, 20 Feb 2026 14:19:48 -0500 Subject: [PATCH 2/2] Fix AGENTS.md frontmatter parsing failing on UTF-8 BOM All 31 Src/*/AGENTS.md files have a UTF-8 BOM (0xEF 0xBB 0xBF). The parse_frontmatter functions in four .github/*.py scripts read with encoding="utf-8", which preserves the BOM as a U+FEFF prefix on line 0, causing the "---" delimiter check to fail. This made every impacted folder report "frontmatter missing" in CI. Fix: switch file reads to utf-8-sig (strips BOM automatically) and add explicit BOM stripping in text-based parsers as defense in depth. Also update Src/FwCoreDlgs/AGENTS.md last-reviewed-tree hash to match the current code on this branch. --- .github/check_copilot_docs.py | 5 ++++- .github/detect_copilot_needed.py | 2 +- .github/plan_copilot_updates.py | 2 +- .github/scaffold_copilot_markdown.py | 5 ++++- Src/FwCoreDlgs/AGENTS.md | 4 ++-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/check_copilot_docs.py b/.github/check_copilot_docs.py index 37709b3721..83e93f78f4 100644 --- a/.github/check_copilot_docs.py +++ b/.github/check_copilot_docs.py @@ -133,6 +133,9 @@ def index_repo_files(root: Path): def parse_frontmatter(text: str): + # Strip UTF-8 BOM if present + if text.startswith("\ufeff"): + text = text[1:] lines = text.splitlines() fm = {} if len(lines) >= 3 and lines[0].strip() == "---": @@ -222,7 +225,7 @@ def validate_file(path: Path, repo_index: dict, verbose=False): "current_tree": "", "ok": True, } - text = path.read_text(encoding="utf-8", errors="replace") + text = path.read_text(encoding="utf-8-sig", errors="replace") fm, body = parse_frontmatter(text) if not fm: result["frontmatter"]["missing"] = [ diff --git a/.github/detect_copilot_needed.py b/.github/detect_copilot_needed.py index 1ed1849827..14435a04ce 100644 --- a/.github/detect_copilot_needed.py +++ b/.github/detect_copilot_needed.py @@ -90,7 +90,7 @@ def top_level_src_folder(path: str): def parse_frontmatter(path: Path) -> Tuple[Optional[Dict[str, str]], str]: if not path.exists(): return None, "" - text = path.read_text(encoding="utf-8", errors="replace") + text = path.read_text(encoding="utf-8-sig", errors="replace") lines = text.splitlines() if len(lines) >= 3 and lines[0].strip() == "---": end_idx = -1 diff --git a/.github/plan_copilot_updates.py b/.github/plan_copilot_updates.py index bbd8c429de..f7300a87d9 100644 --- a/.github/plan_copilot_updates.py +++ b/.github/plan_copilot_updates.py @@ -63,7 +63,7 @@ def run_git(cmd: Sequence[str], cwd: Path) -> str: def parse_frontmatter(path: Path) -> Tuple[Optional[Dict[str, str]], str]: if not path.exists(): return None, "" - text = path.read_text(encoding="utf-8", errors="replace") + text = path.read_text(encoding="utf-8-sig", errors="replace") lines = text.splitlines() if len(lines) < 3 or lines[0].strip() != "---": return None, text diff --git a/.github/scaffold_copilot_markdown.py b/.github/scaffold_copilot_markdown.py index d3f9356635..9c98a774fd 100644 --- a/.github/scaffold_copilot_markdown.py +++ b/.github/scaffold_copilot_markdown.py @@ -87,6 +87,9 @@ def top_level_src_folder(path: str) -> Optional[str]: def parse_frontmatter(text: str) -> Tuple[Optional[Dict[str, str]], str]: + # Strip UTF-8 BOM if present + if text.startswith("\ufeff"): + text = text[1:] lines = text.splitlines() if len(lines) >= 3 and lines[0].strip() == "---": end_idx = -1 @@ -230,7 +233,7 @@ def ensure_copilot_doc( ) -> Tuple[str, Optional[str]]: copath = folder / "AGENTS.md" if copath.exists(): - original = copath.read_text(encoding="utf-8", errors="replace") + original = copath.read_text(encoding="utf-8-sig", errors="replace") else: original = "" try: diff --git a/Src/FwCoreDlgs/AGENTS.md b/Src/FwCoreDlgs/AGENTS.md index 4d053ec85e..68d63afadc 100644 --- a/Src/FwCoreDlgs/AGENTS.md +++ b/Src/FwCoreDlgs/AGENTS.md @@ -1,6 +1,6 @@ --- -last-reviewed: 2025-10-31 -last-reviewed-tree: 686f899291d7c6b63b4532a7d7d32a41b409d3198444a91f4ba68020df7a99ac +last-reviewed: 2026-02-20 +last-reviewed-tree: c84b4a50fb902fe4b7c3d7cb91e9d38297e7bd079b969d9400080c016ebf0078 status: draft --- anchors: