def show_tooltip(content, view=None, location=-1, timeout=0): ''' Shows a tooltip. @content The tooltip's content (minihtml). @view The view in which the tooltip should be shown. If `None`, the active view will be used if available. @location Text location at which the tooltip will be shown. @timeout If greater than 0, the tooltip will be autohidden after @timeout milliseconds. ''' if not view: try: view = sublime.active_window().active_view() except AttributeError as e: return else: if not view: return view.show_popup(content, location=location, max_width=500) if timeout > 0: current_id = next(id_generator) after(timeout, lambda: _hide(view, current_id))
def on_finished(self, proc): after(0, functools.partial(self.finish, proc))
def on_data(self, proc, data): after(0, functools.partial(self.append_data, proc, data))
def add_edit(self, view): with ProjectTracker.edits_lock: view_id = view.file_name() or view.id() self.edits[view_id] += 1 after(1500, lambda: self.subtract_edit(view))