Skip to content
Myr

Fix #172 - Print empty line when fzf with expect finished by -1 or -0

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

authored by Junegunn Choi · committed by Junegunn Choi · parent 39d7177 · Browse files · 2 files+8 added−0 removed
This commit

State

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

Diff stats

2 files+8 added−0 removed

  • tests:+5 added−0 removed
  • other:+3 added−0 removed

2 files+8 added−0 removed

modified:src/core.go+3 added
214 unmodified lines
215 if opts.Exit0 && count == 0 || opts.Select1 && count == 1 {216 if opts.PrintQuery {217 fmt.Println(opts.Query)218 }219 if len(opts.Expect) > 0 {220 fmt.Println()221 }222 for i := 0; i < count; i++ {223 fmt.Println(val.Get(i).AsString())224 }225 os.Exit(0)
18 unmodified lines
modified:test/test_go.rb+5 added
450 unmodified lines
451 tmux.send_keys '55'452 tmux.send_keys :Escape, :z453 assert_equal ['55', 'alt-z', '55'], readonce.split($/)454 end455456 def test_expect_print_query_select_1457 tmux.send_keys "seq 1 100 | #{fzf '-q55 -1 --expect=alt-z --print-query'}", :Enter458 assert_equal ['55', '', '55'], readonce.split($/)459 end460end461462module TestShell463 def setup
148 unmodified lines