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: 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(); } /// ------------------------------------------------------------------------------------