mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 15:50:04 +08:00
20 lines
478 B
VimL
20 lines
478 B
VimL
|
if exists('*strchars')
|
||
|
function! clever_f#compat#strchars(str) abort
|
||
|
return strchars(a:str)
|
||
|
endfunction
|
||
|
else
|
||
|
function! clever_f#compat#strchars(str) abort
|
||
|
return strlen(substitute(a:str, '.', 'x', 'g'))
|
||
|
endfunction
|
||
|
endif
|
||
|
|
||
|
if exists('*xor')
|
||
|
function! clever_f#compat#xor(a, b) abort
|
||
|
return xor(a:a, a:b)
|
||
|
endfunction
|
||
|
else
|
||
|
function! clever_f#compat#xor(a, b) abort
|
||
|
return a:a && !a:b || !a:a && a:b
|
||
|
endfunction
|
||
|
endif
|