當前位置: 首頁>>代碼示例>>Python>>正文


Python sublime.CLASS_WORD_START屬性代碼示例

本文整理匯總了Python中sublime.CLASS_WORD_START屬性的典型用法代碼示例。如果您正苦於以下問題:Python sublime.CLASS_WORD_START屬性的具體用法?Python sublime.CLASS_WORD_START怎麽用?Python sublime.CLASS_WORD_START使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在sublime的用法示例。


在下文中一共展示了sublime.CLASS_WORD_START屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_name_candidate

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import CLASS_WORD_START [as 別名]
def get_name_candidate(view, point):
    point_region = view.sel()[0]
    if point is not None:
        point_region = sublime.Region(point, point)
    name = view.substr(point_region).strip()
    if not name:
        cursor_region = view.expand_by_class(
            point_region,
            sublime.CLASS_WORD_START
            | sublime.CLASS_LINE_START
            | sublime.CLASS_PUNCTUATION_START
            | sublime.CLASS_WORD_END
            | sublime.CLASS_PUNCTUATION_END
            | sublime.CLASS_LINE_END,
        )
        name = view.substr(cursor_region)
    return name 
開發者ID:unlight,項目名稱:sublime-import-helper,代碼行數:19,代碼來源:insert_import_command.py

示例2: right_word

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import CLASS_WORD_START [as 別名]
def right_word(cls, view, region, repeat=1):
        return cls._expand_words(
            view,
            region,
            classes=sublime.CLASS_WORD_START,
            repeat=repeat,
            forward=True,
        ) 
開發者ID:heyglen,項目名稱:network_tech,代碼行數:10,代碼來源:selection_utility.py

示例3: word

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import CLASS_WORD_START [as 別名]
def word(cls, view, region):
        return cls._expand_words(
            view,
            region,
            classes=sublime.CLASS_WORD_START,
            repeat=0,
            forward=True,
        ) 
開發者ID:heyglen,項目名稱:network_tech,代碼行數:10,代碼來源:selection_utility.py

示例4: on_hover_provider

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import CLASS_WORD_START [as 別名]
def on_hover_provider(self, view, point):
		seperators = "./\\()\"'-:,.;<>~!@#%^&*|+=[]{}`~?."
		word = view.expand_by_class(point, sublime.CLASS_WORD_START | sublime.CLASS_WORD_END, separators=seperators)
		word_string = word and view.substr(word)
		if not word_string:
			return None

		match = re.search("\\$[a-zA-Z0-9_]*", word_string)
		if not match:
			return None

		word_string = match.group()
		return (match.group(), word) 
開發者ID:daveleroy,項目名稱:sublime_debugger,代碼行數:15,代碼來源:php.py

示例5: get_next_character

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import CLASS_WORD_START [as 別名]
def get_next_character(view, position):
    if view.substr(position) in [" ", "\t", "\n"]:
        position = view.find_by_class(
            position, True, sublime.CLASS_WORD_START | sublime.CLASS_PUNCTUATION_START
        )
    return position 
開發者ID:jcberquist,項目名稱:sublimetext-cfml,代碼行數:8,代碼來源:utils.py

示例6: expand_selection

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import CLASS_WORD_START [as 別名]
def expand_selection(view, point_or_region, aliases={}):
    region = view.expand_by_class(point_or_region, 
        sublime.CLASS_WORD_START | 
        sublime.CLASS_WORD_END, ' (){},[]%&')
    selection = view.substr(region).strip()
    if aliases:
        parts = selection.split('.')
        for alias, canonical in aliases.items():
            if alias == parts[0]:
                parts[0] = canonical
                return '.'.join(parts)
    return selection 
開發者ID:vishnevskiy,項目名稱:ElixirSublime,代碼行數:14,代碼來源:elixir_sublime.py


注:本文中的sublime.CLASS_WORD_START屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。