modeline.py 文件源码

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

项目:NeoVintageous 作者: NeoVintageous 项目源码 文件源码
def _get_line_comment_char(view):
    commentChar = ""
    commentChar2 = ""
    try:
        for pair in view.meta_info("shellVariables", 0):
            if pair["name"] == "TM_COMMENT_START":
                commentChar = pair["value"]
            if pair["name"] == "TM_COMMENT_START_2":
                commentChar2 = pair["value"]
            if commentChar and commentChar2:
                break
    except TypeError:
        pass

    if not commentChar2:
        return re.escape(commentChar.strip())
    else:
        return "(" + re.escape(commentChar.strip()) + "|" + re.escape(commentChar2.strip()) + ")"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号