diff --git a/application.py b/application.py index 2df0e82..9156b07 100755 --- a/application.py +++ b/application.py @@ -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() diff --git a/lex.py b/lex.py index 2f983e5..941d3b8 100755 --- a/lex.py +++ b/lex.py @@ -391,16 +391,17 @@ class OverrideRegionRule(RegionRule): d = m.groupdict() if 'grammar' in d: a = lexer.mode.window.application - modecls = a.modes[d['grammar'].lower()] - mode = modecls(FakeWindow(lexer.mode.window.application)) - assert hasattr(mode, 'grammar') and hasattr(mode, 'colors') - - if parent is None: - path = self.name - else: - path = parent.domain() + '.' + self.name - lexer.mode.gstack[path] = mode - + 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') + + if parent is None: + path = self.name + else: + path = parent.domain() + '.' + self.name + lexer.mode.gstack[path] = mode return RegionRule.lex(self, lexer, parent, m) class Grammar(object): diff --git a/mode/perl.py b/mode/perl.py index 1c7194b..95662d2 100644 --- a/mode/perl.py +++ b/mode/perl.py @@ -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