Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

fix: `apply_patch` unicode characters (#625)

Misha Davidovacc4acc81eea
diff --git a/codex-cli/src/utils/agent/apply-patch.ts b/codex-cli/src/utils/agent/apply-patch.ts
index fe1dc76b85..c78bfdf7cb 100644
--- a/codex-cli/src/utils/agent/apply-patch.ts
+++ b/codex-cli/src/utils/agent/apply-patch.ts
@@ -238,6 +238,8 @@ class Parser {
"\u2018": "'",
"\u2019": "'",
"\u201B": "'",
+ "\u00A0": " ",
+ "\u202F": " ",
} as Record<string, string>
)[c] ?? c),
);
@@ -373,6 +375,9 @@ function find_context_core(
/* U+2018 LEFT SINGLE QUOTATION MARK */ "\u2018": "'",
/* U+2019 RIGHT SINGLE QUOTATION MARK */ "\u2019": "'",
/* U+201B SINGLE HIGH-REVERSED-9 QUOTATION MARK */ "\u201B": "'",
+ // Spaces ------------------------------------------------------------------
+ /* U+00A0 NO-BREAK SPACE */ "\u00A0": " ",
+ /* U+202F NARROW NO-BREAK SPACE */ "\u202F": " ",
};
const canon = (s: string): string =>