1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-14 15:19:12 +08:00

fix(chinese): add function() wrapper

This commit is contained in:
wsdjeg 2022-01-03 13:11:33 +08:00
parent ab91988eff
commit 6e5bc9da6c

View File

@ -154,3 +154,20 @@ function! s:Chinese2Digit(cnDigitString) abort
endif
return result
endfunction
" function() wrapper
if v:version > 703 || v:version == 703 && has('patch1170')
function! s:_function(fstr) abort
return function(a:fstr)
endfunction
else
function! s:_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
endfunction
let s:_s = '<SNR>' . s:_SID() . '_'
function! s:_function(fstr) abort
return function(substitute(a:fstr, 's:', s:_s, 'g'))
endfunction
endif
" vim:set et nowrap sw=2 cc=80: