1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 07:00:05 +08:00
SpaceVim/bundle/clever-f.vim/autoload/clever_f/compat.vim
2022-04-08 23:52:26 +08:00

31 lines
773 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
if exists('*reg_executing')
function! clever_f#compat#reg_executing() abort
return reg_executing()
endfunction
else
" reg_executing() was introduced at Vim 8.2.0020 and Neovim 0.4.0
function! clever_f#compat#reg_executing() abort
return ''
endfunction
endif