aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-04-05 21:59:14 +1200
committerTom Ryder <tom@sanctum.geek.nz>2020-04-05 22:05:52 +1200
commit0350f6c03d8b9d31e25999a31e230722b3815080 (patch)
tree1d287b898de0fd813e44628115202520ce9c7064 /vim/autoload
parentCheck for existence of 'colorcolumn' option (diff)
downloaddotfiles-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.vim8
-rw-r--r--vim/autoload/option.vim6
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