Update vital

This commit is contained in:
Shougo Matsushita
2014-02-15 10:53:59 +09:00
parent d23ee02b49
commit 7502b06be0
6 changed files with 232 additions and 114 deletions

View File

@@ -1,7 +1,7 @@
"=============================================================================
" FILE: util.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 13 Nov 2013.
" Last Modified: 15 Feb 2014.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@@ -28,36 +28,57 @@ let s:save_cpo = &cpo
set cpo&vim
let s:V = vital#of('neosnippet')
function! neosnippet#util#get_vital() "{{{
return s:V
endfunction"}}}
function! s:get_prelude() "{{{
if !exists('s:Prelude')
let s:Prelude = neosnippet#util#get_vital().import('Prelude')
endif
return s:Prelude
endfunction"}}}
function! s:get_list() "{{{
if !exists('s:List')
let s:List = neosnippet#util#get_vital().import('Data.List')
endif
return s:List
endfunction"}}}
function! s:get_process() "{{{
if !exists('s:Process')
let s:Process = neosnippet#util#get_vital().import('Process')
endif
return s:Process
endfunction"}}}
function! neosnippet#util#substitute_path_separator(...) "{{{
return call(s:V.substitute_path_separator, a:000)
return call(s:get_prelude().substitute_path_separator, a:000)
endfunction"}}}
function! neosnippet#util#system(...) "{{{
return call(s:V.system, a:000)
return call(s:get_process().system, a:000)
endfunction"}}}
function! neosnippet#util#has_vimproc(...) "{{{
return call(s:V.has_vimproc, a:000)
return call(s:get_process().has_vimproc, a:000)
endfunction"}}}
function! neosnippet#util#is_windows(...) "{{{
return call(s:V.is_windows, a:000)
return call(s:get_prelude().is_windows, a:000)
endfunction"}}}
function! neosnippet#util#is_mac(...) "{{{
return call(s:V.is_mac, a:000)
return call(s:get_prelude().is_mac, a:000)
endfunction"}}}
function! neosnippet#util#get_last_status(...) "{{{
return call(s:V.get_last_status, a:000)
return call(s:get_process().get_last_status, a:000)
endfunction"}}}
function! neosnippet#util#escape_pattern(...) "{{{
return call(s:V.escape_pattern, a:000)
return call(s:get_prelude().escape_pattern, a:000)
endfunction"}}}
function! neosnippet#util#iconv(...) "{{{
return call(s:V.iconv, a:000)
return call(s:get_process().iconv, a:000)
endfunction"}}}
function! neosnippet#util#truncate(...) "{{{
return call(s:V.truncate, a:000)
return call(s:get_prelude().truncate, a:000)
endfunction"}}}
function! neosnippet#util#strwidthpart(...) "{{{
return call(s:V.strwidthpart, a:000)
return call(s:get_prelude().strwidthpart, a:000)
endfunction"}}}
function! neosnippet#util#expand(path) "{{{
@@ -70,7 +91,7 @@ function! neosnippet#util#set_default(var, val, ...) "{{{
endif
endfunction"}}}
function! neosnippet#util#set_dictionary_helper(...) "{{{
return call(s:V.set_dictionary_helper, a:000)
return call(s:get_prelude().set_dictionary_helper, a:000)
endfunction"}}}
function! neosnippet#util#get_cur_text() "{{{