Merge #7893 'man.vim: use correct offset in presence of modifier commands'

This commit is contained in:
Marco Hinz 2018-01-22 17:31:36 +01:00 committed by GitHub
commit 59ac170340
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -299,6 +299,12 @@ endfunction
" see man#extract_sect_and_name_ref on why tolower(sect) " see man#extract_sect_and_name_ref on why tolower(sect)
function! man#complete(arg_lead, cmd_line, cursor_pos) abort function! man#complete(arg_lead, cmd_line, cursor_pos) abort
let args = split(a:cmd_line) let args = split(a:cmd_line)
let cmd_offset = index(args, 'Man')
if cmd_offset > 0
" Prune all arguments up to :Man itself. Otherwise modifier commands like
" :tab, :vertical, etc. would lead to a wrong length.
let args = args[cmd_offset:]
endif
let l = len(args) let l = len(args)
if l > 3 if l > 3
return return