mirror of
https://github.com/dense-analysis/ale.git
synced 2026-11-01 18:12:16 +08:00
#756 Escape the paths used for the --include parameter for gometalinter, which uses RE2
This commit is contained in:
1 parent
d12e990f73
commit
340c0bbac5
4 files changed
+14
-4
No files matched your search
@@ -161,3 +161,9 @@ function! ale#util#FunctionArgCount(function) abort
|
||||
|
||||
return l:count
|
||||
endfunction
|
||||
|
||||
" Escape a string so the characters in it will be safe for use inside of PCRE
|
||||
" or RE2 regular expressions without characters having special meanings.
|
||||
function! ale#util#EscapePCRE(unsafe_string) abort
|
||||
return substitute(a:unsafe_string, '\([\-\[\]{}()*+?.^$|]\)', '\\\1', 'g')
|
||||
endfunction
|
||||
Reference in new issue
Block a user