aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload/option.vim
blob: d203dfe8c1cfb63203f7590879a51f792adddc6e (plain) (blame)
1
2
3
4
5
6
7
8
function! option#Split(expr, ...) abort
  if a:0 > 1
    echoerr 'Too many arguments'
  endif
  let keepempty = a:0 ? a:1 : 0
  let parts = split(a:expr, '\\\@<!,[, ]*', keepempty)
  return map#(parts, 'substitute(v:val, ''\\,'', '','', ''g'')')
endfunction