def _handle_subcommand(self, **kwargs): view = self.view git_handler = self.git_handler action = kwargs['action'] if action == 'jump_to_next_change': GitGutterJumpToChanges(view, git_handler).jump_to_next_change() elif action == 'jump_to_prev_change': GitGutterJumpToChanges(view, git_handler).jump_to_prev_change() elif action == 'compare_against_commit': GitGutterCompareCommit(view, git_handler).run() elif action == 'compare_against_branch': GitGutterCompareBranch(view, git_handler).run() elif action == 'compare_against_tag': GitGutterCompareTag(view, git_handler).run() elif action == 'compare_against_head': GitGutterCompareHead(view, git_handler).run() elif action == 'compare_against_origin': GitGutterCompareOrigin(view, git_handler).run() elif action == 'show_compare': GitGutterShowCompare(view, git_handler).run() elif action == 'show_diff_popup': point = kwargs['point'] highlight_diff = kwargs['highlight_diff'] flags = kwargs['flags'] show_diff_popup(view, point, git_handler, highlight_diff=highlight_diff, flags=flags) else: assert False, 'Unhandled sub command "%s"' % action
def _handle_subcommand(self, **kwargs): view = self.view git_handler = self.git_handler action = kwargs['action'] if action == 'jump_to_next_change': GitGutterJumpToChanges(view, git_handler).jump_to_next_change() elif action == 'jump_to_prev_change': GitGutterJumpToChanges(view, git_handler).jump_to_prev_change() elif action == 'compare_against_commit': GitGutterCompareCommit(view, git_handler).run() elif action == 'compare_against_branch': GitGutterCompareBranch(view, git_handler).run() elif action == 'compare_against_tag': GitGutterCompareTag(view, git_handler).run() elif action == 'compare_against_head': GitGutterCompareHead(view, git_handler).run() elif action == 'compare_against_origin': GitGutterCompareOrigin(view, git_handler).run() elif action == 'show_compare': GitGutterShowCompare(view, git_handler).run() elif action == 'show_diff_popup': point = kwargs['point'] highlight_diff = kwargs['highlight_diff'] flags = kwargs['flags'] show_diff_popup( view, point, git_handler, highlight_diff=highlight_diff, flags=flags) else: assert False, 'Unhandled sub command "%s"' % action
def on_hover(self, view, point, hover_zone): if hover_zone != sublime.HOVER_GUTTER: return # don't let the popup flicker / fight with other packages if view.is_popup_visible(): return if not settings.get("enable_hover_diff_popup"): return show_diff_popup(view, point, flags=sublime.HIDE_ON_MOUSE_MOVE_AWAY)