Commit Graph

233 Commits (22cbd9fa58512ffdcc975bab37a55467d5e10968)

Author SHA1 Message Date
Junegunn Choi 22cbd9fa58
Implement height range (--height ~[VALUE][%])
Close #2953
2 years ago
Junegunn Choi 38259d0382
Fix incorrect ordering of `--tiebreak=chunk` 2 years ago
Junegunn Choi f0bfeba733
Add new tiebreak: 'chunk'
Favors the line with shorter matched chunk. A chunk is a set of
consecutive non-whitespace characters.

Unlike the default `length`, this new scheme works well with tabular input.

  # length prefers item #1, because the whole line is shorter,
  # chunk prefers item #2, because the matched chunk ("foo") is shorter
  fzf --height=6 --header-lines=2 --tiebreak=chunk --reverse --query=fo << "EOF"
  N | Field1 | Field2 | Field3
  - | ------ | ------ | ------
  1 | hello  | foobar | baz
  2 | world  | foo    | bazbaz
  EOF

If the input does not contain any spaces, `chunk` is equivalent to
`length`. But we're not going to set it as the default because it is
computationally more expensive.

Close #2285
Close #2537
- Not the exact solution to --tiebreak=length not taking --nth into account,
  but this should work. And the added benefit is that it works well even
  when --nth is not provided.
- Adding a bonus point to the last character of a word didn't turn out great.
  The order of the result suddenly changes when you type in the last
  character in the word producing a jarring effect.
2 years ago
Junegunn Choi 52594355bf
[shell] 'kill' completion will now require trigger sequence (**)
'kill **<tab>' instead of 'kill <tab>' just like any other completions.

Close #2716
Close #385
2 years ago
Junegunn Choi d56f605b63
Add `rebind` action for restoring bindings after `unbind`
Fix #2752
Close #2564
2 years ago
Junegunn Choi 5209e95bc7
Make preview updated when reload and change-query are combined
Fix #2744
2 years ago
Junegunn Choi ef67a45702
Add --ellipsis=.. option
Close #2432

Also see
- #1769
- https://github.com/junegunn/fzf/pull/1844#issuecomment-586663660
2 years ago
Junegunn Choi 43f0d0cacd
change-preview-window to take multiple option sets separated by '|'
So you can "rotate" through the different options with a single binding.

  fzf --preview 'cat {}' \
      --bind 'ctrl-/:change-preview-window(70%|down,40%,border-horizontal|hidden|)'

Close #2376
2 years ago
Junegunn Choi 20b4e6953e
Implement change-preview and change-preview-window actions
The new actions are named with 'change-' prefix to differentiate from
the pre-existing, one-off 'preview(...)' action.

Fix #2360
Fix #2505
Fix #2666

Related #2435
Related #2376
  - Can set up multiple bindings with different change-preview-window actions
  - Not possible to "rotate" through the options with a single binding
  - Enlarge or shrink not possible
3 years ago
Junegunn Choi 7bff4661f6
Add --header-first option to display header before prompt line
Close #2422
3 years ago
Junegunn Choi 02cee2234d
Implement --scroll-off=LINES
Close #2533
3 years ago
Junegunn Choi 97ae8afb6f
Reload should update preview window
Fix #2644
3 years ago
Junegunn Choi 0f02fc0c77
Reset {n} after reload
Fix #2611
3 years ago
Junegunn Choi 347c4b2625
Add 'unbind' action
Fix #2486
3 years ago
Junegunn Choi 4c4c6e626e
Add support for preview window header
Fix #2373

  # Display top 3 lines as the fixed header
  fzf --preview 'bat --style=header,grid --color=always {}' --preview-window '~3'
