mirror of
https://github.com/tpope/vim-rhubarb.git
synced 2025-12-08 04:54:46 +08:00
@@ -3,8 +3,8 @@
|
||||
Author: Tim Pope <http://tpo.pe/>
|
||||
License: Same terms as Vim itself (see |license|)
|
||||
|
||||
Use |i_CTRL-X_CTRL-O| to omni-complete GitHub issues when editing a commit
|
||||
message.
|
||||
Use |i_CTRL-X_CTRL-O| to omni-complete GitHub issues or project collaborator
|
||||
usernames when editing a commit message.
|
||||
|
||||
ABOUT *rhubarb-about*
|
||||
|
||||
|
||||
@@ -146,11 +146,15 @@ endfunction
|
||||
|
||||
function! rhubarb#omnifunc(findstart,base)
|
||||
if a:findstart
|
||||
let existing = matchstr(getline('.')[0:col('.')-1],'#\d*$')
|
||||
let existing = matchstr(getline('.')[0:col('.')-1],'#\d*$\|@[[:alnum:]-]*$')
|
||||
return col('.')-1-strlen(existing)
|
||||
endif
|
||||
try
|
||||
return map(rhubarb#repo_request('issues'), '{"word": "#".v:val.number, "menu": v:val.title, "info": substitute(v:val.body,"\\r","","g")}')
|
||||
if a:base =~# '^@'
|
||||
return map(rhubarb#repo_request('collaborators'), '"@".v:val.login')
|
||||
else
|
||||
return map(rhubarb#repo_request('issues'), '{"word": "#".v:val.number, "menu": v:val.title, "info": substitute(v:val.body,"\\r","","g")}')
|
||||
endif
|
||||
catch /^\%(fugitive\|rhubarb\):/
|
||||
return v:errmsg
|
||||
endtry
|
||||
|
||||
Reference in New Issue
Block a user