Skip to content
Myr

Stop processing more actions after a terminal action (accept, abort, etc.)

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 7d0ea59 · Browse files · 2 files+9 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+9 added−0 removed

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

2 files+9 added−0 removed

modified:src/terminal.go+4 added
4829 unmodified lines
4830 for _, action := range actions {4831 if !doAction(action) {4832 return false4833 }4834 // A terminal action performed. We should stop processing more.4835 if !looping {4836 break4837 }4838 }48394840 if onFocus, prs := t.keymap[tui.Focus.AsEvent()]; prs && iter < maxFocusEvents {4841 if newIndex := t.currentIndex(); newIndex != currentIndex {
1387 unmodified lines
modified:test/test_filter.rb+5 added
297 unmodified lines
298 result = `printf -- 'xxx\n-xx\nxx-\n_x_\n_x-\n-x_\n[x]\n-x-\n x \n/x/\n' | #{FZF} -f"'x'" --scheme=#{scheme}`.lines(chomp: true)299 assert_equal expected, result300 end301 end302303 def test_abort_action_chain304 assert_equal '1', `seq 100 | #{FZF} --bind 'load:accept+up+up'`.chomp305 assert_equal '', `seq 100 | #{FZF} --bind 'load:abort+become(echo {})'`.chomp306 end307end