add support for links nad fix learn-word

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2011-03-07 01:14:23 -05:00
parent 842a50017f
commit 8774fe5106
1 changed files with 3 additions and 1 deletions

View File

@ -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'),