Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: support preserving focus with on_result_diagnostics_quickfix #234

Closed
jpetrie opened this issue Nov 25, 2023 · 3 comments
Closed
Labels
enhancement New feature or request good first issue Good for newcomers P2 Not a priority. PRs welcome

Comments

@jpetrie
Copy link
Contributor

jpetrie commented Nov 25, 2023

Using on_result_diagnostics_quickfix with open set to true causes the quickfix list to open and take focus, which can be distracting. I'd like to be able to configure Overseer to keep (or specifically, restore) the focus to the previous window once the quickfix list is opened. I don't see a way to do this currently, but digging around the source it looks like the desired behavior is obtainable simply by appending " | wincmd p" to the command used to open the list.

Plumbing this through properly (with an option such a keep_focus that defaults to false to preserve existing behavior) doesn't seem that involved, so if this is a feature that seems acceptable I'd be happy to send a PR for it. If on the other hand there's a way to do this already that I've missed, please let me know.

@jpetrie jpetrie changed the title feature: supporting preserving focus with on_result_diagnostics_quickfix feature: support preserving focus with on_result_diagnostics_quickfix Nov 25, 2023
@stevearc stevearc added enhancement New feature or request good first issue Good for newcomers P2 Not a priority. PRs welcome labels Nov 30, 2023
@stevearc
Copy link
Owner

Adding another parameter to control this sounds reasonable. It may be more complicated than just adding wincmd p because if the quickfix is already open prior to that command, we don't want to switch back to the previous window. Might make more sense to just store current window and restore it via lua API

@jpetrie
Copy link
Contributor Author

jpetrie commented Nov 30, 2023

I realized the same thing when I went to implement it; the PR I submitted in #237 does exactly that (the same way on_output_quickfix works, basically).

@jpetrie
Copy link
Contributor Author

jpetrie commented Dec 5, 2023

#237 was merged and addresses this. Thank you!

@jpetrie jpetrie closed this as completed Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers P2 Not a priority. PRs welcome
Projects
None yet
Development

No branches or pull requests

2 participants