mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-04 08:40:05 +08:00
24 lines
728 B
VimL
24 lines
728 B
VimL
" ___vital___
|
|
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
|
|
" Do not modify 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#_cmp#VS#LSP#Text#import() abort', printf("return map({'normalize_eol': '', 'split_by_eol': ''}, \"vital#_cmp#function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
|
|
delfunction s:_SID
|
|
" ___vital___
|
|
"
|
|
" normalize_eol
|
|
"
|
|
function! s:normalize_eol(text) abort
|
|
return substitute(a:text, "\r\n\\|\r", "\n", 'g')
|
|
endfunction
|
|
|
|
"
|
|
" split_by_eol
|
|
"
|
|
function! s:split_by_eol(text) abort
|
|
return split(a:text, "\r\n\\|\r\\|\n", v:true)
|
|
endfunction
|
|
|