'Update the line number display when the cursor changes'

def _cursor_changed(self):

    line_number = max(0, self.textCursor().blockNumber())
    if self.numbers:
        self.numbers.set_highlighted(line_number)
