1
votes

The build script in the LaTeXTools plugin for Sublime Text editor pops up the console, where the result of the compilation is written. I would like the console to auto-hide once the compilation is finished and there are no errors (and to stay open otherwise).

I knew how to achieve this with Sublime Text 2. (I think I inserted two lines sublime.active_window().run_command("show_panel", {"panel": "console", "toggle": True})) somewhere in the build script.)

How to achieve this behavior with Sublime Text 3?

How to (properly) achieve this behavior with Sublime Text 2?

3

3 Answers

2
votes

This functionality has now been added natively to the LaTeXTools package, using the hide_build_panel preference in the LaTeXTools settings file. Check the documentation.

There are four levels of hiding behavior available:

  • always
  • if there were no errors
  • if there were no errors or warnings
  • never

Extract from the documentation. Possible values:

  • always: never show the build panel at all
  • no_errors: only show the build panel if errors occur
  • no_warnings: only hide the panel if no warnings occur
  • no_badboxes: only hide the panel if no warnings or badbox messages occur; this only differs from no_warnings if display_bad_boxes is set to true.
  • never: never hide the build panel. Any other value will be interpreted as the default.
1
votes

I have no idea what I'm doing, but the following works reasonably well (LaTeXtools revision 2014-3-12).

In the file makePDF.py insert a line

self.window.run_command("hide_panel", {"panel": "output.exec"})

between lines no. 370 and 371 (the definition of the do_finish function).

This probably won't survive LaTeXtools package update..

0
votes
self.window.run_command("hide_panel", {"panel": "output.exec"})

I added this command in the run(self) method (makePDF.py) after in the "else" block, when asking for errors of the LaTeX run (line 177).

It works perfectly, but won't survive an LaTeXTools package update.