From 09deaf0ad5aeb1a7c9f53ba3db29974a1abe4fd5 Mon Sep 17 00:00:00 2001 From: suVene Date: Mon, 26 Jan 2009 09:42:07 +0000 Subject: args が null の時の対応 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@29075 d0d07461-0603-4401-acd4-de1884942a52 --- copy.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'copy.js') diff --git a/copy.js b/copy.js index 76f5acb..92a059b 100644 --- a/copy.js +++ b/copy.js @@ -288,7 +288,8 @@ var exCopyManager = { copyString = e.toString(); } } else { - if (!arg) arg = liberator.globalVariables.copy_templates[0]; + if (!arg) arg = liberator.globalVariables.copy_templates[0].label; + var template = getCopyTemplate(arg) || {value: arg}; if (typeof template.custom == 'function'){ copyString = template.custom.call(this, template.value); @@ -298,7 +299,9 @@ var exCopyManager = { copyString = replaceVariable(template.value); } } - util.copyToClipboard(copyString || ''); + + if (copyString) + util.copyToClipboard(copyString); if (isError){ liberator.echoerr('CopiedErrorString: `' + copyString + "'"); } else { -- cgit v1.2.3