feature: persistence / save to file
Did you check the docs?
- [x] I have read all the trouble.nvim docs
Is your feature request related to a problem? Please describe.
When I close Neovim, the view is lost. I often edit a view using delete (dd), or trouble_add https://github.com/folke/trouble.nvim/blob/85bedb7eb7fa331a2ccbecb9202d8abba64d37b3/lua/trouble/sources/snacks.lua#L110
The view act as my to-do list. But noevim crash some time, so the editions made to the view are lost.
Describe the solution you'd like
An API like require("trouble").save(filename, opts) to save a view to a file.
Describe alternatives you've considered
Use quickfix list with romainl/vim-qf plugin. But it is hard to keep it in sync with trouble.
Additional context
No response
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
not stale
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
I actually want the "opposite" feature, which would be the ability to load from an arbitrary file. The other day I ran eslint . > lint-results.txt at the commandline, outside of neovim, and wanted to load the lint-results.txt into the trouble window later on. I couldn't find an obvious way to do that.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Not stale. It's a feature request! Feature requests should never be marked as stale, IMHO.
Edit: Correction. Feature requests should never be automatically marked as stale due to lack of comments. The nature of feature requests is that they are made, then they sit there until the author has time to look at them. A lack of comment activity does not correlate to a lack of interest in the feature; rather, it means that people don't want to spam the issue comments. Having a bot auto-mark feature requests as stale just results in more useless, bordering-on-spam comments being made because the system forces users to do that.
In other words, this comment of mine adds NO value to the discussion of the feature, and borders on being spam. Yet I'm forced to add it so that the feature request won't be closed. This is silly, causes everyone subscribed to the feature to get unnecessary email/notifications, and should not be needed.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Not stale.
@folke - I understand why overworked maintainers use stalebots to keep their issues trimmed down to a manageable number. But it would be nice if the stalebot was set to have a higher inactivity count than 30 days, especially at times when the maintainer goes traveling and is absent for several months. You're going to come back from your travels with a bunch of issues that have been spammed for no good reason except to keep the stalebot away. (And, if I may offer a suggestion: issues tagged with "enhancement" should probably be excluded from stalebot consideration altogether: feature requests should never be closed as stale.)
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Not stale.
@rmunn Loading entries into the quickfix list is already supported in (neo)vim natively! You can load a file in the quickfix supported format using :cfile [file-name] as long as it is in the quickfix list format.
eslint's error format won't be parseable by :cfile by default, so you'll have to modify the errorformat option to get it to work. You can just use the compiler option which sets it up automatically - :compiler eslint.
Then you can run :cfile lint-results.txt, and open trouble with the quickfix list (:Trouble quickfix).
(Check out the help pages for the :make command: https://neovim.io/doc/user/quickfix.html#_4.-using-:make, and the compiler and errorformat options: https://neovim.io/doc/user/quickfix.html#_7.-the-error-format). This gist was also helpful for me: https://gist.github.com/romainl/ce55ce6fdc1659c5fbc0f4224fd6ad29)
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Not stale.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Not stale.