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() self.loadrc()
# initialize our buffers # 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.about.AboutBuffer())
buffers.append(buffer.console.ConsoleBuffer()) #buffers.append(buffer.console.ConsoleBuffer())
if self.rcerror: if self.rcerror:
buffers.insert(0, buffer.data.DataBuffer('*RcError*', self.rcerror)) buffers.insert(0, buffer.data.DataBuffer('*RcError*', self.rcerror))
# build windows for our buffers # build windows for our buffers
for b in buffers: for b in buffers:
if b.name() == '*Console*': if b.modename:
window.Window(b, self) window.Window(b, self)
else: else:
window.Window(b, self, mode_name=init_mode) window.Window(b, self, mode_name=init_mode)

View File

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

View File

@ -6,7 +6,10 @@ def none(window):
def last_buffer(window): def last_buffer(window):
bl = window.application.bufferlist 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): def current_buffer(window):
return window.buffer.name() return window.buffer.name()