Issue: While following paths in a file, it might end up in paths like
`a/b/../c/d.ext` or `a/b/./c.ext`, which would be cleaner if displayed
like `a/c/d.ext` and `a/b/c.ext`.
Solution: Expand fullpath to resolve directories before collapsing it to
home directory/relative path.
system() adds an extra newline which breaks the DOS shortname hack
for Neovim on Windows.
Suppress echo so the DOS shortname is the 1st line of the output
Related: https://github.com/neovim/neovim/issues/7788
* Fish shell doesn't like <<<
Echo to pipe instead
* Only return the first match
Useful if the commit message has a project tracker id that looks
similar to a git commit hash
Only enable --preview if &columns > 120.
Caveat: When fzf starts in a terminal buffer, &columns does not
represent the width of the window.
Related: #461
By default git will quote filenames that contain special characters.
From the git help on the `core.quotepath` config:
> The commands that output paths (e.g. `ls-files`, `diff`), when not given
> the `-z` option, will quote "unusual" characters in the pathname by
> enclosing the pathname in a double-quote pair and with backslashes the
> same way strings in C source code are quoted. If this variable is set
> to false, the bytes higher than 0x80 are not quoted but output as
> verbatim. Note that double quote, backslash and control characters are
> always quoted without `-z` regardless of the setting of this variable.
This quoting behaviour means that GitFiles cannot be used to open files
that contain any special characters. Fix this by using the `-z` option
to `ls-files` together with the `--read0` option on fzf.
s:complete_trigger should prepend the default options instead of
appending them. The bug was introduced in 25ea637.
/tmp/foo<ctrl-x><ctrl-f> should give fzf prompt "/tmp/" and default
query "foo". But it used to give "/tmp//tmp/foo".
Bypasses the following issues in Windows:
1. Neovim does not support 8.3 filenames
ie. fnamemodify(path, ':8')
2. fzf binary cannot parse output of fzf#shellescape
It assumes that preview command is run in sh, not cmd.exe
- disabled on Files because the preview scripts cannot resolve the network drive
- use 8.3 filepath for s:bin.preview to bypass escape issues in fzf binary