branch : pmacs2
This commit is contained in:
moculus 2009-02-05 15:47:20 +00:00
parent 7c1d0a9330
commit 5390ded5d0
5 changed files with 56 additions and 8 deletions

5
IDEAS
View File

@ -1,3 +1,8 @@
2009/02/05:
Create some more rules for lexing that will help things like XML be more
efficient.
2009/01/28:
Move modes into buffers and out of windows. This should reduce the memory

View File

@ -783,6 +783,7 @@ class Application(object):
modename = w.mode.name()
# draw the header
if w.mode.header:
rstrs = w.mode.get_header()
assert len(rstrs) >= w.mode.header
for j in range(0, w.mode.header):

View File

@ -1,6 +1,4 @@
<foo some_attr='blah'
other_attr='foo'
c='9'>
<foo some_attr='blah' other_attr='foo' c='9'>
<bijj a="222" b="999">
<blah a='1' b='2' c='3' />
fjjgg

View File

@ -313,9 +313,45 @@ 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"
return [RenderString(s='header', attrs=color.build(fg, bg))]
if self.tabber is None:
s = "Header support is not available for this mode"
hs = [RenderString(s=s, attrs=color.build(fg, bg))]
while len(hs) < 3:
hs.insert(0, RenderString(s='', attrs=color.build(fg, bg)))
return hs
w = self.window
y = self.window.first.y
if self.window.first.x > 0:
y += 1
lvl = self.tabber.get_level(y)
markers = self.tabber.record[y]
if w.buffer.is_whitespace(y):
ws = None
else:
ws = w.buffer.count_leading_whitespace(y)
hs = []
i = len(markers) - 1
while i >= 0 and len(hs) < 3:
marker = markers[i]
i -= 1
if marker.y == y:
continue
if ws and marker.level > ws:
continue
s = w.buffer.lines[marker.y][:w.width - 1]
hs.insert(0, RenderString(s=s, attrs=color.build(fg, bg)))
while len(hs) < 3:
hs.insert(0, RenderString(s='', attrs=color.build(fg, bg)))
return hs
def get_footer(self):
fg, bg = "default", "red"
return [RenderString(s='footer', attrs=color.build(fg, bg))]

View File

@ -583,6 +583,14 @@ class Python(mode.Fundamental):
self.header = 0
def get_header(self):
fg, bg = "default", "red"
if self.tabber is None:
s = "Header support is not available for this mode"
hs = [RenderString(s=s, attrs=color.build(fg, bg))]
while len(hs) < 3:
hs.insert(0, RenderString(s='', attrs=color.build(fg, bg)))
return hs
w = self.window
y = self.window.first.y
if self.window.first.x > 0: