def _checkCaretMoving(self): new_start_selection = self.GetSelectionStart() new_end_selection = self.GetSelectionEnd() if (self._oldStartSelection != new_start_selection or self._oldEndSelection != new_end_selection): self._oldStartSelection = new_start_selection self._oldEndSelection = new_end_selection event_params = TextEditorCaretMoveParams(self, new_start_selection, new_end_selection) Application.onTextEditorCaretMove(Application.selectedPage, event_params)