def _onTextChanged(self):
        text = self.document().toPlainText()
        viewableLines = self.height() / self.fontMetrics().height()
        hasNewLine = text.indexOf("\n") > 0
        if (hasNewLine and self.MAXIMUM_VIEWABLE_LINES < viewableLines) or (not hasNewLine and viewableLines > self.MINIMUM_VIEWABLE_LINES):
            viewableLines = self.MAXIMUM_VIEWABLE_LINES if hasNewLine else self.MINIMUM_VIEWABLE_LINES
            self.setFixedHeight(self.fontMetrics().height() * viewableLines)
dataset/ETHPy150Open mariano/snakefire/snakefire/qtx.py/SpellTextEditor._onTextChanged/swapped operands of `<`