Skip to content
Myr

Proper handling of typeahead arrow keys

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

To reproduce: `sleep 2; fzf` and press arrow keys

authored by Junegunn Choi · committed by Junegunn Choi · parent 96215c4 · Browse files · 1 file+16 added−7 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+16 added−7 removed

  • other:+16 added−7 removed

1 file+16 added−7 removed

modified:fzf+16 added-7 removed
140 unmodified lines
141142 def start143 $stdout.reopen($stderr)144145 render { init_screen }145 init_screen146 start_reader147 start_renderer148 start_search149 start_loop
380 unmodified lines
530 0531 end | (bold ? C::A_BOLD : 0)532 end533 end534535 C.refresh536 end537538 def start_reader539 stream =
280 unmodified lines
820 end821 end822 when 27823 C.stdscr.timeout = 0822 ch =824 ch = # Typeahead arrow keys825 case ch2 = C.getch824 when 'b' then :alt_b825 when 'f' then :alt_f826 when nil then :esc827 else828 ch2826 when '[', 91827 case ch3 = C.getch828 when 'D', 68 then ctrl(:b)829 when 'C', 67 then ctrl(:f)830 when 'B', 66 then ctrl(:j)831 when 'A', 65 then ctrl(:k)832 else ch3833 end834 when 'b', 98 then :alt_b835 when 'f', 102 then :alt_f836 when nil then :esc837 else ch2838 end839 end840841 upd = actions.fetch(ch, proc { |ch|
160 unmodified lines