mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-15 17:57:07 +00:00
parent
9bd8b1d25f
commit
9078688baf
@ -531,6 +531,8 @@ func parseKeymap(keymap map[int]actionType, execmap map[int]string, str string)
|
|||||||
keymap[key] = actAbort
|
keymap[key] = actAbort
|
||||||
case "accept":
|
case "accept":
|
||||||
keymap[key] = actAccept
|
keymap[key] = actAccept
|
||||||
|
case "print-query":
|
||||||
|
keymap[key] = actPrintQuery
|
||||||
case "backward-char":
|
case "backward-char":
|
||||||
keymap[key] = actBackwardChar
|
keymap[key] = actBackwardChar
|
||||||
case "backward-delete-char":
|
case "backward-delete-char":
|
||||||
|
@ -91,6 +91,7 @@ const (
|
|||||||
reqRefresh
|
reqRefresh
|
||||||
reqRedraw
|
reqRedraw
|
||||||
reqClose
|
reqClose
|
||||||
|
reqPrintQuery
|
||||||
reqQuit
|
reqQuit
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -132,6 +133,7 @@ const (
|
|||||||
actUp
|
actUp
|
||||||
actPageUp
|
actPageUp
|
||||||
actPageDown
|
actPageDown
|
||||||
|
actPrintQuery
|
||||||
actToggleSort
|
actToggleSort
|
||||||
actPreviousHistory
|
actPreviousHistory
|
||||||
actNextHistory
|
actNextHistory
|
||||||
@ -819,6 +821,10 @@ func (t *Terminal) Loop() {
|
|||||||
exit(exitOk)
|
exit(exitOk)
|
||||||
}
|
}
|
||||||
exit(exitNoMatch)
|
exit(exitNoMatch)
|
||||||
|
case reqPrintQuery:
|
||||||
|
C.Close()
|
||||||
|
fmt.Println(string(t.input))
|
||||||
|
exit(exitOk)
|
||||||
case reqQuit:
|
case reqQuit:
|
||||||
C.Close()
|
C.Close()
|
||||||
exit(exitInterrupt)
|
exit(exitInterrupt)
|
||||||
@ -906,6 +912,8 @@ func (t *Terminal) Loop() {
|
|||||||
if t.cx > 0 {
|
if t.cx > 0 {
|
||||||
t.cx--
|
t.cx--
|
||||||
}
|
}
|
||||||
|
case actPrintQuery:
|
||||||
|
req(reqPrintQuery)
|
||||||
case actAbort:
|
case actAbort:
|
||||||
req(reqQuit)
|
req(reqQuit)
|
||||||
case actDeleteChar:
|
case actDeleteChar:
|
||||||
|
@ -771,6 +771,13 @@ class TestGoFZF < TestBase
|
|||||||
assert_equal %w[4 5 6 9], readonce.split($/)
|
assert_equal %w[4 5 6 9], readonce.split($/)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_bind_print_query
|
||||||
|
tmux.send_keys "seq 1 1000 | #{fzf '-m --bind=ctrl-j:print-query'}", :Enter
|
||||||
|
tmux.until { |lines| lines[-2].end_with? '/1000' }
|
||||||
|
tmux.send_keys 'print-my-query', 'C-j'
|
||||||
|
assert_equal %w[print-my-query], readonce.split($/)
|
||||||
|
end
|
||||||
|
|
||||||
def test_long_line
|
def test_long_line
|
||||||
data = '.' * 256 * 1024
|
data = '.' * 256 * 1024
|
||||||
File.open(tempname, 'w') do |f|
|
File.open(tempname, 'w') do |f|
|
||||||
|
Loading…
Reference in New Issue
Block a user