SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2.01k stars 365 forks source link

It reports No errors. No warnings. No bad boxes. when there are errors #1230

Open evandrocoan opened 7 years ago

evandrocoan commented 7 years ago

Minimal code:

\documentclass[10pt,a5paper,twoside]{memoir}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{xcolorx}

\begin{document}

    test

\end{document}

LatexTools output:

[Compiling D:\Test\test3.tex] 2017-09-19, 23:58:05 (00:00:03 seconds)

Basic Builder: running pdflatex...done.

No errors. No warnings. No bad boxes.

[Done in 00:00:03 seconds!]

Latex log output: test3_log.txt

Noticing there are some null bytes on it:

image


! LaTeX Error: File `xcolorx.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
 :7: Emergency stop 
Here is how much of TeX's memory you used:
 4034 strings out of 493314
 51504 string characters out of 3134142
 132012 words of memory out of 3000000
 7624 multiletter control sequences out of 15000+200000
 5001 words of font info for 17 fonts, out of 3000000 for 9000
 1141 hyphenation exceptions out of 8191
 26i,1n,22p,133b,62s stack positions out of 5000i,500n,10000p,200000b,50000s

 :7:  ==> Fatal error occurred, no output PDF file produced!

Related:

  1. https://github.com/SublimeText/LaTeXTools/issues/1205 not cataching error for wrong syntax
  2. https://github.com/SublimeText/LaTeXTools/issues/188 Reported as no errors when there are errors
  3. https://github.com/SublimeTextIssues/Core/issues/393 Pasted text containing NULLs is truncated
evandrocoan commented 7 years ago

I just noticed the iterator used on:

    # save previous line for "! File ended while scanning use of..." message
    prev_line = line
    try:
        print( "prev_line: " + prev_line )
        line, linelen = advance_iterator(log_iterator) # will fail when no more lines
        # print( "line: " + prev_line )
        line_num += 1
        last_iteration_lines.append(prev_line)
    except StopIteration:
        break

Is not returning the lines which are starting with null bytes. The output of the above code should be:

prev_line: Enter file name: 
line: Enter file name: 
prev_line: 
line: 
prev_line: :7: Emergency stop 
line: :7: Emergency stop 
prev_line: Here is how much of TeX's memory you used:
line: Here is how much of TeX's memory you used:
prev_line:  4034 strings out of 493314
line:  4034 strings out of 493314

Instead of:

prev_line: Enter file name: 
line: Enter file name: 
prev_line: 
line: 
prev_line: Here is how much of TeX's memory you used:
line: Here is how much of TeX's memory you used:
prev_line:  4034 strings out of 493314
line:  4034 strings out of 493314