diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2020-04-05 21:59:14 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2020-04-05 22:05:52 +1200 |
commit | 0350f6c03d8b9d31e25999a31e230722b3815080 (patch) | |
tree | 1d287b898de0fd813e44628115202520ce9c7064 /vim/autoload | |
parent | Check for existence of 'colorcolumn' option (diff) | |
download | dotfiles-0350f6c03d8b9d31e25999a31e230722b3815080.tar.gz dotfiles-0350f6c03d8b9d31e25999a31e230722b3815080.zip |
Vim: Use more correct method of escaping :set RHS
Diffstat (limited to 'vim/autoload')
-rw-r--r-- | vim/autoload/argument.vim | 8 | ||||
-rw-r--r-- | vim/autoload/option.vim | 6 |
2 files changed, 6 insertions, 8 deletions
diff --git a/vim/autoload/argument.vim b/vim/autoload/argument.vim deleted file mode 100644 index 85d75eb1..00000000 --- a/vim/autoload/argument.vim +++ /dev/null @@ -1,8 +0,0 @@ -" Escape a single argument for use on an Ex command line; essentially -" a backport of fnameescape() for versions before v7.1.299 -" -function! argument#Escape(argument) abort - return exists('*fnameescape') - \ ? fnameescape(a:argument) - \ : escape(a:argument, "\n\r\t".' *?[{`$\%#''"|!<') -endfunction diff --git a/vim/autoload/option.vim b/vim/autoload/option.vim index 5ff44ced..c44cf94b 100644 --- a/vim/autoload/option.vim +++ b/vim/autoload/option.vim @@ -9,3 +9,9 @@ function! option#Split(expr, ...) abort let parts = split(a:expr, '\\\@<!,[, ]*', keepempty) return map(parts, 'substitute(v:val, ''\\,'', '','', ''g'')') endfunction + +" Escape the right-hand side of a :set option value +" +function! option#Escape(expr) abort + return escape(a:expr, ' |"\') +endfunction |