mirror of
https://github.com/openai/codex.git
synced 2026-05-04 11:26:33 +00:00
Fix IME submissions dropping leading digits (#4359)
- ensure paste burst flush preserves ASCII characters before IME commits - add regression test covering digit followed by Japanese text submission Fixes openai/codex#4356 Co-authored-by: Josh McKinney <joshka@openai.com>
This commit is contained in:
@@ -198,12 +198,15 @@ impl PasteBurst {
|
||||
|
||||
/// Before applying modified/non-char input: flush buffered burst immediately.
|
||||
pub fn flush_before_modified_input(&mut self) -> Option<String> {
|
||||
if self.is_active() {
|
||||
self.active = false;
|
||||
Some(std::mem::take(&mut self.buffer))
|
||||
} else {
|
||||
None
|
||||
if !self.is_active() {
|
||||
return None;
|
||||
}
|
||||
self.active = false;
|
||||
let mut out = std::mem::take(&mut self.buffer);
|
||||
if let Some((ch, _at)) = self.pending_first_char.take() {
|
||||
out.push(ch);
|
||||
}
|
||||
Some(out)
|
||||
}
|
||||
|
||||
/// Clear only the timing window and any pending first-char.
|
||||
|
||||
Reference in New Issue
Block a user