mirror of
https://github.com/openai/codex.git
synced 2026-11-26 23:40:43 +00:00
Fix Unicode highlighting in fuzzy file search (#64214)
## Why The fuzzy matcher reports grapheme positions, but the terminal file picker uses Unicode scalar offsets. When a path contains a joined emoji or a combining mark, the picker can highlight the wrong characters. ## What changed Let callers choose the unit for match indices. The terminal and CLI use scalar offsets that cover every scalar in each matched grapheme. The terminal's file picker and mention renderer now consume the same offsets. The app server returns grapheme offsets for both one-shot and streaming searches. ## Testing Add regression coverage for basename and full-path matches with joined emoji and combining marks, grapheme offsets in both app-server search modes, and terminal highlights in file and mention results. GitOrigin-RevId: 2da357a404396550333c785640d2c4121cb2ed3f
This commit is contained in:
@@ -45,7 +45,7 @@ pub(crate) async fn run_fuzzy_file_search(
|
||||
file_search::FileSearchOptions {
|
||||
limit,
|
||||
threads,
|
||||
compute_indices: true,
|
||||
index_unit: Some(file_search::IndexUnit::Grapheme),
|
||||
..Default::default()
|
||||
},
|
||||
Some(cancellation_flag),
|
||||
@@ -147,7 +147,7 @@ pub(crate) fn start_fuzzy_file_search_session(
|
||||
file_search::FileSearchOptions {
|
||||
limit,
|
||||
threads,
|
||||
compute_indices: true,
|
||||
index_unit: Some(file_search::IndexUnit::Grapheme),
|
||||
..Default::default()
|
||||
},
|
||||
reporter,
|
||||
|
||||
Reference in New Issue
Block a user