tools.py 文件源码

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

项目:EasyClangComplete 作者: niosus 项目源码 文件源码
def cursor_pos(view, pos=None):
        """Get current cursor position.

        Args:
            view (sublime.View): current view
            pos (int, optional): given position. First selection by default.

        Returns:
            (row, col): tuple of row and col for cursor position
        """
        if not pos:
            pos = view.sel()
            if len(pos) < 1:
                # something is wrong
                return None
            # we care about the first position
            pos = pos[0].a
        (row, col) = view.rowcol(pos)
        row += 1
        col += 1
        return (row, col)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号