aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitermayer <mitermayer.reis@gmail.com>2017-11-08 10:10:31 -0800
committermitermayer <mitermayer.reis@gmail.com>2017-11-08 10:10:31 -0800
commite7c458008bd6c56c881c7ab280395315761c4098 (patch)
treef9b42ff95e1f86ecb196814de603a935d568a912
parent8009900cdff668d0b7f84ebefe2b7f3ab817b779 (diff)
downloadvim-prettier-e7c458008bd6c56c881c7ab280395315761c4098.tar.xz
issues/76 - the shellescapping util function was breaking async
formatting - Removing this for now and will try to address this again in subsequent PRs
-rw-r--r--autoload/prettier.vim20
1 files changed, 1 insertions, 19 deletions
diff --git a/autoload/prettier.vim b/autoload/prettier.vim
index d8bbe16..52fae7d 100644
--- a/autoload/prettier.vim
+++ b/autoload/prettier.vim
@@ -258,7 +258,7 @@ function! s:Get_Prettier_Exec_Args(config) abort
\ ' --config-precedence ' .
\ get(a:config, 'configPrecedence', g:prettier#config#config_precedence) .
\ ' --stdin-filepath ' .
- \ prettier#Escape(simplify(expand("%:p"))) .
+ \ simplify(expand("%:p")) .
\ ' --stdin '
return l:cmd
endfunction
@@ -357,21 +357,3 @@ endfunction
function! s:Suggest_Install_Prettier() abort
echohl WarningMsg | echom 'Prettier: no prettier executable installation found.' | echohl NONE
endfunction
-
-" Borrowed from https://github.com/w0rp/ale/blob/master/autoload/ale.vim
-function! prettier#Escape(str) abort
- if fnamemodify(&shell, ':t') is? 'cmd.exe'
- " If the string contains spaces, it will be surrounded by quotes.
- " Otherwise, special characters will be escaped with carets (^).
- return substitute(
- \ a:str =~# ' '
- \ ? '"' . substitute(a:str, '"', '""', 'g') . '"'
- \ : substitute(a:str, '\v([&|<>^])', '^\1', 'g'),
- \ '%',
- \ '%%',
- \ 'g',
- \)
- endif
-
- return shellescape (a:str)
-endfunction