diff --git a/application.py b/application.py index 0ecf22f..1575cc5 100755 --- a/application.py +++ b/application.py @@ -16,7 +16,6 @@ class Application(object): self.y, self.x = self.stdscr.getmaxyx() # initialize some basic stuff - self.state = {} self.config = {} self.highlighted_ranges = [] self.mini_active = False @@ -115,14 +114,12 @@ class Application(object): # create all the insert methods for the character ranges we like for c in string.letters + string.digits + string.punctuation: - obj = method.InsertString(c) - self.methods[obj.name] = obj - obj = method.OverwriteChar(c) - self.methods[obj.name] = obj + self.methods[obj.name] = method.InsertString(c) + self.methods[obj.name] = method.OverwriteChar(c) # buffer list stuff - height = self.y - 1 - width = self.x + height = self.y - 1 + width = self.x self.bufferlist = bufferlist.BufferList(height, width) self.active_slot = 0 self.complete_slot = None diff --git a/mode/perl.py b/mode/perl.py index e8b3ce3..906134f 100644 --- a/mode/perl.py +++ b/mode/perl.py @@ -742,6 +742,7 @@ class Perl(mode.Fundamental): self.context = PerlContext(self) self.functions = None self.funclines = None + self.perlinc = None def find_module(self, module): parts = module.split('::') @@ -756,9 +757,7 @@ class Perl(mode.Fundamental): return path def get_inc(self): - a = self.window.application - a.state.setdefault('perl', {}) - if 'inc' not in a.state['perl']: + if self.perlinc is None: perllib = a.config.get('perl.lib') if perllib: cmd = "PERL5LIB=%r perl -e 'print join(\"\\n\", @INC);'" % perllib @@ -767,8 +766,8 @@ class Perl(mode.Fundamental): (status, data) = commands.getstatusoutput(cmd) if status != 0: raise Exception, "%r failed" % cmd - a.state['perl']['inc'] = data.split('\n') - return a.state['perl']['inc'] + self.perlinc = data.split('\n') + return self.perlinc def get_functions(self): return self.context.get_names() diff --git a/mode/sql.py b/mode/sql.py index 290f0ec..72cc429 100644 --- a/mode/sql.py +++ b/mode/sql.py @@ -130,12 +130,14 @@ class Sql(mode.Fundamental): 'sql_type': ('green', 'default', 'bold'), 'sql_builtin': ('yellow', 'default', 'bold'), 'sql_quoted.start': ('yellow', 'default', 'bold'), + 'sql_quoted.data': ('yellow', 'default', 'bold'), 'sql_quoted.null': ('yellow', 'default', 'bold'), 'sql_quoted.end': ('yellow', 'default', 'bold'), 'sql_variable': ('yellow', 'default', 'bold'), 'sql_bareword': ('default', 'default', 'bold'), 'function.start': ('cyan', 'default', 'bold'), + 'function.data': ('default', 'default', 'bold'), 'function.null': ('default', 'default', 'bold'), 'function.name': ('magenta', 'default', 'bold'), 'function.language': ('magenta', 'default', 'bold'), @@ -143,6 +145,7 @@ class Sql(mode.Fundamental): 'function.definition.start': ('magenta', 'default', 'bold'), 'function.definition.sql_bareword': ('magenta', 'default', 'bold'), + 'function.definition.data': ('magenta', 'default', 'bold'), 'function.definition.null': ('magenta', 'default', 'bold'), 'function.definition.end': ('magenta', 'default', 'bold'), }