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 # this is how we can change color settings
if curses.can_change_color(): 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_YELLOW, 222, 400, 900)
#curses.init_color(curses.COLOR_GREEN, 222, 400, 900) #curses.init_color(curses.COLOR_GREEN, 222, 400, 900)
#curses.init_color(curses.COLOR_RED, 222, 400, 222) #curses.init_color(curses.COLOR_RED, 222, 400, 222)
pass pass
else: else:
#raise Exception("urk")
self.set_error("Dynamic color not available") self.set_error("Dynamic color not available")
color.init() color.init()

21
lex.py
View File

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

View File

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