mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-02-08 15:08:30 +00:00
[fish] CTRL-R: Make loading non-blocking
This commit is contained in:
parent
ed8ceec66f
commit
0a10d14e19
@ -70,13 +70,15 @@ function fzf_key_bindings
|
|||||||
set -lx FZF_DEFAULT_OPTS (__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort --wrap-sign '"\t"↳ ' --highlight-line $FZF_CTRL_R_OPTS +m")
|
set -lx FZF_DEFAULT_OPTS (__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort --wrap-sign '"\t"↳ ' --highlight-line $FZF_CTRL_R_OPTS +m")
|
||||||
set -lx FZF_DEFAULT_OPTS_FILE ''
|
set -lx FZF_DEFAULT_OPTS_FILE ''
|
||||||
if type -q perl
|
if type -q perl
|
||||||
builtin history -z --reverse | command perl -0 -pe 's/^/$.\t/g; s/\n/\n\t/gm' | eval (__fzfcmd) --tac --read0 --print0 -q '(commandline)' | string replace -r '^\d*\t' '' | read -lz result
|
set -l fzf_command (__fzfcmd) --tac --read0 --print0 -q (commandline)
|
||||||
|
builtin history -z --reverse | command perl -0 -pe 's/^/$.\t/g; s/\n/\n\t/gm' | $fzf_command | string replace -r '^\d*\t' '' | read -lz result
|
||||||
and commandline -- $result
|
and commandline -- $result
|
||||||
else
|
else
|
||||||
set -l h (builtin history -z | string split0)
|
set -l h (builtin history -z | string split0)
|
||||||
|
set -l fzf_command (__fzfcmd) --read0 --print0 -q (commandline)
|
||||||
for i in (seq (count $h) -1 1)
|
for i in (seq (count $h) -1 1)
|
||||||
string join0 -- $i\t(string replace -a -- \n \n\t $h[$i] | string collect)
|
string join0 -- $i\t(string replace -a -- \n \n\t $h[$i] | string collect)
|
||||||
end | eval (__fzfcmd) --read0 --print0 -q '(commandline)' | string replace -r '^\d*\t' '' | read -lz result
|
end | $fzf_command | string replace -r '^\d*\t' '' | read -lz result
|
||||||
and commandline -- $result
|
and commandline -- $result
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user