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:
parent
ab91988eff
commit
6e5bc9da6c
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user