Skip to content

Commit b5665c7

Browse files
committed
Rename hide_build_panel to show_panel_on_build
This commit renames hide_build_panel setting to what ST's default settings provide to control whether to show build panel on build. Primary target is to remove duplicate negation of wording and to clarify the meaning of the setting and the functionality behind it.
1 parent 1008607 commit b5665c7

File tree

4 files changed

+35
-37
lines changed

4 files changed

+35
-37
lines changed

LaTeXTools.sublime-settings

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -455,34 +455,32 @@
455455
// Build panel and phantoms settings
456456
// ------------------------------------------------------------------
457457

458-
// Syntax highlight build panel so that errors, warnings, etc.
459-
// show up in different colors.
460-
"highlight_build_panel": true,
461-
462458
// Enable automatic word wraping in build output panel.
463459
"build_panel_word_wrap": false,
464460

461+
// Syntax highlight build output panel so that errors, warnings, etc.
462+
// show up in different colors.
463+
"highlight_build_panel": true,
464+
465465
// Scroll build output panel to top after build finished.
466466
"scroll_build_panel_to_top": false,
467467

468-
// OPTION: "hide_build_panel"
469-
// Controls when the LaTeX build panel is hidden after a build finishes.
470-
// Default: "no_warnings"
468+
// Controls whether or not to display any bad boxes in the build output.
469+
// If not set to true, the setting "badboxes" for "show_panel_on_build" is
470+
// equivalent to "warnings"
471+
"display_bad_boxes": false,
472+
473+
// Controls when the LaTeX build panel is displayed after a build finishes.
474+
// Default: "badboxes"
471475
//
472476
// Possible values are:
473-
// "always" — always hide the panel, even if the build failed.
474-
// "no_errors" — hide the panel if there are no errors.
475-
// "no_warnings" — hide the panel if there are neither errors nor warnings.
476-
// "no_badboxes" — hide the panel if there are no errors, warnings, or badboxes
477-
// (when badbox reporting is enabled).
478-
// "never" — never hide the panel.
479-
"hide_build_panel": "no_badboxes",
480-
481-
// OPTION: "display_bad_boxes"
482-
// controls whether or not to display any bad boxes in the build output
483-
// if this is not set to true, the setting "no_badboxes" for
484-
// "hide_build_panel" is equivalent to "no_warnings"
485-
"display_bad_boxes": false,
477+
// "never" — never show build panel.
478+
// "errors" — show build panel if there are errors.
479+
// "warnings" — show build panel if there are errors or warnings.
480+
// "badboxes" — show build panel if there are errors, warnings, or badboxes
481+
// (when badbox reporting is enabled).
482+
// "always" — always show build panel, even if the build failed.
483+
"show_panel_on_build": "badboxes",
486484

487485
// OPTION: "show_error_phantoms"
488486
// (ST3, Build 3118+ only)

docs/keybindings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ This opens a quick panel displaying the current toggle values and their correspo
6363

6464
**Keybinding:** <kbd>shift+escape</kbd>
6565

66-
This will show the LaTeXTools build panel, including any messages from the previous build. This is useful if you have hidden the build panel, either using the `hide_build_panel` setting or by pressing <kbd>escape</kbd> when the panel is visible.
66+
This will show the LaTeXTools build panel, including any messages from the previous build. This is useful if build panel is not shown automatically due to `show_panel_on_build` setting or hidden by pressing <kbd>escape</kbd>.
6767

6868
## Removing temporary files from build
6969

docs/settings.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ This section refers to setting that can be found in a platform-specific block fo
129129
* `highlight_build_panel` (`true`): if `true` the build panel will have a syntax applied to highlight any errors and warnings. Otherwise, the standard output panel configuration will be used.
130130
* `build_panel_word_wrap` (`false`): if `true` enable word wrapping in build output panel.
131131
* `scroll_build_panel_to_top` (`false`): if `true` the build output panel is scrolled to top after build finished.
132-
* `hide_build_panel` (`"no_badboxes"`): controls whether or not to hide the build panel after a build is finished. Possible values:
133-
* `"always"`: always hide the panel, even if build failed.
134-
* `"no_errors"`: hide the panel if there are no errors.
135-
* `"no_warnings"`: hide the panel if there are neither errors nor warnings.
136-
* `"no_badboxes"`: hide the panel if there are no errors, warnings, or badboxes; differs from `no_warnings` if `display_bad_boxes` is set to `true`.
137-
* `"never"`: never hide the build panel.
132+
* `show_panel_on_build` (`"badboxes"`): controls when build output panel is displayed. Possible values:
133+
* `"always"`: always show build panel.
134+
* `"errors"`: show build panel if there are errors.
135+
* `"warnings"`: show build panel if there are errors or warnings.
136+
* `"badboxes"`: show build panel if there are errors, warnings, or badboxes; differs from `"warnings"` if `display_bad_boxes` is set to `true`.
137+
* `"never"`: never show build panel, even if build failed.
138138
Any other value will be interpreted as the default.
139139
* `display_bad_boxes` (`false`): if `true` LaTeXTools will display any bad boxes encountered after a build. Note that this is disabled by default.
140140
* `show_error_phantoms` (`"warnings"`): **ST3 Build 3118 or newer only** controls which errors are displayed via phantoms. Possible values:

latextools/make_pdf.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def worker(self, activity_indicator):
195195
# Note: At least latexmk is known to behave like that.
196196
message = "Build failed!" if aborted else "Build skipped!"
197197
activity_indicator.finish(message)
198-
if aborted or self.caller.hide_panel_level == "never":
198+
if aborted or self.caller.show_panel_level == "always":
199199
self.caller.show_output_panel()
200200
self.caller.output(f"\n[{message}]")
201201
self.caller.finish(aborted == False)
@@ -255,14 +255,14 @@ def worker(self, activity_indicator):
255255
content.append(log_file + ":1: Double-click here to open the full log.")
256256

257257
show_panel = {
258-
"always": False,
259-
"no_errors": bool(errors),
260-
"no_warnings": bool(errors or warnings),
261-
"no_badboxes": bool(
258+
"always": True,
259+
"errors": bool(errors),
260+
"warnings": bool(errors or warnings),
261+
"badboxes": bool(
262262
errors or warnings or (self.caller.display_bad_boxes and badboxes)
263263
),
264-
"never": True,
265-
}.get(self.caller.hide_panel_level, bool(errors or warnings))
264+
"never": False,
265+
}.get(self.caller.show_panel_level, bool(errors or warnings))
266266

267267
message = "Build completed"
268268
if show_panel:
@@ -431,8 +431,8 @@ def run(
431431

432432
self.output_view.set_read_only(True)
433433

434-
self.hide_panel_level = get_setting("hide_build_panel", "no_badboxes", view)
435-
if self.hide_panel_level == "never":
434+
self.show_panel_level = get_setting("show_panel_on_build", "badboxes", view)
435+
if self.show_panel_level == "always":
436436
self.show_output_panel(force=True)
437437

438438
self.plat = sublime.platform()
@@ -571,7 +571,7 @@ def output(self, data):
571571
)
572572

573573
def show_output_panel(self, force=False):
574-
if force or self.hide_panel_level != "always":
574+
if force or self.show_panel_level != "never":
575575
self.window.run_command("show_panel", {"panel": "output.latextools"})
576576

577577
# Also from exec.py

0 commit comments

Comments
 (0)