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

Maintain current selection after leaving quickfix window #6

Open
tfgast opened this issue Oct 8, 2021 · 4 comments
Open

Maintain current selection after leaving quickfix window #6

tfgast opened this issue Oct 8, 2021 · 4 comments

Comments

@tfgast
Copy link

tfgast commented Oct 8, 2021

Excellent plugin!
One small annoyance I've noticed is that when I leave the quickfix window, it no longer maintains the current selection and the top item is selected instead.

@onsails
Copy link
Owner

onsails commented Oct 13, 2021

Good idea! I'll take a look into it.

@jfly
Copy link

jfly commented Sep 22, 2024

(Sorry for the necrobump) This still seems to be happening. @onsails, did you ever figure this out?

@jfly
Copy link

jfly commented Oct 8, 2024

I dug into this, and this does't really seem to be diaglist.nvim's fault. It's just the way that Neovim behaves when you update the quickfix list (which diaglist.nvim does a lot of, not just when selecting an item int he quickfix list).

I think we could rework diaglist.nvim to refresh the quickfix list less often (for example, there's not really a good reason to refresh the list when selecting an item, it's not possible for the diagnostics to change when you do that), but the general issue remains: at some point, you're going to address a diagnostics, and then you're going to lose your position in the quickfix list.

I wrote this plugin to that tries to preserve your location updates in the quickfix list: https://github.com/jfly/sticky-quickfix.nvim. It's probably not perfect.

I also filed neovim/neovim#30724 with Neovim core to see if they'd be willing to change the behavior here, or perhaps make it possible to write a more correct plugin than the monkeypatching hack I had to do.

@jfly
Copy link

jfly commented Oct 19, 2024

Some updates here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants