Skip to content

Commit

Permalink
Merge pull request #102 from digeomel/master
Browse files Browse the repository at this point in the history
Fixes issue #93 [Lots of random "red dots" showing up in the gutter]
  • Loading branch information
jbrooksuk authored Jul 29, 2016
2 parents 42e70a7 + b8eb75d commit 4c8b8f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions line.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ def color(self):
def generate_webcolors(self):
"""Generates a list of web color names."""
self.WEB_COLORS = dict((name, color) for (name, color) in css3_names_to_hex.items())
self.WEB_COLORS_REGEX = '((?<!\$)'+ '|(?<!\$)'.join(self.WEB_COLORS.keys()) +')'
self.WEB_COLORS_REGEX = '[\\s:](' + '|'.join(self.WEB_COLORS.keys()) + ')[\\s;]'

def web_color(self):
"""Returns the color in the line, if any CSS color name is found."""
matches = re.search(self.WEB_COLORS_REGEX, self.text)
if matches:
return matches.group(0)
return matches.group(1)

def hex_color(self):
"""Returns the color in the line, if any hex is found."""
Expand Down

0 comments on commit 4c8b8f8

Please sign in to comment.