Home/End/PgUp/PgDn/Del/(Ins)

This commit is contained in:
Junegunn Choi 2014-03-08 00:57:53 +09:00
parent 457a240457
commit 19e24bd644

11
fzf
View File

@ -7,7 +7,7 @@
# / __/ / /_/ __/ # / __/ / /_/ __/
# /_/ /___/_/ Fuzzy finder for your shell # /_/ /___/_/ Fuzzy finder for your shell
# #
# Version: 0.8.0 (March 7, 2014) # Version: 0.8.0 (March 8, 2014)
# #
# Author: Junegunn Choi # Author: Junegunn Choi
# URL: https://github.com/junegunn/fzf # URL: https://github.com/junegunn/fzf
@ -816,6 +816,12 @@ class FZF
when 66 then ctrl(:j) when 66 then ctrl(:j)
when 65 then ctrl(:k) when 65 then ctrl(:k)
when 90 then :stab when 90 then :stab
when 49 then read_nb(1); ctrl(:a)
when 50 then read_nb(1); :ins
when 51 then read_nb(1); :del
when 52 then read_nb(1); ctrl(:e)
when 53 then read_nb(1); :pgup
when 54 then read_nb(1); :pgdn
when 77 when 77
get_mouse get_mouse
end end
@ -912,6 +918,9 @@ class FZF
ctrl(:b) => proc { cursor = [0, cursor - 1].max; nil }, ctrl(:b) => proc { cursor = [0, cursor - 1].max; nil },
ctrl(:f) => proc { cursor = [input.length, cursor + 1].min; nil }, ctrl(:f) => proc { cursor = [input.length, cursor + 1].min; nil },
ctrl(:l) => proc { render { C.clear; C.refresh }; update_list true }, ctrl(:l) => proc { render { C.clear; C.refresh }; update_list true },
:del => proc { input[cursor] = '' if input.length > cursor },
:pgup => proc { vselect { |_| max_items } },
:pgdn => proc { vselect { |_| 0 } },
:alt_b => proc { backword.call; nil }, :alt_b => proc { backword.call; nil },
:alt_f => proc { :alt_f => proc {
cursor += (input[cursor..-1].index(/(\S\s)|(.$)/) || -1) + 1 cursor += (input[cursor..-1].index(/(\S\s)|(.$)/) || -1) + 1