From a0ab8e9b30022d00f5e6fa82a0204846c99b485b Mon Sep 17 00:00:00 2001 From: mitermayer Date: Sun, 25 Mar 2018 15:08:37 -0700 Subject: Updating the logic for controlling the quickfix flag - Negation flags are usually more confusing to understand specially when the default is having it enabled. --- README.md | 5 ++--- autoload/prettier.vim | 2 +- doc/prettier.txt | 5 ++--- plugin/prettier.vim | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b7f7741..226bdf8 100644 --- a/README.md +++ b/README.md @@ -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, , ) -- cgit v1.3