fzf: Purge cdhist when running the cdhist widget
parent
111e71c765
commit
aeb15800cc
|
@ -107,6 +107,15 @@ end
|
||||||
bind \e\cL __fzf-bcd-widget
|
bind \e\cL __fzf-bcd-widget
|
||||||
|
|
||||||
function __fzf-cdhist-widget -d 'cd to one of the previously visited location'
|
function __fzf-cdhist-widget -d 'cd to one of the previously visited location'
|
||||||
|
## Clear non-existent folders from cdhist.
|
||||||
|
set -l buf
|
||||||
|
for i in (seq 1 (count $dirprev))
|
||||||
|
set -l dir $dirprev[$i]
|
||||||
|
if test -d $dir
|
||||||
|
set buf $buf $dir
|
||||||
|
end
|
||||||
|
end
|
||||||
|
set dirprev $buf
|
||||||
## TODO: (fish upsteam bug) Cannot use eval here.
|
## TODO: (fish upsteam bug) Cannot use eval here.
|
||||||
# string join \n $dirprev | tac | sed 1d | eval (__fzfcmd) +m $FZF_CDHIST_OPTS | read -l result
|
# string join \n $dirprev | tac | sed 1d | eval (__fzfcmd) +m $FZF_CDHIST_OPTS | read -l result
|
||||||
string join \n $dirprev | tac | sed 1d | fzf +m --preview='preview {}' | read -l result
|
string join \n $dirprev | tac | sed 1d | fzf +m --preview='preview {}' | read -l result
|
||||||
|
|
Loading…
Reference in New Issue