branch : pmacs2
This commit is contained in:
moculus 2009-01-19 18:55:54 +00:00
parent c57abb9c87
commit 4ff226ce6b
3 changed files with 19 additions and 16 deletions

View File

@ -69,13 +69,12 @@ class Application(object):
# this is how we can change color settings
if curses.can_change_color():
#curses.init_color(curses.COLOR_YELLOW, 750, 766, 888)
#curses.init_color(curses.COLOR_BLUE, 750, 400, 0)
#curses.init_color(curses.COLOR_YELLOW, 222, 400, 900)
#curses.init_color(curses.COLOR_GREEN, 222, 400, 900)
#curses.init_color(curses.COLOR_RED, 222, 400, 222)
pass
else:
#raise Exception("urk")
self.set_error("Dynamic color not available")
color.init()

5
lex.py
View File

@ -391,7 +391,9 @@ class OverrideRegionRule(RegionRule):
d = m.groupdict()
if 'grammar' in d:
a = lexer.mode.window.application
modecls = a.modes[d['grammar'].lower()]
name = d['grammar'].lower()
if name in a.modes:
modecls = a.modes[name]
mode = modecls(FakeWindow(lexer.mode.window.application))
assert hasattr(mode, 'grammar') and hasattr(mode, 'colors')
@ -400,7 +402,6 @@ class OverrideRegionRule(RegionRule):
else:
path = parent.domain() + '.' + self.name
lexer.mode.gstack[path] = mode
return RegionRule.lex(self, lexer, parent, m)
class Grammar(object):

View File

@ -755,7 +755,7 @@ class Perl(mode.Fundamental):
self.add_bindings('close-paren', (')'))
self.add_bindings('close-bracket', (']'))
self.add_bindings('close-brace', ('}'))
self.context = PerlContext(self)
#self.context = PerlContext(self)
self.functions = None
self.funclines = None
self.perlinc = None
@ -789,10 +789,13 @@ class Perl(mode.Fundamental):
return self.perlinc
def get_functions(self):
return self.context.get_names()
#return self.context.get_names()
return {}
def get_function_names(self):
return self.context.get_name_list()
#return self.context.get_name_list()
return {}
def get_line_function(self, y):
return self.context.get_line_name(y)
#return self.context.get_line_name(y)
return {}
install = Perl.install