From ef69fb585f97d3cacbbd8144ff6087fd71176955 Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Mon, 7 Mar 2011 01:23:47 -0500 Subject: [PATCH] fixes for text mode --HG-- branch : pmacs2 --- mode/scala.py | 3 ++- mode/text.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mode/scala.py b/mode/scala.py index ab6a80b..f201cfc 100644 --- a/mode/scala.py +++ b/mode/scala.py @@ -32,6 +32,7 @@ SubTypeGrammar.rules = [ RegionRule('sub', r'\[', SubTypeGrammar, r'\]'), PatternRule('scala.type', '[a-zA-Z0-9_]+'), PatternRule('spaces', ' +'), + PatternRule('scala.annotation', '@[a-zA-Z_][a-zA-Z0-9_]*'), ] class ScalaGrammar(Grammar): @@ -337,7 +338,7 @@ class Scala(Fundamental): 'scala.script.start': hi_red, 'scala.script.end': hi_red, - 'scala.annotation': lo_green, + 'scala.annotation': lo_orange, 'scala.pseudo': hi_magenta, 'scala.reserved': hi_cyan, 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'),