diff --git a/mode/text.py b/mode/text.py index 0839912..76b7364 100644 --- a/mode/text.py +++ b/mode/text.py @@ -29,6 +29,7 @@ class ContinuedRule(RegionRule): class TextGrammar(Grammar): rules = [ + PatternRule(r'text.link', r'[a-z]+://[^ ]*[^- .,;:]'), ContinuedRule(), WordRule(), PatternRule(r'text.punct', r'[^a-zA-Z0-9_]'), @@ -58,7 +59,7 @@ class LearnWord(method.Method): for token in w.buffer.highlights[w.mode.name].tokens[cursor.y]: if (token.x <= cursor.x and token.end_x() > cursor.x and - token.name == 'misspelled'): + token.name == 'text.misspelled'): word = token.string if word is None: @@ -86,6 +87,7 @@ class Text(Fundamental): 'text-wrap-paragraph': ('M-q',), } colors = { + 'text.link': ('cyan', 'default'), 'text.punct': ('default', 'default'), 'text.stuff': ('default', 'default'), 'text.word': ('default', 'default'),