Skip to content
Myr

Handle incomplete ESC sequence in typeahead buffer (#1350)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

If an ESC char is found while processing characters, continue to check for characters. This prevents fzf from prematurely exiting. Close #1349

authored by Michael Kelley · committed by Junegunn Choi · parent 1c9e7b7 · Browse files · 1 file+6 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−1 removed

  • other:+6 added−1 removed

1 file+6 added−1 removed

modified:src/tui/light.go+6 added-1 removed
295 unmodified lines
296 retries = r.escDelay / escPollInterval297 }298 buffer = append(buffer, byte(c))299300 pc := c301 for {302 c, ok = r.getch(true)303 if !ok {304 if retries > 0 {
1 unmodified line
306 time.Sleep(escPollInterval * time.Millisecond)307 continue308 }309 break310 } else if c == ESC && pc != c {311 retries = r.escDelay / escPollInterval312 } else {313 retries = 0314 }310 retries = 0315 buffer = append(buffer, byte(c))316 pc = c317 }318319 return buffer320}
618 unmodified lines