summaryrefslogtreecommitdiff
path: root/autoload/ale.vim
diff options
context:
space:
mode:
Diffstat (limited to 'autoload/ale.vim')
-rw-r--r--autoload/ale.vim11
1 files changed, 11 insertions, 0 deletions
diff --git a/autoload/ale.vim b/autoload/ale.vim
index c8fbfdfc..189f1e46 100644
--- a/autoload/ale.vim
+++ b/autoload/ale.vim
@@ -123,3 +123,14 @@ function! ale#Var(buffer, variable_name) abort
return getbufvar(str2nr(a:buffer), l:full_name, g:[l:full_name])
endfunction
+
+" Escape a string suitably for each platform.
+" shellescape() does not work on Windows.
+function! ale#Escape(str) abort
+ if fnamemodify(&shell, ':t') ==? 'cmd.exe'
+ " FIXME: Fix shell escaping for Windows.
+ return fnameescape(a:str)
+ else
+ return shellescape(a:str)
+ endif
+endfunction