From 6fee006d7010db688afc8ef9c8bdc91770b383bc Mon Sep 17 00:00:00 2001 From: pekepeke Date: Sat, 10 Jan 2009 17:20:50 +0000 Subject: 補完時のラベル修正 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@28284 d0d07461-0603-4401-acd4-de1884942a52 --- exopen.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'exopen.js') diff --git a/exopen.js b/exopen.js index 5583d28..64fc89b 100644 --- a/exopen.js +++ b/exopen.js @@ -163,10 +163,10 @@ liberator.plugins.exOpen = (function(){ }, registerCommand: function(){ var self = this; - commands.addUserCommand(['exopen'], 'Open byextension url', + commands.addUserCommand(['exopen'], 'Open byextension url', function(args) self.open(args.string, args.bang), { completer: function(context, args) { - context.title = ['Template', 'Value']; + context.title = ['Template', 'Description - Value']; if (!context.filter) { context.completions = self.completer; return; @@ -186,12 +186,13 @@ liberator.plugins.exOpen = (function(){ if (!arg) return; var template = this.find(arg) || {value: arg}; if (typeof template.custom == 'function') { - url = replacer(template.custom.call(this, template.value), template.escape); + url = template.custom.call(this, template.value); } else if (template.custom instanceof Array){ url = replacer(template.value).replace(template.custom[0], template.custom[1], template.escape); } else { url = replacer(template.value, template.escape); } + if (!url) return; if (template.newtab) openTabOrSwitch(url); else liberator.open(url); } -- cgit v1.2.3