本文整理汇总了Python中sublimezen.expand_abbr函数的典型用法代码示例。如果您正苦于以下问题:Python expand_abbr函数的具体用法?Python expand_abbr怎么用?Python expand_abbr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了expand_abbr函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_context
def check_context(view):
abbr = zencoding.actions.basic.find_abbreviation(editor)
if abbr:
try: result = expand_abbr(abbr)
except ZenInvalidAbbreviation: return None
if result:
return abbr, result
示例2: run
def run(self, edit, doctype=None):
view = self.view
syntax = zen_settings.get( 'default_html_syntax',
'Packages/HTML/HTML.tmlanguage' )
view.set_syntax_file(syntax)
view.run_command( 'insert_snippet',
{'contents': expand_abbr('html:%s' % doctype)} )
示例3: run_command
def run_command(self, view, cmd_input):
try:
ex = expand_abbr(cmd_input, super_profile="no_check_valid")
p = editor.get_profile_name() + ".no_check_valid"
if not ex.strip():
raise ZenInvalidAbbreviation("Empty expansion %r" % ex)
except Exception:
return False
view.run_command("run_zen_action", dict(action="wrap_with_abbreviation", abbr=cmd_input, profile_name=p))
示例4: run_command
def run_command(self, view, cmd_input):
try:
ex = expand_abbr(cmd_input, super_profile='no_check_valid')
p = editor.get_profile_name() + '.no_check_valid'
if not ex: raise ZenInvalidAbbreviation('Empty expansion %r' % ex)
except ZenInvalidAbbreviation:
return False
view.run_command (
'run_zen_action',
dict(action="wrap_with_abbreviation", abbr=cmd_input, profile_name=p))