code: def get_current_line(self):
          
          cursor = self.textCursor()
          cursor.select(QTextCursor.BlockUnderCursor)
          return to_text_string(cursor.selectedText())
docs: Return current line's text