Open cpick opened 2 years ago
It looks like this is because fzf
does awk
-like tokenization by default (unless a delimiter is provided). I think changing the various default DELIMITER_STR
s from [\t\n ]+
to [^\t\n ][\t\n ]+
will more or less fix it (the first field will still have the leading white space included which is different than fzf
, but it's good enough for my purposes).
Field expressions were changed in https://github.com/lotabout/skim/pull/85 from "git style" to attempt to match fzf's behavior, but they exhibit different behavior when there are leading spaces.
For example, running the following with
fzf
(note leading space in input):Prints only the "second" column in the preview pane:
Whereas, running with
sk
(including leading space in input):Prints both columns in the preview pane:
This actually breaks using skim as a fzf replacement with zoxide. It calls
fzf
/sk
with similar-n2..
and--preview 'ls {2..}'
arguments (among others) and then provides lines of input that start with a leading-space-padded 4-digit score followed by directory names like this:And the difference in field expressions cause selection to happen on less-than-4-digit leading scores and also the preview command to break because it gets passed the same less-than-4-digit scores in addition to the filename.