vhdl_mode.py 文件源码

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

项目:VHDL-Mode 作者: Remillard 项目源码 文件源码
def run(self, edit):
        """Standard TextCommand Run method"""
        # Get the current point.
        region = self.view.sel()[0]
        original_point = region.begin()
        point_r, point_c = self.view.rowcol(original_point)
        # Figure out if any tab characters were used.
        line = self.view.substr(self.view.line(original_point))
        numtabs = line.count('\t')
        # Get the current tab size
        tabsize = util.get_vhdl_setting(self, 'tab_size')
        # Create string of correct amount of dashes.  A tab consumed
        # one character but generates tabsize-1 space.
        line = '-'*(80-point_c-(tabsize-1)*numtabs)
        # Create snippet object.
        snippet = line + '\n' + '-- $0' + '\n' + line + '\n'
        # Inserting template/snippet
        self.view.run_command("insert_snippet",
            {
                "contents" : snippet
            })

#----------------------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号