phantom_error_vis.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:EasyClangComplete 作者: niosus 项目源码 文件源码
def show_phantoms(self, view):
        """Show phantoms for compilation errors.

        Args:
            view (sublime.View): current view
        """
        view.erase_phantoms(PopupErrorVis._TAG)
        if view.buffer_id() not in self.phantom_sets:
            phantom_set = sublime.PhantomSet(view, PopupErrorVis._TAG)
            self.phantom_sets[view.buffer_id()] = phantom_set
        else:
            phantom_set = self.phantom_sets[view.buffer_id()]
        phantoms = []
        current_error_dict = self.err_regions[view.buffer_id()]
        for err in current_error_dict:
            errors_dict = current_error_dict[err]
            errors_html = PhantomErrorVis._as_html(errors_dict)
            pt = view.text_point(err - 1, 1)
            phantoms.append(sublime.Phantom(
                sublime.Region(pt, view.line(pt).b),
                errors_html,
                sublime.LAYOUT_BELOW,
                on_navigate=self._on_phantom_navigate))
        phantom_set.update(phantoms)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号