don't change focus to the quicklist#122
don't change focus to the quicklist#122mitermayer merged 1 commit intoprettier:masterfrom docwhat:pr/no-focus-quickfix
Conversation
|
Hi @docwhat, Thanks for submitting this PR, I on the other hand like the auto focus on the quicklist and see it as a good feature, a lot of the times i want to go straight to the place where things are broken so that i can fix it. I also agree that other people may prefer the behaviour your described above, I wonder if we should make this configurable. What are your thoughts around it ? thank you a lot for submitting this by the way, just want to make sure we can find a solution that can work well for everyone |
|
Configurable sounds good. |
Add an option to restore the cursor's window & position after calling `setqflist()`.
|
If you can add configuration for this and keep the normal defaults I will then be able to merge this PR. To add a new configuration you need to:
let g:prettier#quickfix_auto_focus = get(g:, 'prettier#quickfix_auto_focus', 1)
Onc ethe above is done I will manually check on all supported vim versions and if all is good will merge it! Once again thank you for the PR ! |
|
I’m confused. I did that last night. Do you want me to change the name of the variable? |
|
Hi @docwhat, Sorry I probably commented on a cached page, it was not updated when I saw! This is awesome! Will test this out and merge it as soon as I get home! Thank you for your contributions !! |
mitermayer
left a comment
There was a problem hiding this comment.
Just tested this and it all seemed to work just fine with the exception of the flag being inverted, will merge this and fix this on a following commit
| let l:winnr = winnr() | ||
| call setqflist(l:errors, 'r') | ||
| botright copen | ||
| if !g:prettier#no_focus_quicklist |
There was a problem hiding this comment.
Should this line instead be ?
if g:prettier#no_focus_quicklist|
|
By default setqflist focuses the quicklist, which is annoying.
This restores the cursor position after calling setqflist.