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

Start compilation without toggle #1763

Closed
pseewald opened this issue Aug 3, 2020 · 2 comments
Closed

Start compilation without toggle #1763

pseewald opened this issue Aug 3, 2020 · 2 comments

Comments

@pseewald
Copy link
Contributor

pseewald commented Aug 3, 2020

Is your feature request related to a problem? Please describe it.
I use au User VimtexEventInitPost call vimtex#compiler#compile() in my vimrc to automatically start the compiler when opening a file. In this context vimtex#compiler#compile() should not toggle the compiler but only start it, since in a multifile project, I don't want to stop the compiler whenever I open a new file.

Describe the solution you'd like
This can be solved by providing a command or an option to vimtex#compiler#compile() for the following

  • start the compiler if it is not running
  • if the compiler is running, do nothing

Describe alternatives you've considered
This seems to work but is a bit awkward.

function MyVimtexCompile()
    if !b:vimtex.compiler.is_running()
        call vimtex#compiler#compile()
    endif
endfunction

augroup vimtex
    autocmd!
    au User VimtexEventInitPost call MyVimtexCompile()
augroup END
@lervag
Copy link
Owner

lervag commented Aug 3, 2020

Thanks. I've changed the API and added vimtex#compiler#start, which should suffice for your needs. Let me know how it works for you.

lervag added a commit that referenced this issue Aug 3, 2020
Previously, only a toggle was available with vimtex#compiler#compile().
With this one can start compilation or exit if it is already running
without stopping.

refer: #1763
@lervag lervag closed this as completed Aug 3, 2020
@pseewald
Copy link
Contributor Author

pseewald commented Aug 3, 2020

Perfect, thank you.

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

No branches or pull requests

2 participants