Highlight all special spaces/hyphens

This commit is contained in:
Kovid Goyal 2013-12-22 17:23:15 +05:30
parent 7a9dab2cb5
commit cdc1af5b7d
2 changed files with 5 additions and 2 deletions

View File

@ -28,7 +28,7 @@ attribute_name_pat = re.compile(r'''[^%s"'/><=]+''' % space_chars)
self_closing_pat = re.compile(r'/\s*>')
unquoted_val_pat = re.compile(r'''[^%s'"=<>`]+''' % space_chars)
cdata_close_pats = {x:re.compile(r'</%s' % x, flags=re.I) for x in cdata_tags}
nbsp_pat = re.compile('[\xa0\u2011]+') # non-breaking spaces and hyphens
nbsp_pat = re.compile('[\xa0\u2000-\u200A\u202F\u205F\u3000\u2011-\u2015\uFE58\uFE63\uFF0D]+') # special spaces and hyphens
class State(object):
@ -303,7 +303,7 @@ def create_formats(highlighter):
'string': t['String'],
'nsprefix': t['Constant'],
'preproc': t['PreProc'],
'nbsp': t['CursorLine'],
'nbsp': t['SpecialCharacter'],
}
for name, msg in {
'<': _('An unescaped < is not allowed. Replace it with &lt;'),

View File

@ -57,6 +57,7 @@ SOLARIZED = \
Statement fg={green} bold
Keyword fg={green}
Special fg={red}
SpecialCharacter bg={base02}
Error us=wave uc={red}
Tooltip fg=black bg=ffffed
@ -94,6 +95,7 @@ THEMES = {
Keyword fg={keyword}
Special fg=e7f6da
Error us=wave uc=red
SpecialCharacter bg={cursor_loc}
'''.format(
cursor_loc='3d3d3d',
@ -132,6 +134,7 @@ THEMES = {
Statement fg={keyword}
Keyword fg={keyword}
Special fg=70a0d0 italic
SpecialCharacter bg={cursor_loc}
Error us=wave uc=red
'''.format(