3 years ago
Junegunn Choi 4c06da8b70
Fix GitHub Action build
$USER is missing
3 years ago
yoshida.shinya 9fe2393a00
Add test cases for killing input command on terminate (#2381 #2382) 3 years ago
bitterfox 4f9a7f8c87
Don't exit fzf by SIGINT while executing command (#2375)
Fix #2374

Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
3 years ago
Junegunn Choi 76bbf57b3d
Add select and deselect actions
Close #2358
3 years ago
Junegunn Choi f55c990e86
Add `close` action
Close #2331
3 years ago
Junegunn Choi c862af09f2
Fix toggle-preview-wrap action
Fix #2336
3 years ago
Junegunn Choi e922704f72
Migrate to GitHub Actions 3 years ago
Junegunn Choi d779ff7e6d
Make search toggleable
- `--phony` renamed to `--disabled` for consistency
    - `--no-phony` is now `--enabled`
- Added `enable-search`, `disable-search`, and `toggle-search` actions
  for `--bind`
- Added `--color` options: `query` and `disabled`

Close #2303
3 years ago
Junegunn Choi 408c04f25f
Update test case for 'first' and 'last' 3 years ago
Junegunn Choi 2ec382ae0e
Add --preview-window follow option 4 years ago
Junegunn Choi cbfee31593
Fix typo in test case 4 years ago
Junegunn Choi 6d647e13ff
Add change-prompt action
Close #2270
4 years ago
Junegunn Choi a4d9b0b468
Support ANSI escape sequence for clearing display in preview window
fzf --preview 'for i in $(seq 100000); do
    (( i % 200 == 0 )) && printf "\033[2J"
    echo "$i"
    sleep 0.01
  done'
4 years ago
Junegunn Choi e2b87e0d74
Fix Travis CI build 4 years ago
Junegunn Choi 2166b4ca17
Fix test cases
We were not properly waiting for truthy-ness in until blocks.

Need Minitest with 21d9e804b6
4 years ago
Junegunn Choi d2d4d68585
Always show the number of selected entries to indicate if --multi is enabled
Close #2217

  seq 100 | fzf
    # 100/100
  seq 100 | fzf --multi
    # 100/100 (0)
  seq 100 | fzf --multi 5
    # 100/100 (0/5)
4 years ago
Junegunn Choi 92b7efafca
Ignore punctuation characters before and after preview offset column
This is to allow line numbers in a ctags output (e.g. 123;")
4 years ago
Junegunn Choi f092e4038f
Smart match of accented characters
Fix #1618
4 years ago
Junegunn Choi 0f9cb5590e
Add preview window option for setting the initial scroll offset
Close #1057
Close #2120

  # Initial scroll offset is set to the line number of each line of
  # git grep output *minus* 5 lines
  git grep --line-number '' |
    fzf --delimiter : --preview 'nl {1}' --preview-window +{2}-5
4 years ago
Junegunn Choi 17dd833925
Add preview action for --bind
Fix #2010
Fix #1638
4 years ago
Junegunn Choi a7aa08ce07
Add backward-eof event for --bind 4 years ago
Jack Bates a6d3e3687b
Improve error messages (#1962)
* Add RuboCop Minitest extension
* Improve error messages
* Use chomp option
4 years ago
Jack Bates cf04753ad7
Make flaky tests reliable (#1978) 4 years ago
Junegunn Choi dea206b023
[zsh-completion] Fix error with backslash-prefixed commands
Fix #1973
Fix #1974
Fix #1975
4 years ago
Jack Bates 5deaf58928
Run rubocop --auto-correct --disable-uncorrectable (#1967)
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
4 years ago
Junegunn Choi 540bfd7a72 [fzf-tmux] Fall back to plain fzf when split failed 4 years ago
Junegunn Choi bf65e8cd12 [fzf-tmux] Add option to start fzf in tmux popup window
Requires latest tmux built from source (e.g. brew install tmux --HEAD)

Examples:

  # 50%/50% width and height on the center of the screen
  fzf-tmux -p

  # 80%/80%
  fzf-tmux -p80%

  # 80%/40%
  fzf-tmux -p80%,40%

  # Separate -w and -h
  fzf-tmux -w80% -h40%

  # 80%/40% at position (0, 0)
  fzf-tmux -w80% -h40% -x0 -y0

You can configure key bindings and fuzzy completion to open in tmux
popup window like so:

  FZF_TMUX_OPTS='-p 80%'
4 years ago
Junegunn Choi a5c2f28539
Fix failing test case 4 years ago
Junegunn Choi 18261fe31c
[shell] Update CTRL-R to remove duplicate commands
Close #1940
Related: #1363 #749 #270 #49 #88 #492 #600
4 years ago
Chitoku 079046863c
[zsh-completion] Fix a bug where _fzf_complete did not iterate through args (#1936) 4 years ago
Junegunn Choi 373c6d8d55
Add --keep-right option to keep the right end of the line visible
Close #1652
4 years ago
Junegunn Choi b8fc828955
Fix completion test 4 years ago
Junegunn Choi 50b7608f9d
Change custom fuzzy completion API
To make it easier to write more complex fzf options. Although this
does not break backward compatibility, users are encouraged to update
their code accordingly.

  # Before
  _fzf_complete "FZF_ARG1 FZF_ARG2..." "$@" < <(
    # Print candidates
  )

  # After
  _fzf_complete FZF_ARG1 FZF_ARG2... -- "$@" < <(
    # Print candidates
  )
4 years ago
Junegunn Choi 7c40a424c0
Add retries to CTRL-R tests to avoid intermittent errors on Travis CI
- https://travis-ci.org/junegunn/fzf/jobs/659496745#L676

Related #1900
4 years ago
Junegunn Choi 99f1e02766
Fix flaky test case
Make sure that the shell is ready before hitting CTRL-R

      1) Error:
    TestFish#test_ctrl_r_multiline:
    RuntimeError: timeout
        test/test_go.rb:50:in `wait'
        test/test_go.rb:125:in `until'
        test/test_go.rb:1857:in `test_ctrl_r_multiline'
4 years ago