fix(desktop): prevent fast correction input races

This commit is contained in:
Yun Chan 2026-11-04 07:06:10 +09:00
parent 5ec063c744
commit 21a684d572
12 changed files with 134 additions and 18 deletions

View file

@ -823,9 +823,8 @@ class InputTelemetryService extends EventEmitter {
}
private _scheduleTextSnapshot(keyClass?: KeyStrokeClass): void {
// Araso 급 빠른 한영 전환: 공백·문장부호 직후에는 40ms 뒤에 즉시 스냅샷을 찍고,
// 일반 글자 입력 중에는 단어를 치는 도중(예: sometime 의 some 시점) 끼어들어 글자를 삼키지 않도록
// 700ms 디바운스 타이머(_textTimer)에 맡긴다(Vim 명령줄 :wq 등은 160ms).
// 공백·문장부호 뒤의 한영 전환은 140ms 동안 다음 키가 없을 때만 시작한다.
// 더 빠른 연속 입력 중에는 삭제 배치와 다음 키가 섞일 수 있으므로 유휴 스냅샷에서 묶어서 교정한다.
if (this._typoTimer) clearTimeout(this._typoTimer)
if (keyClass && TYPING_KEY_CLASSES.has(keyClass) && configGet('typoAutoCorrectEnabled') !== false) {
const isBoundaryKey =
@ -834,7 +833,7 @@ class InputTelemetryService extends EventEmitter {
(keyClass === 'digit' && this._modifiers.shift)
const quickDelay =
isBoundaryKey && this._shouldRunFastTerminalBoundarySnapshot()
? 40
? 140
: !isBoundaryKey && this._terminalTracker.vimMode === 'command'
? 160
: null