From 8774fe51063af4a4b330d4d04e23648ea4f03019 Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Mon, 7 Mar 2011 01:14:23 -0500 Subject: [PATCH] add support for links nad fix learn-word --HG-- branch : pmacs2 --- mode/text.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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'),