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:
|
2009/01/28:
|
||||||
|
|
||||||
Move modes into buffers and out of windows. This should reduce the memory
|
Move modes into buffers and out of windows. This should reduce the memory
|
||||||
|
|
|
@ -783,6 +783,7 @@ class Application(object):
|
||||||
modename = w.mode.name()
|
modename = w.mode.name()
|
||||||
|
|
||||||
# draw the header
|
# draw the header
|
||||||
|
if w.mode.header:
|
||||||
rstrs = w.mode.get_header()
|
rstrs = w.mode.get_header()
|
||||||
assert len(rstrs) >= w.mode.header
|
assert len(rstrs) >= w.mode.header
|
||||||
for j in range(0, w.mode.header):
|
for j in range(0, w.mode.header):
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<foo some_attr='blah'
|
<foo some_attr='blah' other_attr='foo' c='9'>
|
||||||
other_attr='foo'
|
|
||||||
c='9'>
|
|
||||||
<bijj a="222" b="999">
|
<bijj a="222" b="999">
|
||||||
<blah a='1' b='2' c='3' />
|
<blah a='1' b='2' c='3' />
|
||||||
fjjgg
|
fjjgg
|
||||||
|
|
|
@ -313,9 +313,45 @@ class Fundamental(Handler):
|
||||||
self.lmargin = 0
|
self.lmargin = 0
|
||||||
|
|
||||||
# headers and margins
|
# headers and margins
|
||||||
|
#def get_header(self):
|
||||||
|
# fg, bg = "default", "red"
|
||||||
|
# return [RenderString(s='header', attrs=color.build(fg, bg))]
|
||||||
def get_header(self):
|
def get_header(self):
|
||||||
fg, bg = "default", "red"
|
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):
|
def get_footer(self):
|
||||||
fg, bg = "default", "red"
|
fg, bg = "default", "red"
|
||||||
return [RenderString(s='footer', attrs=color.build(fg, bg))]
|
return [RenderString(s='footer', attrs=color.build(fg, bg))]
|
||||||
|
|
|
@ -583,6 +583,14 @@ class Python(mode.Fundamental):
|
||||||
self.header = 0
|
self.header = 0
|
||||||
def get_header(self):
|
def get_header(self):
|
||||||
fg, bg = "default", "red"
|
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
|
w = self.window
|
||||||
y = self.window.first.y
|
y = self.window.first.y
|
||||||
if self.window.first.x > 0:
|
if self.window.first.x > 0:
|
||||||
|
|
Loading…
Reference in New Issue