Skip to content

Commit

Permalink
Clear persistant previous row error description in status when cursor…
Browse files Browse the repository at this point in the history
… on a non errored line.
  • Loading branch information
Pegase745 committed Jul 4, 2017
1 parent e524ca8 commit 31e54d7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions flowtype/commands/check_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ def handle_process(self, returncode, stdout, error):
# No errors
if passed:
self.view.erase_status('flow_errors')
self.view.erase_status('flow_single_error')
self.view.set_status(
'flow_type', 'Flow %s: no errors' % flow_version)
'flow_errors', 'Flow %s: no errors' % flow_version)
return

# Errors
Expand Down Expand Up @@ -90,9 +91,11 @@ def handle_process(self, returncode, stdout, error):
error_description = error_per_line.get(row + 1, '')

self.view.erase_status('flow_errors')
self.view.erase_status('flow_single_error')
if error_description:
self.view.set_status(
'flow_type', 'Flow error: {}'.format(error_description))
'flow_single_error',
'Flow error: {}'.format(error_description))
else:
self.view.set_status(
'flow_errors', 'Flow {}: {} error{}'.format(
Expand Down

0 comments on commit 31e54d7

Please sign in to comment.