From 5779a87d901da3f44991feb3a6480b1156c37f3f Mon Sep 17 00:00:00 2001 From: Jason Cheatham Date: Mon, 19 Nov 2018 22:49:41 -0500 Subject: Handle file paths with whitespace Wrap the path used for `stdin-filepath` in quotes. references #108 --- autoload/prettier.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'autoload/prettier.vim') diff --git a/autoload/prettier.vim b/autoload/prettier.vim index c703fba..dc42ee0 100644 --- a/autoload/prettier.vim +++ b/autoload/prettier.vim @@ -324,9 +324,9 @@ function! s:Get_Prettier_Exec_Args(config) abort \ get(a:config, 'configPrecedence', g:prettier#config#config_precedence) . \ ' --prose-wrap ' . \ get(a:config, 'proseWrap', g:prettier#config#prose_wrap) . - \ ' --stdin-filepath ' . + \ ' --stdin-filepath "' . \ simplify(expand('%:p')) . - \ ' --loglevel error '. + \ '" --loglevel error '. \ ' --stdin ' return l:cmd endfunction -- cgit v1.3 From 14d3be088c95e70a41ef69ec4cd65ff4ab32503d Mon Sep 17 00:00:00 2001 From: Jason Cheatham Date: Mon, 19 Nov 2018 22:57:22 -0500 Subject: Don't modify next argument line --- autoload/prettier.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'autoload/prettier.vim') diff --git a/autoload/prettier.vim b/autoload/prettier.vim index dc42ee0..a957e60 100644 --- a/autoload/prettier.vim +++ b/autoload/prettier.vim @@ -325,8 +325,8 @@ function! s:Get_Prettier_Exec_Args(config) abort \ ' --prose-wrap ' . \ get(a:config, 'proseWrap', g:prettier#config#prose_wrap) . \ ' --stdin-filepath "' . - \ simplify(expand('%:p')) . - \ '" --loglevel error '. + \ simplify(expand('%:p')) . '"' . + \ ' --loglevel error '. \ ' --stdin ' return l:cmd endfunction -- cgit v1.3