From a3ef1000adb1b4d0069b39d909a644477a9c8a38 Mon Sep 17 00:00:00 2001 From: moculus Date: Thu, 5 Feb 2009 17:12:52 +0000 Subject: [PATCH] header header --HG-- branch : pmacs2 --- mode/__init__.py | 11 ++++++----- mode/python.py | 5 +---- tab.py | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/mode/__init__.py b/mode/__init__.py index 6244d18..c533964 100644 --- a/mode/__init__.py +++ b/mode/__init__.py @@ -100,6 +100,10 @@ class Fundamental(Handler): completers = {} format = "%(flag)s %(bname)-18s (%(mname)s) %(indent)s %(cursor)s/%(mark)s %(perc)s" + header_size = 3 + header_fg = 'default' + header_bg = 'blue' + ## margins def _get_header(self): return self.get_setting('header') def _set_header(self, value): return self.set_setting('header', value) @@ -287,7 +291,7 @@ class Fundamental(Handler): def showing_header(self): return self.header != 0 def _enable_header(self): - self.header = 1 + self.header = self.header_size def _disable_header(self): self.header = 0 @@ -313,11 +317,8 @@ class Fundamental(Handler): self.lmargin = 0 # headers and margins - #def get_header(self): - # fg, bg = "default", "red" - # return [RenderString(s='header', attrs=color.build(fg, bg))] def get_header(self): - fg, bg = "default", "red" + fg, bg = self.header_fg, self.header_bg if self.tabber is None: s = "Header support is not available for this mode" diff --git a/mode/python.py b/mode/python.py index d1a88aa..f158245 100644 --- a/mode/python.py +++ b/mode/python.py @@ -568,6 +568,7 @@ class Python(mode.Fundamental): #format = "%(flag)s %(bname)-18s (%(mname)s) %(indent)s %(cursor)s/%(mark)s %(perc)s [%(name)s]" format = "%(flag)s %(bname)-18s (%(mname)s) %(indent)s %(cursor)s/%(first)s %(perc)s [%(name)s]" + header_size = 3 def get_status_names(self): names = mode.Fundamental.get_status_names(self) @@ -577,10 +578,6 @@ class Python(mode.Fundamental): return names # xyz - def _enable_header(self): - self.header = 3 - def _disable_header(self): - self.header = 0 def get_header(self): fg, bg = "default", "red" diff --git a/tab.py b/tab.py index fb0dd25..5ff52bb 100644 --- a/tab.py +++ b/tab.py @@ -310,10 +310,10 @@ class StackTabber2(Tabber): self.stack.pop() def _append(self, name, type_, level, y=None): - self.stack.append(Marker2(name, type_, level)) + self.stack.append(Marker2(name, type_, level, y)) def _append_unless(self, name, type_, level, y=None): if self._nomatch(name): - self.stack.append(Marker2(name, type_, level)) + self.stack.append(Marker2(name, type_, level, y)) def _peek(self): if self.stack: return self.stack[-1]