コード例 #1
0
    def get_info(self, pt):
        """Get scope related info."""

        scope = self.get_scope(pt)

        if self.rowcol_info or self.points_info or self.highlight_extent:
            self.get_extents(pt)

        if (self.appearance_info or self.selector_info) and scheme_matcher is not None:
            try:
                match = scheme_matcher.guess_color(self.view, pt, scope)
                color = match.fg
                bgcolor = match.bg
                color_sim = match.fg_simulated
                bgcolor_sim = match.bg_simulated
                style = match.style
                bg_selector = match.bg_selector
                color_selector = match.fg_selector
                style_selectors = match.style_selectors

                if self.appearance_info:
                    self.get_appearance(color, color_sim, bgcolor, bgcolor_sim, style)

                if self.selector_info:
                    self.get_selectors(color_selector, bg_selector, style_selectors)
            except Exception:
                log("Evaluating theme failed!  Ignoring theme related info.")
                debug(str(traceback.format_exc()))
                error("Evaluating theme failed!")
                self.scheme_info = False

        if self.file_path_info and scheme_matcher:
            self.get_scheme_syntax()

        self.next_index()
コード例 #2
0
    def get_info(self, pt):
        """Get scope related info."""

        scope = self.get_scope(pt)

        self.get_scope_context_backtrace(pt)

        if self.rowcol_info or self.points_info or self.highlight_extent:
            self.get_extents(pt)

        if (self.appearance_info
                or self.selector_info) and scheme_matcher is not None:
            try:
                match = scheme_matcher.guess_color(scope)
                color = match.fg
                bgcolor = match.bg
                color_sim = match.fg_simulated
                bgcolor_sim = match.bg_simulated
                style = match.style
                bg_selector = match.bg_selector
                color_selector = match.fg_selector
                style_selectors = match.style_selectors
                color_gradient = match.color_gradient
                color_gradient_selector = match.color_gradient_selector

                # if match.color_gradient is not None:
                #     color = self.view.style_for_scope(scope)["foreground"]
                #     color_sim = color

                if self.appearance_info:
                    self.get_appearance(color, color_sim, bgcolor, bgcolor_sim,
                                        style, color_gradient)

                if self.selector_info:
                    self.get_selectors(color_selector, bg_selector,
                                       style_selectors,
                                       color_gradient_selector)
            except Exception:
                log("Evaluating theme failed!  Ignoring theme related info.")
                debug(str(traceback.format_exc()))
                error("Evaluating theme failed!")
                self.scheme_info = False

        if self.file_path_info and scheme_matcher:
            self.get_scheme_syntax()

        # Divider
        self.next_index()
        self.scope_bfr.append("------")

        if self.show_popup:
            self.scope_bfr_tool.append(
                mdpopups.md2html(self.view,
                                 self.popup_template,
                                 template_vars=self.template_vars,
                                 template_env_options={
                                     "trim_blocks": True,
                                     "lstrip_blocks": True
                                 }))
コード例 #3
0
    def get_info(self, pt):
        """Get scope related info."""

        scope = self.get_scope(pt)

        if self.rowcol_info or self.points_info or self.highlight_extent:
            self.get_extents(pt)

        if (self.appearance_info or self.selector_info) and scheme_matcher is not None:
            try:
                match = scheme_matcher.guess_color(scope)
                color = match.fg
                bgcolor = match.bg
                color_sim = match.fg_simulated
                bgcolor_sim = match.bg_simulated
                style = match.style
                bg_selector = match.bg_selector
                color_selector = match.fg_selector
                style_selectors = match.style_selectors
                color_gradient = match.color_gradient
                color_gradient_selector = match.color_gradient_selector

                # if match.color_gradient is not None:
                #     color = self.view.style_for_scope(scope)["foreground"]
                #     color_sim = color

                if self.appearance_info:
                    self.get_appearance(color, color_sim, bgcolor, bgcolor_sim, style, color_gradient)

                if self.selector_info:
                    self.get_selectors(color_selector, bg_selector, style_selectors, color_gradient_selector)
            except Exception:
                log("Evaluating theme failed!  Ignoring theme related info.")
                debug(str(traceback.format_exc()))
                error("Evaluating theme failed!")
                self.scheme_info = False

        if self.file_path_info and scheme_matcher:
            self.get_scheme_syntax()

        # Divider
        self.next_index()
        self.scope_bfr.append("------")

        if self.show_popup:
            self.scope_bfr_tool.append(
                mdpopups.md2html(
                    self.view,
                    self.popup_template,
                    template_vars=self.template_vars,
                    template_env_options={
                        "trim_blocks": True,
                        "lstrip_blocks": True
                    }
                )
            )