aboutsummaryrefslogtreecommitdiff
path: root/autoload/prettier.vim
diff options
context:
space:
mode:
authorHyeon Kim <simnalamburt@gmail.com>2020-02-09 04:06:15 +0900
committerHyeon Kim <simnalamburt@gmail.com>2020-02-09 04:08:21 +0900
commit8a3fa163dcf78a23fcace64f675365ab47fee1b8 (patch)
treeeb9f4b818aa90ab9217e743ebfb0463afccd52c9 /autoload/prettier.vim
parent56fb126b73516756ab71c1c71b888b3b36bcf3fe (diff)
downloadvim-prettier-8a3fa163dcf78a23fcace64f675365ab47fee1b8.tar.xz
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.
Diffstat (limited to 'autoload/prettier.vim')
-rw-r--r--autoload/prettier.vim4
1 files changed, 3 insertions, 1 deletions
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