From b2951b070b58a9e96d4fbe150a8adbfff3bc0fbf Mon Sep 17 00:00:00 2001 From: haya14busa Date: Thu, 24 Jul 2014 10:35:19 +0900 Subject: [PATCH] Update vital.vim - Fix loading problem: fix #171 --- autoload/vital/_easymotion.vim | 2 +- autoload/vital/_easymotion/Data/List.vim | 17 +++++++++++++++++ autoload/vital/easymotion.vital | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/autoload/vital/_easymotion.vim b/autoload/vital/_easymotion.vim index d65da5e..28663c5 100644 --- a/autoload/vital/_easymotion.vim +++ b/autoload/vital/_easymotion.vim @@ -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 diff --git a/autoload/vital/_easymotion/Data/List.vim b/autoload/vital/_easymotion/Data/List.vim index 29e373e..e9a62c2 100644 --- a/autoload/vital/_easymotion/Data/List.vim +++ b/autoload/vital/_easymotion/Data/List.vim @@ -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 diff --git a/autoload/vital/easymotion.vital b/autoload/vital/easymotion.vital index 892ec63..3b40673 100644 --- a/autoload/vital/easymotion.vital +++ b/autoload/vital/easymotion.vital @@ -1,5 +1,5 @@ easymotion -439e6d2 +95279f3 Over.Commandline.Base Over.Commandline.Modules.Cancel