From 7ac46762931442491b13401411a1b4eb65272099 Mon Sep 17 00:00:00 2001 From: mitermayer Date: Thu, 12 Sep 2019 23:54:51 +0000 Subject: issues/184-fixing-undo-step - Adding support for require-pragma - Our previous undo implementation tried to be naive on implementing require-pragma, and created some undo bugs due to it. This diff enables us to use the prettier upstream support for require-pragma - On subsequent PR's we will completetly phase out the previous undo implementation in favour to this one in order to fix bug https://github.com/prettier/vim-prettier/issues/184 --- plugin/prettier.vim | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugin/prettier.vim') diff --git a/plugin/prettier.vim b/plugin/prettier.vim index 19b4002..d3bee5a 100644 --- a/plugin/prettier.vim +++ b/plugin/prettier.vim @@ -97,6 +97,9 @@ let g:prettier#config#arrow_parens = get(g:,'prettier#config#arrow_parens', 'avo " default: 'none' let g:prettier#config#trailing_comma = get(g:,'prettier#config#trailing_comma', 'none') +" restrict itself to only format files that contain a special comment @prettier or @format +let g:prettier#config#require_pragma= get(g:, 'prettier#config#require_pragma', 'false') + " synchronous by default command! -nargs=? -range=% Prettier call prettier#Prettier(g:prettier#exec_cmd_async, , , g:prettier#partial_format) -- cgit v1.3