def __init__(self): super().__init__() self.code_folding = None self.setMouseTracking(True) self.__mouse_over = None self.__current_line_number = -1 self.__timer = QTimer(self) self.__timer.setSingleShot(True) self.__timer.setInterval(100) self.__timer.timeout.connect(self.update) reverse_color = get_inverted_color( resources.COLOR_SCHEME.get("editor.background")) self.__line_fold_color = QColor(reverse_color)
def highlight_found_results(self, text, cs=False, wo=False): """Highlight all found results from find/replace widget""" index, results = self._get_find_index_results(text, cs=cs, wo=wo) selections = [] append = selections.append color = resources.COLOR_SCHEME.get("editor.search.result") for start, end in results: selection = extra_selection.ExtraSelection(self.textCursor(), start_pos=start, end_pos=end) selection.set_background(color) selection.set_foreground(utils.get_inverted_color(color)) append(selection) line = selection.cursor.blockNumber() self._scrollbar.add_marker("find", line, color) self._extra_selections.add("find", selections) return index, len(results)
def highlight_found_results(self, text, cs=False, wo=False): """Highlight all found results from find/replace widget""" index, results = self._get_find_index_results(text, cs=cs, wo=wo) selections = [] append = selections.append color = resources.COLOR_SCHEME.get("editor.search.result") for start, end in results: selection = extra_selection.ExtraSelection( self.textCursor(), start_pos=start, end_pos=end ) selection.set_background(color) selection.set_foreground(utils.get_inverted_color(color)) append(selection) line = selection.cursor.blockNumber() self._scrollbar.add_marker("find", line, color) self._extra_selections.add("find", selections) return index, len(results)