1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 20:50:04 +08:00
SpaceVim/bundle/clever-f.vim/autoload/clever_f/compat.vim

20 lines
478 B
VimL
Raw Normal View History

2020-06-13 14:06:35 +08:00
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