Skip to content

Commit

Permalink
Merge from 3.x: PR #4603
Browse files Browse the repository at this point in the history
Fixes #4595
  • Loading branch information
ccordoba12 committed Jun 15, 2017
2 parents 8422957 + 6e9eba2 commit f0107b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spyder/utils/syntaxhighlighters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,10 @@ def highlightBlock(self, text):
self.setCurrentBlockState(previous_state)

match = self.PROG.search(text)
while match:
match_count = 0
n_characters = len(text)

while match and match_count< n_characters:
for key, value in list(match.groupdict().items()):
start, end = match.span(key)

Expand All @@ -1053,6 +1056,7 @@ def highlightBlock(self, text):
self.setFormat(start, end - start, self.formats[key])

match = self.PROG.search(text, match.end())
match_count += 1

self.highlight_spaces(text)

Expand Down

0 comments on commit f0107b5

Please sign in to comment.