1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-04 00:50:04 +08:00
SpaceVim/bundle/vim-over/autoload/vital/_over/Unlocker/Rocker/Multi.vim
2022-06-10 16:31:14 +08:00

46 lines
1.1 KiB
VimL
Vendored

" ___vital___
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
" Do not mofidify the code nor insert new lines before '" ___vital___'
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
execute join(['function! vital#_over#Unlocker#Rocker#Multi#import() abort', printf("return map({'make': ''}, \"vital#_over#function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
delfunction s:_SID
" ___vital___
scriptencoding utf-8
let s:save_cpo = &cpo
set cpo&vim
function! s:_as_list(value)
return type(a:value) == type([]) ? a:value : [a:value]
endfunction
let s:obj = {}
function! s:obj.lock()
call map(copy(self.__rockers), "v:val.lock()")
return self
endfunction
function! s:obj.unlock()
call map(copy(self.__rockers), "v:val.unlock()")
endfunction
function! s:obj.relock()
call map(copy(self.__rockers), "v:val.relock()")
endfunction
function! s:make(rockers)
let result = deepcopy(s:obj)
let result.__rockers = s:_as_list(a:rockers)
return result
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo