summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorJelte Fennema <github-tech@jeltef.nl>2018-01-07 13:11:01 +0100
committerw0rp <w0rp@users.noreply.github.com>2018-01-07 12:11:01 +0000
commitb6d1c419255d335a1e87a5eb32fd910081fa16ac (patch)
treed052512bc99cd95432cdc08dec5fac4e7e29842a /autoload
parentc9d66b861b4593e1797cedd302a2203bd7110a99 (diff)
downloadale-b6d1c419255d335a1e87a5eb32fd910081fa16ac.zip
Go: Add gotype support (#1099)
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/util.vim7
1 files changed, 7 insertions, 0 deletions
diff --git a/autoload/ale/util.vim b/autoload/ale/util.vim
index 1f590adc..b94a11b7 100644
--- a/autoload/ale/util.vim
+++ b/autoload/ale/util.vim
@@ -236,6 +236,13 @@ function! ale#util#EscapePCRE(unsafe_string) abort
return substitute(a:unsafe_string, '\([\-\[\]{}()*+?.^$|]\)', '\\\1', 'g')
endfunction
+" Escape a string so that it can be used as a literal string inside an evaled
+" vim command.
+function! ale#util#EscapeVim(unsafe_string) abort
+ return "'" . substitute(a:unsafe_string, "'", "''", 'g') . "'"
+endfunction
+
+
" Given a String or a List of String values, try and decode the string(s)
" as a JSON value which can be decoded with json_decode. If the JSON string
" is invalid, the default argument value will be returned instead.