Permalink
Browse files

ConsoleInteraction: Fix empty line tab display

When there is just one tab in one line, it throws an error because
it cant find the sourcerange end. This corrects it by decreasing
the sourcerange column end by 1.

Fixes #2180
  • Loading branch information...
SanketDG committed Jul 14, 2016
1 parent 7cda7e3 commit 12ede4fe5fc3946532944848edd49aa8920702a3
Showing with 3 additions and 3 deletions.
  1. +1 −1 coalib/output/ConsoleInteraction.py
  2. +2 −2 tests/output/ConsoleInteractionTest.py
@@ -184,7 +184,7 @@ def print_lines(console_printer,
print_spaces_tabs_in_unicode(
console_printer, line[sourcerange.end.column-1:],
tab_dict, FILE_LINES_COLOR, sourcerange.end.column)
tab_dict, FILE_LINES_COLOR, sourcerange.end.column-1)
console_printer.print("")
else:
print_spaces_tabs_in_unicode(
@@ -526,7 +526,7 @@ def test_print_results_sorting(self):
file="file",
line=2)],
{abspath("file"): ["test line\n",
"line 2\n",
"\t\n",
"line 3\n",
"line 4\n",
"line 5\t\n"]},
@@ -535,7 +535,7 @@ def test_print_results_sorting(self):
self.assertEqual("""
file
| 2| line•2
| 2| --->
| | [NORMAL] SpaceConsistencyBear:
| | Trailing whitespace found

0 comments on commit 12ede4f

Please sign in to comment.