Some checks failed
Detach Plugins / check (FlyGrep.vim) (push) Has been cancelled
Detach Plugins / check (GitHub.vim) (push) Has been cancelled
Detach Plugins / check (JavaUnit.vim) (push) Has been cancelled
Detach Plugins / check (SourceCounter.vim) (push) Has been cancelled
Detach Plugins / check (cpicker.nvim) (push) Has been cancelled
Detach Plugins / check (dein-ui.vim) (push) Has been cancelled
Detach Plugins / check (git.vim) (push) Has been cancelled
Detach Plugins / check (iedit.vim) (push) Has been cancelled
Detach Plugins / check (scrollbar.vim) (push) Has been cancelled
Detach Plugins / check (vim-chat) (push) Has been cancelled
Detach Plugins / check (vim-cheat) (push) Has been cancelled
Detach Plugins / check (vim-todo) (push) Has been cancelled
Detach Plugins / check (xmake.vim) (push) Has been cancelled
test / Linux (nvim, nightly) (push) Has been cancelled
test / Linux (nvim, v0.3.8) (push) Has been cancelled
test / Linux (nvim, v0.4.0) (push) Has been cancelled
test / Linux (nvim, v0.4.2) (push) Has been cancelled
test / Linux (nvim, v0.4.3) (push) Has been cancelled
test / Linux (nvim, v0.4.4) (push) Has been cancelled
test / Linux (nvim, v0.5.0) (push) Has been cancelled
test / Linux (nvim, v0.5.1) (push) Has been cancelled
test / Linux (nvim, v0.6.0) (push) Has been cancelled
test / Linux (nvim, v0.6.1) (push) Has been cancelled
test / Linux (nvim, v0.7.0) (push) Has been cancelled
test / Linux (nvim, v0.7.2) (push) Has been cancelled
test / Linux (nvim, v0.8.0) (push) Has been cancelled
test / Linux (nvim, v0.8.1) (push) Has been cancelled
test / Linux (nvim, v0.8.2) (push) Has been cancelled
test / Linux (nvim, v0.8.3) (push) Has been cancelled
test / Linux (nvim, v0.9.0) (push) Has been cancelled
test / Linux (nvim, v0.9.1) (push) Has been cancelled
test / Linux (true, vim, v7.4.052) (push) Has been cancelled
test / Linux (true, vim, v7.4.1689) (push) Has been cancelled
test / Linux (true, vim, v7.4.629) (push) Has been cancelled
test / Linux (true, vim, v8.0.0027) (push) Has been cancelled
test / Linux (true, vim, v8.0.0183) (push) Has been cancelled
test / Linux (vim, nightly) (push) Has been cancelled
test / Linux (vim, v8.0.0184) (push) Has been cancelled
test / Linux (vim, v8.0.1453) (push) Has been cancelled
test / Linux (vim, v8.1.2269) (push) Has been cancelled
test / Linux (vim, v8.2.2434) (push) Has been cancelled
test / Linux (vim, v8.2.3995) (push) Has been cancelled
test / Windows (nvim, nightly) (push) Has been cancelled
test / Windows (nvim, v0.3.8) (push) Has been cancelled
test / Windows (nvim, v0.4.2) (push) Has been cancelled
test / Windows (nvim, v0.4.3) (push) Has been cancelled
test / Windows (nvim, v0.4.4) (push) Has been cancelled
test / Windows (nvim, v0.5.0) (push) Has been cancelled
test / Windows (nvim, v0.5.1) (push) Has been cancelled
test / Windows (nvim, v0.6.0) (push) Has been cancelled
test / Windows (nvim, v0.6.1) (push) Has been cancelled
test / Windows (nvim, v0.7.0) (push) Has been cancelled
test / Windows (nvim, v0.7.2) (push) Has been cancelled
test / Windows (nvim, v0.8.0) (push) Has been cancelled
test / Windows (nvim, v0.8.1) (push) Has been cancelled
test / Windows (nvim, v0.8.2) (push) Has been cancelled
test / Windows (nvim, v0.8.3) (push) Has been cancelled
test / Windows (nvim, v0.9.0) (push) Has been cancelled
test / Windows (nvim, v0.9.1) (push) Has been cancelled
test / Windows (vim, nightly) (push) Has been cancelled
test / Windows (vim, v7.4.1185) (push) Has been cancelled
test / Windows (vim, v7.4.1689) (push) Has been cancelled
test / Windows (vim, v8.0.0027) (push) Has been cancelled
test / Windows (vim, v8.0.1453) (push) Has been cancelled
test / Windows (vim, v8.1.2269) (push) Has been cancelled
test / Windows (vim, v8.2.2434) (push) Has been cancelled
test / Windows (vim, v8.2.3995) (push) Has been cancelled
docker / docker (push) Has been cancelled
mirror / check (coding) (push) Has been cancelled
mirror / check (gitee) (push) Has been cancelled
mirror / check (gitlab) (push) Has been cancelled
83 lines
2.2 KiB
VimL
83 lines
2.2 KiB
VimL
"Vaxe utility functions (vutil)
|
|
|
|
" Utility function that recursively searches parent directories for 'dir'
|
|
" until a file matching "pattern" is found.
|
|
function! vaxe#util#ParentSearch(patterns, dir)
|
|
let current_dir = fnamemodify(a:dir,":p:h")
|
|
let last_dir = ''
|
|
while(current_dir != last_dir)
|
|
let last_dir = current_dir
|
|
for p in a:patterns
|
|
let match = globpath(current_dir, p)
|
|
if match != ''
|
|
return match
|
|
endif
|
|
endfor
|
|
let current_dir = fnamemodify(current_dir, ":p:h:h")
|
|
endwhile
|
|
return ''
|
|
endfunction
|
|
|
|
" returns the current running haxe version on the cache server
|
|
function! vaxe#util#HaxeServerVersion()
|
|
let response = vaxe#util#SimpleSystem("haxe --connect "
|
|
\ . g:vaxe_cache_server_port . ' -version' )
|
|
if response =~ '\v^([0-9]\.)*[0-9]$'
|
|
return response
|
|
else
|
|
return '0'
|
|
endif
|
|
endfunction
|
|
|
|
function! vaxe#util#Strip(str)
|
|
return substitute(a:str, '^\s*\(.\{-}\)\s*$', '\1', '')
|
|
endfunction
|
|
|
|
function! vaxe#util#SimpleSystem(cmd)
|
|
let lines = system(a:cmd)
|
|
let firstline = split(lines,'\n')[0]
|
|
return vaxe#util#Strip(firstline)
|
|
endfunction
|
|
|
|
|
|
" ye olde default config setter
|
|
function! vaxe#util#Config(name, default)
|
|
if !exists(a:name)
|
|
return a:default
|
|
else
|
|
return eval(a:name)
|
|
endif
|
|
endfunction
|
|
|
|
|
|
" Utility function that lets users select from a list. If list is length 1,
|
|
" then that item is returned. Uses tlib#inpu#List if available.
|
|
function! vaxe#util#InputList(label, items)
|
|
if len(a:items) == 1
|
|
return a:items[0]
|
|
endif
|
|
if exists("g:loaded_tlib")
|
|
return tlib#input#List("s", a:label, a:items)
|
|
else
|
|
let items_list = map(range(len(a:items)),'(v:val+1)." ".a:items[v:val]')
|
|
let items_list = [a:label] + items_list
|
|
let sel = inputlist(items_list)
|
|
" 0 is the label. If that is returned, just use the first item in the
|
|
" list instead
|
|
if sel == 0
|
|
let sel = 1
|
|
endif
|
|
return a:items[sel-1]
|
|
endif
|
|
endfunction
|
|
|
|
" Utility function that returns a list of unique values in the list argument.
|
|
function! vaxe#util#UniqueList(items)
|
|
let d = {}
|
|
for v in a:items
|
|
let d[v] = 1
|
|
endfor
|
|
return keys(d)
|
|
endfunction
|
|
|