code: def focusInEvent(self, event):
          
          self.focus_changed.emit()
          self.focus_in.emit()
          self.highlight_current_cell()
          QPlainTextEdit.focusInEvent(self, event)
docs: Reimplemented to handle focus