ghostbuster91 / nvim-next

Apache License 2.0
29 stars 6 forks source link

Diagnostics integration does not work #16

Closed aitvann closed 1 year ago

aitvann commented 1 year 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 1 year 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 1 year ago

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