blob: ee92101fce3d96ec87f28ec3558b129856eaafa9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
" Escape a single item for a comma-separated list, optionally escaping any
" filename wildcards
"
function! option#item#Escape(item, ...) abort
if a:0 > 1
echoerr 'Too many arguments'
endif
let item = a:item
let wild = a:0 ? a:1 : 0
if wild
let item = escape(item, '\*?[{`''$~')
endif
return escape(item, ',')
endfunction
|