Commit Graph

86 Commits (master)

Author SHA1 Message Date
Zhizhen He 01e7668915
chore: use strings.ReplaceAll (#3801) 5 days ago
Junegunn Choi 6432f00f0d
0.52.1 1 week ago
Junegunn Choi e8405f40fe
Refactor the code so that fzf can be used as a library (#3769) 2 weeks ago
Junegunn Choi 5669f48343
Do not enable delayed expansion mode when running cmd.exe
And simplify the argument escaping code. Fix #3764.

This may breaks some existing use cases, but the mode causes too much
trouble when escaping arguments and it makes some things not possible.

  # Now you can pass special characters to rg process without any escaping problems: &|<>()@^%!
  fzf --ansi --disabled --bind "change:reload:rg --column --line-number --no-heading --color=always --smart-case -- {q}"

  # No sudden expansion of the arguments on '!'
  fzf --disabled --preview "echo {q} {n} {}" --query "&|<>()@^%!" --prompt "&|<>()@^%!"
2 weeks ago
Junegunn Choi 194a763c46
Escaping for cmd.exe: always use double quotes 3 weeks ago
Junegunn Choi 8d74446bef
Fix escaping for cmd.exe
Close #3651
Close #2609
4 weeks ago
Junegunn Choi 7ed6c7905c
Determine shell type once by the basename 4 weeks ago
Junegunn Choi 159a37fa37
Restore CmdLine parameter when running commands using cmd.exe 4 weeks ago
Junegunn Choi a4391aeedd
Add --with-shell for shelling out with different command and flags (#3746)
Close #3732
4 weeks ago
Junegunn Choi e86b81bbf5
Improve search performance by limiting the search scope
Find the last occurrence of the last character in the pattern and
perform the search algorithm only up to that point.

The effectiveness of this mechanism depends a lot on the shape of the
input and the pattern.
1 month ago
Charlie Vieth 3c877c504b
Enable profiling options when 'pprof' tag is set (#2813)
This commit enables cpu, mem, block, and mutex profling of the FZF
executable. To support flushing the profiles at program exit it adds
util.AtExit to register "at exit" functions and mandates that util.Exit
is used instead of os.Exit to stop the program.

Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
1 month ago
Junegunn Choi fd1ba46f77
Export $FZF_KEY environment variable to child processes
It's the name of the last key pressed.

Related #3412
1 month ago
Junegunn Choi c30e486b64
Further performance improvements by removing unnecessary copies 2 months ago
Junegunn Choi 76cf6559cc
junegunn/uniseg -> rivo/uniseg
https://github.com/rivo/uniseg/pull/47
4 months ago
Junegunn Choi 16f6473938
Change mattn/go-runewidth dependency to rivo/uniseg for accurate results
Related #3588 #3588 #3567
4 months ago
Junegunn Choi 8a2c41e183
Handle ambiguous emoji width
Fix #3588
4 months ago
Junegunn Choi 1a9ea6f738
Remove 'replace' directive for 'go install' compatibility
Close #3577
4 months ago
Junegunn Choi f50a7058d6
Fix center-alignment of border/preview label
Fix #3421
9 months ago
Junegunn Choi d7daf5f724
Render CR and LF as ␍ and ␊
Close #2529
1 year ago
Zhizhen He 3364d4d147
Add spell check workflow (#3183) 1 year ago
Junegunn Choi 4e305eca26
become: Set stdin to /dev/tty 1 year ago
Junegunn Choi aa7361337d
Make test case pass on 32-bit platforms
Close #3127
1 year ago
OHZEKI Naoki 6b7a543c82
Add more util tests (#3062)
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2 years ago
Bruno Heridet 46877e0a92
test(eventbox): remove obsolete EvtClose const (#3059) 2 years ago
Junegunn Choi 8868d7d188
Add --separator to customize the info separator 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 b88eb72ac2
Modernize build tags 2 years ago
Junegunn Choi cd23401411
Fix rendering of the prompt line when overflow occurs with `--info=inline`
Fix #2692
2 years ago
Rashil Gandhi 7c3f42bbba Fix powershell escaping 3 years ago
Junegunn Choi edac9820b5
Cache cygpath result
No need to repeatedly run cygpath process because $SHELL never changes.
3 years ago
Rashil Gandhi 84a47f7102
Respect SHELL env var on Windows (#2641)
This makes fzf respect SHELL environment variable on Windows, like it does on *nix, whenever defined.

Close #2638
3 years ago
Vlastimil Ovčáčík 00fb486f6a [tests] Add testing of keyboard events in FullscreenRenderer.GetChar()
This contains one test case of each tcell.Key* event type that can be
sent to and subsequently processed in fzf's GetChar(). The test cases
describe status quo, and all of them PASS.

Small function util.ToTty() was added. It is similar to util.IsTty(),
but for stdout (hence the To preposition).
3 years ago
Junegunn Choi 8255aa23f4
Fix bug where `--read0` not properly displaying long lines
Fix #2508
3 years ago
Junegunn Choi 3f75a8369f
Replace RuneWidth to StringWidth to handle grapheme clusters
Fix #2482
3 years ago
Alexandr a6a732e1fc
Update AtomicBool to use atomic memory operation (#1939) 4 years ago
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
4 years ago
Junegunn Choi 2b725a4db5
Defer resetting multi-selection on reload 5 years ago
Junegunn Choi 751aa1944a
Remove trailing whitespaces when using --with-nth 5 years ago
Christian Muehlhaeuser a1260feeed Code cleanup (#1640)
- Replaced time.Now().Sub() with time.Since()
- Replaced unnecessary string/byte slice conversions
- Removed obsolete return and value assignment in range loop
5 years ago
Junegunn Choi 85c1f8a9e0
Always prepend ANSI reset code before re-assembling tokens 5 years ago
Junegunn Choi ef577a6509
Preserve the original color of each token when using --with-nth with --ansi
Close #1500
5 years ago
Junegunn Choi b46227dcb6
0.17.5 6 years ago
Junegunn Choi 0d748a0699
Kill running preview process after 500ms when focus has changed
Close #1383
Close #1384
6 years ago
Junegunn Choi f57920ad90
Do not print non-displayable characters
fzf used to print non-displayable characters (ascii code < 32) as '?',
but we will simply ignore those characters with this patch, just like
our terminals do.

\n and \r are exceptions. They will be printed as a space character.

TODO: \H should delete the preceding character, but this is not implemented.

Related: #1253
6 years ago
Ryan Boehning 21b94d2de5
Make fzf pass go vet
Add String() methods to types, so they can be printed with %s. Change
some %s format specifiers to %v, when the default string representation
is good enough. In Go 1.10, `go test` triggers a parallel `go vet`. So
this also makes fzf pass `go test`.

Close #1236
Close #1219
6 years ago
Jan Edmund Lazo 7f0caf0683 Update Windows default command to print relative paths (#1200) 6 years ago
Junegunn Choi 438f6c96cd
Fix compilation error of Windows binary 7 years ago
Jan Edmund Lazo c4185e81e8
Fix ExecCommandWith for cmd.exe in Windows (#1072)
Close #1018

Run the command as is in cmd.exe with no parsing and escaping.
Explicity set cmd.SysProcAttr so execCommand does not escape the command.
Technically, the command should be escaped with ^ for special characters,
including ". This allows cmd.exe commands to be chained together.

See https://github.com/neovim/neovim/pull/7343#issuecomment-333350201

This commit also updates quoteEntry to use strings.Replace instead of
strconv.Quote which escapes more than \ and ".
7 years ago
Junegunn Choi ee40212e97
Update FZF_DEFAULT_COMMAND
- Use bash for `set -o pipefail`
- Fall back to simpler find command when the original command failed

Related: #1061
7 years ago
Junegunn Choi af809c9661
Minor refactorings 7 years ago