text_objects.py 文件源码

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

项目:VintageousPlus 作者: trishume 项目源码 文件源码
def next_word_start(view, pt):
    if is_at_punctuation(view, pt):
        # Skip all punctuation surrounding the caret and any trailing spaces.
        end = get_punctuation_region(view, pt).b
        if view.substr(end) in (' ', '\n'):
            end = view.find_by_class(end, forward=True,
                                     classes=ANCHOR_NEXT_WORD_BOUNDARY)
            return end
    elif is_at_space(view, pt):
        # Skip all spaces surrounding the cursor and the text word.
        end = get_space_region(view, pt).b
        if is_at_word(view, end) or is_at_punctuation(view, end):
            end = view.find_by_class(end, forward=True,
                                     classes=CLASS_WORD_END |
                                             CLASS_PUNCTUATION_END |
                                             CLASS_LINE_END)
            return end

    # Skip the word under the caret and any trailing spaces.
    return view.find_by_class(pt, forward=True,
                              classes=ANCHOR_NEXT_WORD_BOUNDARY)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号