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

feat: add TroubleJump custom event for autocmds #248

Closed
wants to merge 6 commits into from
Closed

Conversation

nerdo
Copy link

@nerdo nerdo commented Jan 10, 2023

This minor change adds a custom TroubleJump event whenever the function is called.

This makes it possible for it to be easily customized to do something like the following to, for example, trigger the floating diagnostic so that one can immediately see more context as one navigates through the jump list:

vim.api.nvim_create_autocmd("User", {
	pattern = "TroubleJump",
	callback = function()
		-- Open the diagnostic float after 300ms.
		vim.schedule(function()
			vim.cmd("lua vim.diagnostic.open_float()")
		end, 300)
	end,
})

@folke folke closed this in d91f3b3 Jul 22, 2023
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

Successfully merging this pull request may close these issues.

None yet

1 participant