Skip to content
Discussion options

You must be logged in to vote

I found the problem! When I open main.tex the LSP opens all of the referenced files in unlisted buffers so it can scan them and build its own map of the project. If I run :ls! I see all of the files in unlisted buffers. So the ToC is seeing that a buffer for that file already exists and jumps to it (I think).

I updated my LSP config to include this autocmd to the on_attach function which seems to fix it:

	{
		"texlab",
		enabled = nixCats("latex") or false,
		lsp = {
			filetypes = { "tex", "bib" },
			on_attach = function(client,bufnr)
                local group = vim.api.nvim_create_augroup("texlabunlistfix", { clear = true })
                vim.api.nvim_create_autocmd("BufEnter", {
 …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@JBlocklove
Comment options

@lervag
Comment options

@JBlocklove
Comment options

Comment options

You must be logged in to vote
1 reply
@lervag
Comment options

Answer selected by JBlocklove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants