parent
7c1d0a9330
commit
5390ded5d0
5
IDEAS
5
IDEAS
|
@ -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
|
||||
|
|
|
@ -783,10 +783,11 @@ class Application(object):
|
|||
modename = w.mode.name()
|
||||
|
||||
# draw the header
|
||||
rstrs = w.mode.get_header()
|
||||
assert len(rstrs) >= w.mode.header
|
||||
for j in range(0, w.mode.header):
|
||||
rstrs[j].draw(self.win, slot.y_offset + j, slot.x_offset, slot.width)
|
||||
if w.mode.header:
|
||||
rstrs = w.mode.get_header()
|
||||
assert len(rstrs) >= w.mode.header
|
||||
for j in range(0, w.mode.header):
|
||||
rstrs[j].draw(self.win, slot.y_offset + j, slot.x_offset, slot.width)
|
||||
|
||||
# draw the actual slot
|
||||
self._draw_slot(i)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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))]
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue