From aed6d117ce8af27fd986a4d6a11a6c64898ceff4 Mon Sep 17 00:00:00 2001 From: anekos Date: Thu, 25 Mar 2010 14:03:40 +0000 Subject: 外部から使える様に git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37089 d0d07461-0603-4401-acd4-de1884942a52 --- x-hint.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'x-hint.js') diff --git a/x-hint.js b/x-hint.js index fa8e537..0cb6cef 100755 --- a/x-hint.js +++ b/x-hint.js @@ -163,12 +163,18 @@ let INFO = true ); + function showHintsWith (mode, xpath) { + last.xpath = xpath; + hints.show(mode); + } + + __context__.show = showHintsWith; + commands.addUserCommand( ['xh[int]'], description, function (args) { - last.xpath = args.literalArg; - hints.show(args[0]); + showHintsWith(args[0], args.literalArg); }, { literal: 1 @@ -194,9 +200,8 @@ let INFO = ['xhintdo', 'xhdo'], 'Run js-code with X-Hint', function (args) { - last.xpath = args[0]; js = args.literalArg; - hints.show(hintModeText); + showHintsWith(hintModeText, args[0]); }, { literal: 1, -- cgit v1.2.3