Skip to content

Commit a3a6f4e

Browse files
author
Austin Clements
committed
Highlight the final error status
If there are enough warnings that real errors have scrolled away, it's each to miss the final line saying that there were errors. Fix this by highlighing the final error summary like other errors.
1 parent e7349a6 commit a3a6f4e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

latexrun

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,11 @@ def main():
184184
output = os.path.basename(task_latex.get_outname())
185185
else:
186186
output = 'output'
187+
if Message._color:
188+
terminfo.send('bold', ('setaf', 1))
187189
print('{}; {} not updated'.format(fstatus, output))
190+
if Message._color:
191+
terminfo.send('sgr0')
188192
sys.exit(status)
189193

190194
def arg_parser_shlex(string):
@@ -437,26 +441,26 @@ class Message(collections.namedtuple(
437441
if self.lineno is not None:
438442
finfo += ':' + str(self.lineno)
439443
finfo += ': '
440-
if self.__color:
444+
if self._color:
441445
terminfo.send('bold')
442446
sys.stdout.write(finfo)
443447

444448
if self.typ != 'info':
445-
if self.__color:
449+
if self._color:
446450
terminfo.send(('setaf', 5 if self.typ == 'warning' else 1))
447451
sys.stdout.write(self.typ + ': ')
448-
if self.__color:
452+
if self._color:
449453
terminfo.send('sgr0')
450454
sys.stdout.write(self.msg + '\n')
451455

452456
@classmethod
453457
def setup_color(cls, state):
454458
if state == 'never':
455-
cls.__color = False
459+
cls._color = False
456460
elif state == 'always':
457-
cls.__color = True
461+
cls._color = True
458462
elif state == 'auto':
459-
cls.__color = terminfo.has('setaf', 'bold', 'sgr0')
463+
cls._color = terminfo.has('setaf', 'bold', 'sgr0')
460464
else:
461465
raise ValueError('Illegal color state {:r}'.format(state))
462466

0 commit comments

Comments
 (0)