def on_text_command(self, view, command, args):
"""
Listen for double clicks in help files and, if they occur over links,
follow the link instead of selecting the text.
"""
if command == "drag_select" and args.get("by", None) == "words":
event = args["event"]
point = view.window_to_text((event["x"], event["y"]))
if view.match_selector(point, "text.hyperhelp meta.link"):
view.window().run_command("hyper_help_navigate", {"nav": "follow_link"})
return ("noop")
return None
评论列表
文章目录