diff options
| -rw-r--r-- | README.md | 5 | ||||
| -rw-r--r-- | autoload/prettier.vim | 2 | ||||
| -rw-r--r-- | doc/prettier.txt | 5 | ||||
| -rw-r--r-- | plugin/prettier.vim | 2 |
4 files changed, 6 insertions, 8 deletions
@@ -129,11 +129,10 @@ By default parsing errors will open the quickfix but can also be disabled let g:prettier#quickfix_enabled = 0 ``` -Have the cursor returned to its original window after the quickfix window is -shown. +By default we auto focus on the quickfix when there are errors but can also be disabled ```vim -let g:prettier#no_focus_quicklist = 0 +let g:prettier#quickfix_auto_focus = 0 ``` To enable vim-prettier to run in files without requiring the "@format" doc tag. diff --git a/autoload/prettier.vim b/autoload/prettier.vim index 5f48033..4b5a4e9 100644 --- a/autoload/prettier.vim +++ b/autoload/prettier.vim @@ -251,7 +251,7 @@ function! s:Handle_Parsing_Errors(out) abort let l:winnr = winnr() call setqflist(l:errors, 'r') botright copen - if g:prettier#no_focus_quicklist + if !g:prettier#quickfix_auto_focus " Return the cursor back to the main buffer. exe l:winnr . 'wincmd w' endif diff --git a/doc/prettier.txt b/doc/prettier.txt index 41f43e0..ed074cf 100644 --- a/doc/prettier.txt +++ b/doc/prettier.txt @@ -109,10 +109,9 @@ By default parsing errors will open the quickfix but can also be disabled > let g:prettier#quickfix_enabled = 1 < -Have the cursor returned to its original window after the quickfix window is -shown. +By default we auto focus on the quickfix when there are errors but can also be disabled > - let g:prettier#no_focus_quicklist = 0 + let g:prettier#quickfix_auto_focus = 0 < To enable vim-prettier to run in files without requiring the "@format" doc tag. First disable the default autoformat, then update to your own custom behaviour diff --git a/plugin/prettier.vim b/plugin/prettier.vim index b4ff4b0..da008fe 100644 --- a/plugin/prettier.vim +++ b/plugin/prettier.vim @@ -70,7 +70,7 @@ let g:prettier#config#config_precedence = get(g:, 'prettier#config#config_preced let g:prettier#config#prose_wrap = get(g:, 'prettier#config#prose_wrap', 'preserve') " Don't leave the quicklist focused on error. -let g:prettier#no_focus_quicklist = get(g:, 'prettier#no_focus_quicklist', 0) +let g:prettier#quickfix_auto_focus = get(g:, 'prettier#quickfix_auto_focus', 1) " synchronous by default command! -nargs=? -range=% Prettier call prettier#Prettier(g:prettier#exec_cmd_async, <line1>, <line2>) |
