Hi, I encountered it when developing a simple app. I was able to deal with it somehow, thus this is meant as a notice about these issues for Qt people.
The missing signaling on select-all event can be seen by commenting out self.highlight_current_line() at (one of) def selection_changed(self): there.
The issue with line highlighting of right-aligned lines can be seen by adding self.setAlignment(QtCore.Qt.AlignRight) at one of the QTextEdit-based classes, like at class CmdTextEdit(QTextEdit): e.g. just before self.setUndoRedoEnabled(True) by the end of its __init__:
with the self.document().setModified(False) being put there to convince Qt that this setting is still within initialization.
BTW I've seen at the Qt example that line numbers are thought to be drawn by painters, though the painter did not want to work for me (complaining about something, may be about being not active, not sure now). And since I did not know how to convert that example onto partially-seen lines anyway, I did it a different way.