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

Unpleasent error message on compilation failure when vim.g.vimtex_quickfix_mode = 0 #2844

Closed
aabbccddeeffggj opened this issue Dec 2, 2023 · 3 comments
Labels

Comments

@aabbccddeeffggj
Copy link

aabbccddeeffggj commented Dec 2, 2023

Description

  1. When having "vim.g.vimtex_quickfix_mode = 0" + autocommand for opening up Trouble on compilation failures + Compilation failure, errors pops in front of the window.

  2. Error:

Error detected while processing function <SNR>69_callback_nvim_output[8]..<SNR>69_check_callback[4]..vimtex#compiler#callback:
line   49:
E121 Undefined variable: b:vimtex
  1. Image of the error:
    image

  2. I would like to not have my window blocked by this error, I have set Trouble (in quickfix mode) to pop up and show the compilation errors (Observation: Trouble indeed pops up, but only after after closing this window).

  3. Options I did set:

vim.g.vimtex_syntax_conceal_disable = 1
vim.g.vimtex_view_method = 'zathura'
vim.g.vimtex_view_forward_search_on_start = 0
vim.g.vimtex_quickfix_mode = 0
  1. Autocommand I set for Trouble:
autocmd('User', {
    pattern = 'VimtexEventCompileFailed',
    callback = function()
        require('trouble').open('quickfix')
    end,
})

Steps to reproduce

  1. Set vim.g.vimtex_quickfix_mode = 0
  2. Have trouble
  3. set the the autocommand I previously showed.
  4. Compile a tex file with syntactic errors.

Expected behavior

My window not get blocked by this unusual error.

Actual behavior

My window gets blocked by this unusual error.

Do you use a latexmkrc file?

Yes

VimtexInfo

The only thing I have in the file is `$pdf_mode = 4;`
@lervag
Copy link
Owner

lervag commented Dec 3, 2023

  1. Autocommand I set for Trouble:
autocmd('User', {
    pattern = 'VimtexEventCompileFailed',
    callback = function()
        require('trouble').open('quickfix')
    end,
})

The problem here is that the trouble function is changing the buffer. I didn't think that people would do that. I'm pushing a change that I think fixes it. Please test.

lervag added a commit that referenced this issue Dec 3, 2023
@lervag lervag closed this as completed Dec 3, 2023
@aabbccddeeffggj
Copy link
Author

It's fixed now, thanks a lot; also pretty quick.

@lervag
Copy link
Owner

lervag commented Dec 3, 2023

Glad to hear it works now :)

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

No branches or pull requests

2 participants