From 8a3fa163dcf78a23fcace64f675365ab47fee1b8 Mon Sep 17 00:00:00 2001 From: Hyeon Kim Date: Sun, 9 Feb 2020 04:06:15 +0900 Subject: New option: prettier#autoformat_require_pragma The 'prettier#autoformat_config_present' option is useful but it only worked with files with pragma. Now, you can use 'autoformat_config_present' even with files without pragma using this 'autoformat_require_pragma' option. --- autoload/prettier.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'autoload') diff --git a/autoload/prettier.vim b/autoload/prettier.vim index d4c3171..ebe6abd 100644 --- a/autoload/prettier.vim +++ b/autoload/prettier.vim @@ -36,7 +36,9 @@ endfunction " Allows @format and @prettier pragma support upon saving function! prettier#Autoformat(...) abort - call prettier#Prettier(1, 1, line('$'), 0, { 'requirePragma': 'true'}) + call prettier#Prettier(1, 1, line('$'), 0, { + \ 'requirePragma': g:prettier#autoformat_require_pragma ? 'true' : 'false' + \ }) endfunction " Main prettier command -- cgit v1.3