gregsexton / gitv

gitk for Vim.
936 stars 59 forks source link

s:fugitive_GitComplete looks out of date #56

Closed idbrii closed 7 years ago

idbrii commented 11 years ago

While looking through the source, I stumbled upon s:fugitive_GitComplete. It doesn't sort the output keys. Is this function out of date? There's a comment "These functions are lifted directly from fugitive and modified only to work with gitv." but I can't tell what was modified to make them work with gitv. Are they supposed to be verbatim?

function! s:fugitive_GitComplete(A,L,P) abort "{{{
if !exists('s:exec_path')
    let s:exec_path = s:fugitive_sub(system(g:fugitive_git_executable.' --exec-path'),'\n$','')
endif
let cmds = map(split(glob(s:exec_path.'/git-*'),"\n"),'s:fugitive_sub(v:val[strlen(s:exec_path)+5 : -1],"\\.exe$","")')
if a:L =~ ' [[:alnum:]-]\+ '
    return fugitive#buffer().repo().superglob(a:A)
elseif a:A == ''
    " Fugitive behavior: return sort(cmds+keys(s:repo().aliases()))
    return cmds
else
    " Fugitive behavior: return filter(sort(cmds+keys(s:repo().aliases())),'v:val[0:strlen(a:A)-1] ==# a:A')
    return filter(cmds,'v:val[0 : strlen(a:A)-1] ==# a:A')
endif
endfunction "}}} }}}
gregsexton commented 11 years ago

Hi,

They're probably out of date. I can't remember what was changed, if anything. I think they were lifted because they weren't publicly accessible and it saved me from having to write my own.

rbong commented 7 years ago

Now we call the complete function directly.