def setTextBuffer(self, textBuffer):
    if app.config.strict_debug:
        assert issubclass(textBuffer.__class__, app.text_buffer.TextBuffer), repr(textBuffer)
    app.log.info('setTextBuffer')
    if (self.textBuffer is not None):
        self.savedScrollPositions[self.textBuffer.fullPath] = (self.scrollRow, self.scrollCol)
    textBuffer.lineLimitIndicator = self.program.prefs.editor['lineLimitIndicator']
    textBuffer.debugRedo = self.program.prefs.startup.get('debugRedo')
    Window.setTextBuffer(self, textBuffer)
    self.controller.setTextBuffer(textBuffer)
    savedScroll = self.savedScrollPositions.get(self.textBuffer.fullPath)
    if (savedScroll is not None):
        (self.scrollRow, self.scrollCol) = savedScroll
    else:
        historyScroll = self.textBuffer.fileHistory.get('scroll')
        if (historyScroll is not None):
            (self.scrollRow, self.scrollCol) = historyScroll
        else:
            self.textBuffer.scrollToOptimalScrollPosition()
def setTextBuffer(self, textBuffer):
    if app.config.strict_debug:
        assert issubclass(textBuffer.__class__, app.text_buffer.TextBuffer), repr(textBuffer)
    app.log.info('setTextBuffer')
    if (self.textBuffer is not None):
        self.savedScrollPositions[self.textBuffer.fullPath] = (self.scrollRow, self.scrollCol)
    textBuffer.lineLimitIndicator = self.program.prefs.editor['lineLimitIndicator']
    textBuffer.debugRedo = self.program.prefs.startup.get('debugRedo')
    Window.setTextBuffer(self, textBuffer)
    self.controller.setTextBuffer(textBuffer)
    savedScroll = self.savedScrollPositions.get(self.textBuffer.fullPath)
    if (savedScroll is not None):
        (self.scrollRow, self.scrollCol) = savedScroll
    else:
        historyScroll = self.textBuffer.fileHistory.get('scroll')
        if (historyScroll is not None):
            (self.scrollRow, self.scrollCol) = historyScroll
        else:
            self.textBuffer.scrollToOptimalScrollPosition()