Skip to content
Myr

Add `close` action

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

Close #2331

authored by Junegunn Choi · committed by Junegunn Choi · parent d110372 · Browse files · 6 files+30 added−2 removed
This commit

State

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

Diff stats

6 files+30 added−2 removed

  • tests:+13 added−0 removed
  • other:+17 added−2 removed

6 files+30 added−2 removed

modified:man/man1/fzf-tmux.1+1 added-1 removed
19 unmodified lines
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN22THE SOFTWARE.23..24.TH fzf-tmux 1 "Jan 2021" "fzf 0.25.0" "fzf-tmux - open fzf in tmux split pane"24.TH fzf-tmux 1 "Feb 2021" "fzf 0.25.1" "fzf-tmux - open fzf in tmux split pane"2526.SH NAME27fzf-tmux - open fzf in tmux split pane28
40 unmodified lines
modified:man/man1/fzf.1+2 added-1 removed
19 unmodified lines
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN22THE SOFTWARE.23..24.TH fzf 1 "Jan 2021" "fzf 0.25.0" "fzf - a command-line fuzzy finder"24.TH fzf 1 "Feb 2021" "fzf 0.25.1" "fzf - a command-line fuzzy finder"2526.SH NAME27fzf - a command-line fuzzy finder28
750 unmodified lines
779 \fBcancel\fR (clear query string if not empty, abort fzf otherwise)780 \fBchange-prompt(...)\fR (change prompt to the given string)781 \fBclear-screen\fR \fIctrl-l\fR782 \fBclear-selection\fR (clear multi-selection)783 \fBclose\fR (close preview window if open, abort fzf otherwise)784 \fBclear-query\fR (clear query string)785 \fBdelete-char\fR \fIdel\fR786 \fBdelete-char/eof\fR \fIctrl-d\fR (same as \fBdelete-char\fR except aborts fzf if query is empty)787 \fBdeselect-all\fR (deselect all matches)
167 unmodified lines
modified:src/options.go+2 added
881 unmodified lines
882 case "select-all":883 appendAction(actSelectAll)884 case "deselect-all":885 appendAction(actDeselectAll)886 case "close":887 appendAction(actClose)888 case "toggle":889 appendAction(actToggle)890 case "down":891 appendAction(actDown)
710 unmodified lines
modified:src/terminal.go+7 added
219 unmodified lines
220 actChangePrompt221 actClearScreen222 actClearQuery223 actClearSelection224 actClose225 actDeleteChar226 actDeleteCharEOF227 actEndOfLine228 actForwardChar
2105 unmodified lines
2334 t.deselectItem(t.merger.Get(i).item)2335 }2336 req(reqList, reqInfo)2337 }2338 case actClose:2339 if t.isPreviewEnabled() {2340 togglePreview(false)2341 } else {2342 req(reqQuit)2343 }2344 case actToggle:2345 if t.multi > 0 && t.merger.Length() > 0 && toggle() {2346 req(reqList)2347 }
340 unmodified lines
modified:test/test_go.rb+13 added
1875 unmodified lines
1876 end1877 tmux.send_keys 'C-w'1878 end1879 end18801881 def test_close1882 tmux.send_keys "seq 100 | #{FZF} --preview 'echo foo' --bind ctrl-c:close", :Enter1883 tmux.until { |lines| assert_equal 100, lines.match_count }1884 tmux.until { |lines| assert_includes lines[1], 'foo' }1885 tmux.send_keys 'C-c'1886 tmux.until { |lines| refute_includes lines[1], 'foo' }1887 tmux.send_keys '10'1888 tmux.until { |lines| assert_equal 2, lines.match_count }1889 tmux.send_keys 'C-c'1890 tmux.send_keys 'C-l', 'closed'1891 tmux.until { |lines| assert_includes lines[0], 'closed' }1892 end1893end18941895module TestShell1896 def setup
478 unmodified lines
modified:CHANGELOG.md+5 added
1CHANGELOG2=========340.25.15------6- Added `close` action7 - Close preview window if open, abort fzf otherwise890.25.010------11- Text attributes set in `--color` are not reset when fzf sees another12 `--color` option for the same element. This allows you to put custom text
1069 unmodified lines