onsails / diaglist.nvim

Live render workspace diagnostics in quickfix with current buf errors on top, buffer diagnostics in loclist
184 stars 5 forks source link

diaglist.nvim does not populate :copen only after open_all_diagnostics #11

Open balazser opened 2 years ago

balazser commented 2 years ago

Hi @onsails, Thank you for your plugin. I use it with the sample config:

lua require("diaglist").init({
    debug = false, 
    debounce_ms = 150,
})

I noticed the quickfix only populated after I call lua require('diaglist').open_all_diagnostics() which sets the window title and in this way lets the vim.fn.getqflist{ title = 0 }.title ~= check to pass. So currently, I always get the print('foreign quickfix, not populating') message for using :copen. I'm wondering why does it work like this? Should the README point it out?

dmfay commented 4 months ago

Much, much later, but you can override the function to populate the quickfix list without checking:

lua <<EOF
local Q = require("diaglist.quickfix")
Q.diagnostics_hook = function()
  Q.change_since_render = true
  Q.debounced_populate_qflist()
end
require("diaglist").init({})
EOF