branch : pmacs2
This commit is contained in:
moculus 2008-10-29 17:17:16 +00:00
parent 09123ab192
commit e9f00278cc
3 changed files with 12 additions and 9 deletions

View File

@ -161,16 +161,15 @@ class Application(object):
self.loadrc()
# initialize our buffers
# note that the first buffer in buffers will be initially visible
# note that only the first buffer will be initially visible
buffers.append(buffer.about.AboutBuffer())
buffers.append(buffer.console.ConsoleBuffer())
#buffers.append(buffer.console.ConsoleBuffer())
if self.rcerror:
buffers.insert(0, buffer.data.DataBuffer('*RcError*', self.rcerror))
# build windows for our buffers
for b in buffers:
if b.name() == '*Console*':
if b.modename:
window.Window(b, self)
else:
window.Window(b, self, mode_name=init_mode)

View File

@ -43,10 +43,11 @@ class DelMove(object):
# abstract class
class Buffer(object):
btype = 'generic'
mac_re = re.compile('\r(?!\n)')
unix_re = re.compile('(?<!\r)\n')
win_re = re.compile('\r\n')
btype = 'generic'
modename = None
mac_re = re.compile('\r(?!\n)')
unix_re = re.compile('(?<!\r)\n')
win_re = re.compile('\r\n')
def __init__(self, stack_limit=STACK_LIMIT):
self.lines = [""]
self.windows = []

View File

@ -6,7 +6,10 @@ def none(window):
def last_buffer(window):
bl = window.application.bufferlist
return bl.hidden_buffers[0].name()
if bl.hidden_buffers:
return bl.hidden_buffers[0].name()
else:
return ''
def current_buffer(window):
return window.buffer.name()