def run(self):
view = self.window.active_view()
pt = view.sel()[0]
scope = view.scope_name(pt.begin()).rstrip()
# TODO Fix jumptags scopes (rename them to less generic scopes)
jumptag_scopes = [
'text.neovintageous.help string.neovintageous',
'text.neovintageous.help support.constant.neovintageous'
]
if scope not in jumptag_scopes:
return
subject = view.substr(view.extract_scope(pt.begin()))
if len(subject) < 3:
return
match = re.match('^\'[a-z_]+\'|\\|[^\\s\\|]+\\|$', subject)
if match:
subject = subject.strip('|')
# TODO Refactor ex_help code into a reusable middle layer so that
# this command doesn't have to call the ex command.
self.window.run_command('ex_help', {'command_line': 'help ' + subject})
评论列表
文章目录