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

fix(quickfix list): avoid clobbering existing lists #331

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

davidmh
Copy link
Contributor

@davidmh davidmh commented Dec 13, 2024

I've found a small issue with the quickfix list integration.

Setting the replace flag when sending grug-far results into the quickfix list truncates existing results. That's a problem because the quickfix list keeps a history of all the lists generated during the session, and you can navigate the history with :cprev and :cnext. Which means that populating the list from grug overtakes whatever list is currently displaying.

For example, imagine you have the lists in :chistory

order title
1 LSP references
2 Some other plugin list
* 3 LSP references

Then you navigate back to see the second list with :cprev.

order title
1 LSP references
* 2 Some other plugin list
3 LSP references

Then you use grug-far and send the results to the list:

order title
1 LSP references
* 2 Grug FAR results for: someString
3 LSP references

Now I've lost Some other plugin list.

Inserting a brand new entry seems like the desired behavior, not only prevents clobbering existing lists, but also helps you navigate previous grug-far results without opening the grug-far ui first.

@davidmh davidmh requested a review from MagicDuck as a code owner December 13, 2024 00:20
Copy link
Owner

@MagicDuck MagicDuck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you meant :colder instead of :cprev but good catch in any case. Thank you for the fix! Much appreciate! 😄

@MagicDuck MagicDuck merged commit eadd3c4 into MagicDuck:main Dec 13, 2024
5 checks passed
@davidmh
Copy link
Contributor Author

davidmh commented Dec 13, 2024

Yeah, you're right, I went by (faulty) memory as I have already mapped those commands to < and > in the quickfix buffer 😅

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

Successfully merging this pull request may close these issues.

2 participants