ghostbuster91 / nvim-next

Apache License 2.0
30 stars 6 forks source link

Diagnostics integration does not work #16

Closed aitvann closed 11 months ago

aitvann commented 11 months ago

I tried all of this

:lua require("nvim-next.integrations").diagnostic().goto_next({ severity = { min = vim.diagnostic.severity.HINT } })
:lua require("nvim-next.integrations").diagnostic().goto_next({ severity = { min = vim.diagnostic.severity.ERROR } })
:lua require("nvim-next.integrations").diagnostic().goto_next()

and my cursor isn't going anywhere. even tho just :lua vim.diagnostic.goto_next() works as expected. Treesitter text-objects and Gitsigns integrations work no problem

ghostbuster91 commented 11 months ago

Hi,

thanks for reporting. The problem is that this:

require("nvim-next.integrations").diagnostic().goto_next()

returns a function, so you need to call it one more time:

require("nvim-next.integrations").diagnostic().goto_next()()

I know, that is kind of not very intuitive but it was necessary so that we can pass some additional arguments like the severity.

Here are my bindings: https://github.com/ghostbuster91/dot-files/blob/d36a4f5045f5724b66a860fefd232516c50bf1fa/programs/neovim/init.lua#L142-L145

Let me know if this works for you and if you think that the documentation should be improved somehow.

aitvann commented 11 months ago

now I see. thank you for the answer and for an awesome plugin !