Commit Graph

1930 Commits

Author SHA1 Message Date
Slaven Rezić e6d33f77da
[zsh] Make CTRL-R work with older Perls (#2003)
s///r is only available since perl 5.14. The Perl oneliner
was changed to work with older Perls, possibly even with 5.000.

Fix #2001
2020-04-24 22:56:55 +09:00
Jack Bates a6d3e3687b
Improve error messages (#1962)
* Add RuboCop Minitest extension
* Improve error messages
* Use chomp option
2020-04-21 10:12:00 +09:00
Raffaele 08c2bcb952
Quote LDFLAGS (#1995)
Make sure that `extldflags` is quoted so that LDFLAGS containing spaces won't break the build command.

Close #1994
2020-04-21 10:07:39 +09:00
Junegunn Choi 98ca4bdede
Add conda installation instruction
Close #1949
2020-04-18 13:00:38 +09:00
Janek 3f8e741562
Add more details on apt installation in README.md (#1977) 2020-04-18 12:59:32 +09:00
Junegunn Choi 6e464ebd9b
Remove dead code 2020-04-18 02:51:02 +09:00
Junegunn Choi c329279339
[completion] Make kill completion more consistent with the others
Support both ordinary completion trigger and empty trigger

    kill <tab>
    kill foo**<tab>

Close #1988
Close #385
2020-04-18 02:46:40 +09:00
Jack Bates cf04753ad7
Make flaky tests reliable (#1978) 2020-04-18 02:34:38 +09:00
Junegunn Choi 69e7eab11f
[install] Clarify that .bashrc should be loaded from .bash_profile on macOS
Close #1986
2020-04-17 21:51:16 +09:00
Junegunn Choi dea206b023
[zsh-completion] Fix error with backslash-prefixed commands
Fix #1973
Fix #1974
Fix #1975
2020-04-13 00:30:43 +09:00
Jack Bates 5deaf58928
Run rubocop --auto-correct --disable-uncorrectable (#1967)
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2020-04-13 00:23:31 +09:00
Junegunn Choi 15e2952a2b
[fzf-tmux] Allow positional flags
Since we don't know in advance which flags tmux will support, simply
allow a single uppercase character ([A-Z]) for now.

    fzf-tmux -xR -yS
    fzf-tmux -x R -y S

Fix #1956
2020-04-07 09:55:48 +09:00
Junegunn Choi a9fba1c849
Fix typo 2020-04-05 18:36:31 +09:00
Junegunn Choi 71e573d082
[vim] Add 'tmux' layout option to use fzf-tmux
e.g.

  if exists('$TMUX')
    let g:fzf_layout = { 'tmux': '-p90%,60%' }
  else
    let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } }
  endif
2020-04-05 18:16:36 +09:00
Junegunn Choi 334a4fa159
0.21.1 2020-04-03 17:33:29 +09:00
Junegunn Choi 21f94ee800 [fzf-tmux] Split zsh variable expansion for old zsh
The following code works in zsh 5.8 but not in 5.4

  ${(Q)${(Z+n+)FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}}}
2020-04-03 13:23:15 +09:00
Junegunn Choi 540bfd7a72 [fzf-tmux] Fall back to plain fzf when split failed 2020-04-03 13:23:15 +09:00
Junegunn Choi 8fbed2b13a [fzf-tmux] Use $PWD instead of #{pane_current_path}
Related: https://github.com/tmux/tmux/issues/1282
2020-04-03 13:23:15 +09:00
Junegunn Choi aa17510e0a [fzf-tmux] Set default horizontal margin 2020-04-03 13:23:15 +09:00
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%'
2020-04-03 13:23:15 +09:00
lacygoill 0f5c6e8f04
[vim] Fix issue with multiple popups (#1927)
Invoking fzf from an existing Vim popup terminal is a special case.
It requires some new code to avoid E994 from being raised and the user
being stuck in a non-closable popup window.

Fix #1916
2020-03-30 02:06:06 +09:00
Roman Perepelitsa b1b916ce15
[zsh] Ensure that fzf code always parses the same way (#1944)
At the top of each zsh file options are set to their
standard values (those marked with <Z> in `man zshoptions`)
and `aliases` option is disabled.

At the bottom of the file the original options are restored.

Fix #1938
2020-03-30 01:52:48 +09:00
Alexandr a6a732e1fc
Update AtomicBool to use atomic memory operation (#1939) 2020-03-30 01:42:58 +09:00
Junegunn Choi a5c2f28539
Fix failing test case 2020-03-29 22:06:06 +09:00
Junegunn Choi 18261fe31c
[shell] Update CTRL-R to remove duplicate commands
Close #1940
Related: #1363 #749 #270 #49 #88 #492 #600
2020-03-29 21:30:37 +09:00
Chitoku 079046863c
[zsh-completion] Fix a bug where _fzf_complete did not iterate through args (#1936) 2020-03-24 08:58:22 +09:00
Junegunn Choi 07b965bba1
Fix ANSI color offsets when --keep-right is used 2020-03-23 19:05:06 +09:00
Junegunn Choi c39113ee41
[windows] Do not include directories in the list
Fix #1926
2020-03-14 21:43:35 +09:00
Junegunn Choi 14f90502a4
[bash] Restore --nth option in CTRL-R 2020-03-13 09:13:38 +09:00
Junegunn Choi b0673c3563
0.21.0 2020-03-12 13:15:45 +09:00
Junegunn Choi 373c6d8d55
Add --keep-right option to keep the right end of the line visible
Close #1652
2020-03-11 22:35:24 +09:00
Junegunn Choi b8fc828955
Fix completion test 2020-03-11 19:50:04 +09:00
Jakub Łuczyński b43b040512
Fuzzy completions: removed leftover debug echo (#1921) 2020-03-11 19:29:35 +09:00
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
  )
2020-03-11 18:32:35 +09:00
Kahlil (Kal) Hodgson 7085e5b629
Add explanation for the `g:fzf_colors` setting (#1878)
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2020-03-11 09:58:59 +09:00
Michael Kelley 7d5985baf9
Make height option work under Windows (#1341)
Separate Unix & Windows code into platform specific files for light renderer
2020-03-10 00:03:34 +09:00
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
2020-03-07 19:56:06 +09:00
Junegunn Choi baf882ace7
[completion] Use file redirection instead of pipe
This change allows the completion system of bash and zsh to return
before the input process completes.

Related #1887
2020-03-07 16:26:53 +09:00
Junegunn Choi ba82f0bef9
Do not read more than 10K characters from /dev/tty
This might help with #1456 where fzf hangs consuming CPU resources.
2020-03-07 11:20:44 +09:00
Junegunn Choi d9c6a0305b
Draft CHANGELOG for the upcoming release 2020-03-05 23:12:27 +09:00
Junegunn Choi d9b1211191
Add more --border options; default changed to "rounded"
--border option now takes an optional argument that defines the style

  - rounded (new default)
  - sharp
  - horizontal (previous default)
2020-03-05 20:56:15 +09:00
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'
2020-03-04 08:37:45 +09:00
Junegunn Choi 242c0db26b
[vim] Fix height calculation
Fix #1418

e.g.
  call fzf#run({'source': [1, 2, 3], 'down': '~50%', 'options': "--border --header $'1\n2'"})
2020-03-03 23:50:45 +09:00
Junegunn Choi dd49e41c42
Ignore xterm OSC control sequences
- OSC Ps ; Pt BEL
- OSC Ps ; Pt ST

Fix #1415
2020-03-03 21:19:23 +09:00
Junegunn Choi 6db15e8693
[vim] Throw error when popup support is unavailable
https://github.com/junegunn/fzf.vim/issues/943
https://github.com/junegunn/fzf.vim/issues/959
2020-03-01 20:57:35 +09:00
Junegunn Choi 4c9cab3f8a
Fix prefix/suffix/equal matcher to trim whitespaces
- Prefix matcher will trim leading whitespaces only when the pattern
  doesn't start with a whitespace
- Suffix matcher will trim trailing whitespaces only when the pattern
  doesn't end with a whitespace
- Equal matcher will trim leading whitespaces only when the pattern
  doesn't start with a whitespace, and trim trailing whitespaces only
  when the pattern doesn't end with a whitespace

Previously, only suffix matcher would trim whitespaces unconditionally.

Fix #1894
2020-03-01 12:36:02 +09:00
Junegunn Choi b2c0413a98
[bash] Fix --query argument of CTRL-R
Fix #1898
2020-02-29 12:01:55 +09:00
Jack Bates e34c7c00b1
Test multi-line C-r (#1892) 2020-02-28 20:06:38 +09:00
Jack Bates 7c447bbdc7
[bash] Start C-r search with current command line (#1886)
Restore the original line when search is aborted. Add --query
"$READLINE_LINE" and fall back to the current behavior pre Bash 4.

Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2020-02-28 18:47:13 +09:00
Junegunn Choi 7bf1f2cc84
Clean up test shell initialization
- Fix 'make docker-test'
- Set fish_history to an empty string since 'fish --private' is not
  available prior to fish 3.0
2020-02-28 18:21:37 +09:00