Skip to content
Myr

Prefer pre-existing function/alias in Vim plugin

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

authored by Junegunn Choi · committed by Junegunn Choi · parent 678e950 · Browse files · 1 file+13 added−3 removed
This commit

State

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

Diff stats

1 file+13 added−3 removed

  • other:+13 added−3 removed

1 file+13 added−3 removed

modified:plugin/fzf.vim+13 added-3 removed
19 unmodified lines
20" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION21" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION22" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.2324call system('type fzf')25if v:shell_error24let s:exec = expand('<sfile>:h:h').'/fzf'26 let s:fzf_rb = expand('<sfile>:h:h').'/fzf'27 if executable(s:fzf_rb)28 let s:exec = s:fzf_rb29 else30 echoerr 'fzf executable not found'31 finish32 endif33else34 let s:exec = 'fzf'35endif3637function! s:escape(path)38 return substitute(a:path, ' ', '\\ ', 'g')39endfunction
8 unmodified lines
48 endif49 let argstr = join(args)50 let tf = tempname()51 let prefix = exists('g:fzf_source') ? g:fzf_source.'|' : ''41 let fzf = executable(s:exec) ? s:exec : 'fzf'52 let options = empty(argstr) ? get(g:, 'fzf_options', '') : argstr43 execute "silent !".prefix.fzf.' '.options." > ".tf53 execute 'silent !'.prefix.s:exec.' '.options.' > '.tf54 if !v:shell_error55 for line in readfile(tf)56 if !empty(line)57 execute a:command.' '.s:escape(line)
12 unmodified lines