From 695e23bee8adfc1fafc04924051a0896d52d7f4b Mon Sep 17 00:00:00 2001 From: Dominik Honnef Date: Sat, 6 Jun 2015 22:50:58 +0200 Subject: [PATCH] fzf: update to 0.9.13 --- srcpkgs/fzf/files/fzf-cd-widget | 6 +++++- srcpkgs/fzf/files/fzf-file-widget | 15 ++------------- srcpkgs/fzf/files/fzf-fsel | 6 +++++- srcpkgs/fzf/files/fzf-history-widget | 21 ++++++++++++++++----- srcpkgs/fzf/patches/fsel.patch | 2 +- srcpkgs/fzf/template | 8 ++++---- 6 files changed, 33 insertions(+), 25 deletions(-) diff --git a/srcpkgs/fzf/files/fzf-cd-widget b/srcpkgs/fzf/files/fzf-cd-widget index a20bb2eff1..fc95584450 100644 --- a/srcpkgs/fzf/files/fzf-cd-widget +++ b/srcpkgs/fzf/files/fzf-cd-widget @@ -1,3 +1,7 @@ +__fzfcmd() { + [ ${FZF_TMUX:-1} -eq 1 ] && echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf" +} + cd "${$(command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ - -o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m):-.}" + -o -type d -print 2> /dev/null | sed 1d | cut -b3- | $(__fzfcmd) +m):-.}" zle reset-prompt diff --git a/srcpkgs/fzf/files/fzf-file-widget b/srcpkgs/fzf/files/fzf-file-widget index d218cda953..9a4d0b5b8a 100644 --- a/srcpkgs/fzf/files/fzf-file-widget +++ b/srcpkgs/fzf/files/fzf-file-widget @@ -1,13 +1,2 @@ -if [ -n "$TMUX_PANE" -a ${FZF_TMUX:-1} -ne 0 -a ${LINES:-40} -gt 15 ]; then - local height - height=${FZF_TMUX_HEIGHT:-40%} - if [[ $height =~ %$ ]]; then - height="-p ${height%\%}" - else - height="-l $height" - fi - tmux split-window $height "cd $(printf %q "$PWD"); zsh -c 'tmux send-keys -t $TMUX_PANE \"\$(fzf-fsel)\"'" -else - LBUFFER="${LBUFFER}$(fzf-fsel)" - zle redisplay -fi +LBUFFER="${LBUFFER}$(fzf-fsel)" +zle redisplay diff --git a/srcpkgs/fzf/files/fzf-fsel b/srcpkgs/fzf/files/fzf-fsel index 15ae1c0d4d..8f26d0f53e 100644 --- a/srcpkgs/fzf/files/fzf-fsel +++ b/srcpkgs/fzf/files/fzf-fsel @@ -1,8 +1,12 @@ #!/bin/bash +__fzfcmd() { + [ ${FZF_TMUX:-1} -eq 1 ] && echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf" +} + command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ -o -type f -print \ -o -type d -print \ - -o -type l -print 2> /dev/null | sed 1d | cut -b3- | fzf -m | while read item; do + -o -type l -print 2> /dev/null | sed 1d | cut -b3- | $(__fzfcmd) -m | while read item; do printf '%q ' "$item" done echo diff --git a/srcpkgs/fzf/files/fzf-history-widget b/srcpkgs/fzf/files/fzf-history-widget index 3250d6c204..696ac05f57 100644 --- a/srcpkgs/fzf/files/fzf-history-widget +++ b/srcpkgs/fzf/files/fzf-history-widget @@ -1,7 +1,18 @@ -local selected -if selected=$(fc -l 1 | fzf +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r -q "$LBUFFER"); then - num=$(echo "$selected" | head -1 | awk '{print $1}' | sed 's/[^0-9]//g') - LBUFFER=!$num - zle expand-history +__fzfcmd() { + [ ${FZF_TMUX:-1} -eq 1 ] && echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf" +} + +local selected restore_no_bang_hist +if selected=$(fc -l 1 | $(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r -q "$LBUFFER"); then + num=$(echo "$selected" | head -n1 | awk '{print $1}' | sed 's/[^0-9]//g') + if [ -n "$num" ]; then + LBUFFER=!$num + if setopt | grep nobanghist > /dev/null; then + restore_no_bang_hist=1 + unsetopt no_bang_hist + fi + zle expand-history + [ -n "$restore_no_bang_hist" ] && setopt no_bang_hist + fi fi zle redisplay diff --git a/srcpkgs/fzf/patches/fsel.patch b/srcpkgs/fzf/patches/fsel.patch index d555b26ec6..ed897a2476 100644 --- a/srcpkgs/fzf/patches/fsel.patch +++ b/srcpkgs/fzf/patches/fsel.patch @@ -3,7 +3,7 @@ @@ -1,15 +1,5 @@ # Key bindings # ------------ --__fsel() { +-__fzf_select__() { - command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ - -o -type f -print \ - -o -type d -print \ diff --git a/srcpkgs/fzf/template b/srcpkgs/fzf/template index f44c9d7934..15fda278d2 100644 --- a/srcpkgs/fzf/template +++ b/srcpkgs/fzf/template @@ -1,9 +1,9 @@ # Template file for 'fzf' pkgname=fzf -version=0.9.10 +version=0.9.13 +revision=1 _version=${version} wrksrc=${pkgname}-${_version} -revision=1 build_style=go go_import_path="github.com/junegunn/fzf/src" go_package="github.com/junegunn/fzf/src/fzf" @@ -14,7 +14,7 @@ license="MIT" homepage="https://github.com/junegunn/fzf" short_desc="A command-line fuzzy finder" distfiles="https://github.com/junegunn/fzf/archive/${_version}.tar.gz" -checksum=f5492ec1f8cce4c78d480ad3edd4e077df17109cde7bf5ade6f11135ce65aee3 +checksum=0a9972482f57dddf0d7c72e21d13d664ad9b8ee0535bdaab60bb0db3f0ca14c3 # Needs cgo to build, which doesn't work when cross-compiling. nocross=yes @@ -30,7 +30,7 @@ post_install() { vman man/man1/fzf.1 sed -i -e 's#source ~/\.fzf\.bash; ##' shell/key-bindings.bash - sed -i -e 's/(__fsel)/(fzf-fsel)/' shell/key-bindings.bash + sed -i -e 's/(__fzf_select__)/(fzf-fsel)/' shell/key-bindings.bash vinstall plugin/fzf.vim 644 usr/share/vim/vimfiles/plugin vinstall shell/completion.bash 644 usr/share/bash-completion/completions fzf vinstall ${FILESDIR}/fzf-file-widget 644 usr/share/zsh/site-functions