Пример #1
0
 def _on_mouse_moved(self, event):
     """ mouse moved callback """
     if event.modifiers() & QtCore.Qt.ControlModifier:
         cursor = TextHelper(self.editor).word_under_mouse_cursor()
         if not self._cursor or cursor.position() != self._cursor.position():
             self._check_word_cursor(cursor)
         self._cursor = cursor
     else:
         self._cursor = None
         self._clear_selection()
Пример #2
0
 def _on_mouse_moved(self, event):
     """ mouse moved callback """
     if event.modifiers() & QtCore.Qt.ControlModifier:
         cursor = TextHelper(self.editor).word_under_mouse_cursor()
         if (not self._cursor
                 or cursor.position() != self._cursor.position()):
             self._check_word_cursor(cursor)
         self._cursor = cursor
     else:
         self._cursor = None
         self._clear_selection()
 def _is_last_chard_end_of_word(self):
     try:
         tc = TextHelper(self.editor).word_under_cursor()
         tc.setPosition(tc.position())
         tc.movePosition(tc.StartOfLine, tc.KeepAnchor)
         l = tc.selectedText()
         last_char = l[len(l) - 1]
         seps = self.editor.word_separators
         symbols = [",", " ", "("]
         return last_char in seps and last_char not in symbols
     except IndexError:
         return False
Пример #4
0
 def _is_last_chard_end_of_word(self):
     try:
         tc = TextHelper(self.editor).word_under_cursor()
         tc.setPosition(tc.position())
         tc.movePosition(tc.StartOfLine, tc.KeepAnchor)
         l = tc.selectedText()
         last_char = l[len(l) - 1]
         seps = self.editor.word_separators
         symbols = [",", " ", "("]
         return last_char in seps and last_char not in symbols
     except IndexError:
         return False