Skip to content
Myr

[fish] Use perl instead of sed to strip leading tabs

Before adoption: this commit came in with the history the project adopted, so no landing records it.

https://github.com/junegunn/fzf/pull/3807#discussion_r1619520105

authored by Junegunn Choi · committed by Junegunn Choi · parent b4f2cde · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • https: //github.com/junegunn/fzf/pull/3807#discussion_r1619520105

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:shell/key-bindings.fish+1 added-1 removed
68 unmodified lines
69 # history's -z flag was added in fish 2.4.0, so don't use it for versions70 # before 2.4.0.71 if [ "$FISH_MAJOR" -gt 2 -o \( "$FISH_MAJOR" -eq 2 -a "$FISH_MINOR" -ge 4 \) ];72 if type -q perl73 history -z --reverse | perl -0 -pe 's/^/$.\t/g; s/\n/\n\t/gm' | eval (__fzfcmd) --tac --read0 --print0 -q '(commandline)' | sed 's/^[0-9]*\t//' | read -lz result73 history -z --reverse | perl -0 -pe 's/^/$.\t/g; s/\n/\n\t/gm' | eval (__fzfcmd) --tac --read0 --print0 -q '(commandline)' | perl -pe 's/^\d*\t//' | read -lz result74 and commandline -- $result75 else76 history -z | eval (__fzfcmd) --read0 --print0 -q '(commandline)' | read -lz result77 and commandline -- $result
114 unmodified lines