Update vital.vim

- Fix loading problem: fix #171
This commit is contained in:
haya14busa 2014-07-24 10:35:19 +09:00
parent 6a0030da89
commit b2951b070b
3 changed files with 19 additions and 2 deletions

View File

@ -128,7 +128,7 @@ function! s:_get_module_path(name)
throw 'vital: Invalid module name: ' . a:name
endif
call filter(paths, 'filereadable(expand(v:val))')
call filter(paths, 'filereadable(expand(v:val, 1))')
let path = get(paths, 0, '')
return path !=# '' ? path : ''
endfunction

View File

@ -284,6 +284,23 @@ function! s:has_common_items(list1, list2)
return !empty(filter(copy(a:list1), 'index(a:list2, v:val) isnot -1'))
endfunction
" similar to Ruby's group_by.
function! s:group_by(xs, f)
let result = {}
let list = map(copy(a:xs), printf('[v:val, %s]', a:f))
for x in list
let Val = x[0]
let key = type(x[1]) !=# type('') ? string(x[1]) : x[1]
if has_key(result, key)
call add(result[key], Val)
else
let result[key] = [Val]
endif
unlet Val
endfor
return result
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo

View File

@ -1,5 +1,5 @@
easymotion
439e6d2
95279f3
Over.Commandline.Base
Over.Commandline.Modules.Cancel