Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions LaTeXTools Build Output.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: 2
hidden: true

variables:
build_results: ^\[(?:Build (?:cancelled by user|failed|skipped)|Done)!\]$
build_results: ^\[(?:(?:Build (?:cancelled by user|failed|skipped))!|Finished in .+)\]$
log_file: ^((.+?)(?:(:)(\d+))?)(:)[ ](Double-click here to open the full log\.)$

contexts:
Expand Down Expand Up @@ -106,5 +106,5 @@ contexts:
scope: meta.summary.failure.build.latextools message.error.build.latextools
- match: ^\[Build cancelled by user!\]$\n?
scope: meta.summary.failure.build.latextools message.warning.build.latextools
- match: ^\[(?:Build skipped|Done)!\]$\n?
- match: ^\[(?:Build skipped!|Finished in .+)\]$\n?
scope: meta.summary.success.build.latextools message.info.build.latextools
13 changes: 12 additions & 1 deletion latextools/make_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import shutil
import signal
import threading
import time
import traceback

import sublime
Expand Down Expand Up @@ -60,6 +61,8 @@ def run(self):
self.worker(activity_indicator)

def worker(self, activity_indicator):
t1 = time.monotonic()

logger.debug(f"Welcome to thread {self.name}")
self.caller.output(
f"[Compiling '{self.caller.builder.tex_root}' with '{self.caller.builder.name}']\n"
Expand Down Expand Up @@ -306,7 +309,15 @@ def worker(self, activity_indicator):
traceback.print_exc()

self.caller.output(content)
self.caller.output("\n\n[Build failed!]" if aborted else "\n\n[Done!]")
if aborted:
self.caller.output("\n\n[Build failed!]")
else:
elapsed = time.monotonic() - t1
if elapsed >= 60:
elapsed = time.strftime("%M:%S", time.gmtime(elapsed))
else:
elapsed = f"{elapsed:0.1f}s"
self.caller.output(f"\n\n[Finished in {elapsed}]")

self.caller.errors = errors
self.caller.warnings = warnings
Expand Down
8 changes: 6 additions & 2 deletions tests/syntax/syntax_test_build.log
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ C:\Data\LaTeX\test-1400\.aux\test-index.log:1: Double-click here to open the ful
# <- meta.summary.success.build.latextools message.info.build.latextools - meta.messages - meta.logfile
#^^^^^^^^^^^^^^^^ meta.summary.success.build.latextools message.info.build.latextools - meta.messages - meta.logfile

[Done!]
[Finished in 3.4s]
# <- meta.summary.success.build.latextools message.info.build.latextools - meta.messages - meta.logfile
#^^^^^^^ meta.summary.success.build.latextools message.info.build.latextools - meta.messages - meta.logfile
#^^^^^^^^^^^^^^^^^ meta.summary.success.build.latextools message.info.build.latextools - meta.messages - meta.logfile

[Finished in 14:25]
# <- meta.summary.success.build.latextools message.info.build.latextools - meta.messages - meta.logfile
#^^^^^^^^^^^^^^^^^^ meta.summary.success.build.latextools message.info.build.latextools - meta.messages - meta.logfile