def setLines(self, top, bottom):
        linesChanged = False

        extraY = self.EXTRA_LINES * self.lineSpacing

        # add any required lines:

        while self.curTop >= top - extraY:
            # add lines upwards
            oldTopAddr = self.textLines[0].addr
            addr = self.mainWin.core.prevAddr(oldTopAddr)
            size = oldTopAddr - addr
            item = self._makeLine(self.curTop - self.lineSpacing, addr, size)
            self.addItem(item)
            self.textLines.appendleft(item)

            linesChanged = True

        while self.curBottom <= bottom + extraY:
            # add lines downwards
            addr = self.textLines[-1].addr + self.textLines[-1].size
            size = self.mainWin.core.nextAddr(addr) - addr
            item = self._makeLine(self.curBottom, addr, size)
            self.addItem(item)
            self.textLines.append(item)

            linesChanged = True
            # op = self.mainWin.r2core.disassemble(curAddr)

        # remove extraneous lines:

        while top - extraY < self.curTop:
            self.removeItem(self.textLines.popleft())
            linesChanged = True

        while self.curBottom > bottom + extraY:
            self.removeItem(self.textLines.pop())
            linesChanged = True


        if linesChanged:
            TextLineItem.updateColWidths(self.textLines)
dataset/ETHPy150Open sapir/sonare/sonare/textview.py/SonareTextScene.setLines/swapped operands of `<`