Use s:lines instead of split

This commit is contained in:
Junegunn Choi 2014-10-10 10:10:52 +09:00
parent 018adb2aef
commit ee9f0e55b8

View File

@ -125,7 +125,7 @@ endfunction
function! s:source(from, ...) function! s:source(from, ...)
for pattern in a:000 for pattern in a:000
for vim in split(globpath(a:from, pattern), '\n') for vim in s:lines(globpath(a:from, pattern))
execute 'source' vim execute 'source' vim
endfor endfor
endfor endfor
@ -1134,7 +1134,7 @@ function! s:shellesc(arg)
endfunction endfunction
function! s:glob_dir(path) function! s:glob_dir(path)
return map(filter(split(globpath(a:path, '**'), '\n'), 'isdirectory(v:val)'), 's:dirpath(v:val)') return map(filter(s:lines(globpath(a:path, '**')), 'isdirectory(v:val)'), 's:dirpath(v:val)')
endfunction endfunction
function! s:progress_bar(line, bar, total) function! s:progress_bar(line, bar, total)
@ -1174,7 +1174,7 @@ function! s:git_valid(spec, check_branch)
let ret = 1 let ret = 1
let msg = 'OK' let msg = 'OK'
if isdirectory(a:spec.dir) if isdirectory(a:spec.dir)
let result = split(s:system('git rev-parse --abbrev-ref HEAD 2>&1 && git config remote.origin.url', a:spec.dir), '\n') let result = s:lines(s:system('git rev-parse --abbrev-ref HEAD 2>&1 && git config remote.origin.url', a:spec.dir))
let remote = result[-1] let remote = result[-1]
if v:shell_error if v:shell_error
let msg = join([remote, 'PlugClean required.'], "\n") let msg = join([remote, 'PlugClean required.'], "\n")
@ -1269,7 +1269,7 @@ function! s:upgrade()
if executable('curl') if executable('curl')
let output = system(printf('curl -fLo %s %s', s:shellesc(new), s:plug_source)) let output = system(printf('curl -fLo %s %s', s:shellesc(new), s:plug_source))
if v:shell_error if v:shell_error
throw get(split(output, '\n'), -1, v:shell_error) throw get(s:lines(output), -1, v:shell_error)
endif endif
elseif has('ruby') elseif has('ruby')
ruby << EOF ruby << EOF
@ -1438,7 +1438,7 @@ function! s:diff()
if !empty(diff) if !empty(diff)
call append(1, '') call append(1, '')
call append(2, '- '.k.':') call append(2, '- '.k.':')
call append(3, map(split(diff, '\n'), '" ". v:val')) call append(3, map(s:lines(diff), '" ". v:val'))
let cnt += 1 let cnt += 1
normal! gg normal! gg
redraw redraw