-
Notifications
You must be signed in to change notification settings - Fork 177
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
Keep Trouble window quickfix list up to date as the document is edited #201
Comments
Or, come to think of it, perhaps pressing |
Development on the main branch is EOL. Trouble has been rewritten and will be merged in main soon. This issue/feature either no longer exists or has been implemented on dev. For more info, see https://github.com/folke/trouble.nvim/tree/dev |
Allright, seems I didn't ready this fully. I'll see if this can be added. |
Ah, it is indeed refreshed when I call |
It actually already works. You can do |
Fixed |
It only updates on |
@folke If you delete lines between qflist results, trouble will throw errors, a simple gif showing that iShot_2024-05-30_22.52.26.mp4 |
@xzbdmw should be fixed now. I also fixed the event. It should only listen on changes on the main buffer, but it was listening on all buffer changes, inlcuding those of the trouble windows. |
Currently, using
:Trouble quickfix
with gives a worse developer experience than using the built-in quickfix window plus:cnext
/:cprevious
.The quickfix
:cnext
/:cprevious
commands will jump to the correct line even if you've added/deleted lines higher up in the document. However, Trouble withrequire("trouble").next/previous(...)
will jump to the exact line number from the quickfix list.Any time I fix a linter warning, jumping to the next linter warning will take me to an unrelated line, which is a massive pain. After a few fixes, the jump location may not even be anywhere near the location of the linter warning, making the Trouble quickfix list useless.
Should the locations in the Trouble quickfix window be kept up-to-date as lines are added/deleted from the document? This would make it much, much easier to work with. Are there any drawbacks to doing this?
The logic sounds pretty trivial, and it would have to run any time a line is added or deleted:
I'm not very familiar with writing plugins for Vim/NVim, but I assume there are autocommands that trigger on document edits and APIs for figuring out which lines were added/removed.
The text was updated successfully, but these errors were encountered: