fixes for text mode

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2011-03-07 01:23:47 -05:00
parent 611cd8302c
commit ef69fb585f
2 changed files with 5 additions and 2 deletions

View File

@ -32,6 +32,7 @@ SubTypeGrammar.rules = [
RegionRule('sub', r'\[', SubTypeGrammar, r'\]'), RegionRule('sub', r'\[', SubTypeGrammar, r'\]'),
PatternRule('scala.type', '[a-zA-Z0-9_]+'), PatternRule('scala.type', '[a-zA-Z0-9_]+'),
PatternRule('spaces', ' +'), PatternRule('spaces', ' +'),
PatternRule('scala.annotation', '@[a-zA-Z_][a-zA-Z0-9_]*'),
] ]
class ScalaGrammar(Grammar): class ScalaGrammar(Grammar):
@ -337,7 +338,7 @@ class Scala(Fundamental):
'scala.script.start': hi_red, 'scala.script.start': hi_red,
'scala.script.end': hi_red, 'scala.script.end': hi_red,
'scala.annotation': lo_green, 'scala.annotation': lo_orange,
'scala.pseudo': hi_magenta, 'scala.pseudo': hi_magenta,
'scala.reserved': hi_cyan, 'scala.reserved': hi_cyan,

View File

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