Skip to content
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

[Feature] some external function #44

Closed
windwp opened this issue Jun 4, 2021 · 3 comments
Closed

[Feature] some external function #44

windwp opened this issue Jun 4, 2021 · 3 comments

Comments

@windwp
Copy link

windwp commented Jun 4, 2021

How do I move to the next item on trouble but my current buffer is not in trouble? If i use quick fix i can do that.
I want display the total error warning and hint in my custom statusline for filetype. Can you expose some function to get that data.
Thank you.

@folke
Copy link
Owner

folke commented Jun 4, 2021

You want to go to the location of the next/previous trouble item?

You can do this by first advancing the current item and then triggering a jump, like this:

:lua require("trouble").action("next"); require("trouble").action("jump")

If you just want to move to the prev/next diagnostics item, then I would recommend you to use the built-in LSP functionlaity. See https://github.com/neovim/nvim-lspconfig#keybindings-and-completion

The best way to get diagnostic counts is to use the built-in vim.lsp.diagnostic.get_count API, or use vim.lsp.diagnostic.get_all and count the things you need.

@windwp
Copy link
Author

windwp commented Jun 4, 2021

:lua require("trouble").action("next"); require("trouble").action("jump")
It work but if It jump to a fold . It will close fold too.
I only want to jump to a next todo :)

How about to display the todo total item.

image

folke added a commit that referenced this issue Jun 17, 2021
@folke
Copy link
Owner

folke commented Jun 17, 2021

I just added this. Please refer to the documentation to use it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants