'Update context information and lines visible in the context pane.'

def update_code_context(self):

    new_topvisible = int(self.text.index('@0,0').split('.')[0])
    if (self.topvisible == new_topvisible):
        return
    if (self.topvisible < new_topvisible):
        (lines, lastindent) = self.get_context(new_topvisible, self.topvisible)
        while (self.info[(-1)][1] >= lastindent):
            del self.info[(-1)]
    elif (self.topvisible > new_topvisible):
        stopindent = (self.info[(-1)][1] + 1)
        while (self.info[(-1)][0] >= new_topvisible):
            stopindent = self.info[(-1)][1]
            del self.info[(-1)]
        (lines, lastindent) = self.get_context(new_topvisible, (self.info[(-1)][0] + 1), stopindent)
    self.info.extend(lines)
    self.topvisible = new_topvisible
    context_strings = ([''] * max(0, (self.context_depth - len(self.info))))
    context_strings += [x[2] for x in self.info[(- self.context_depth):]]
    self.label['text'] = '\n'.join(context_strings)
