aboutsummaryrefslogtreecommitdiffstats
path: root/localkeymode.js
diff options
context:
space:
mode:
authoranekos2008-11-15 06:22:19 +0000
committeranekos2008-11-15 06:22:19 +0000
commitb3bd606ea321b3efc6337309192152cc1bb2431b (patch)
treecc78ce8aef88d2b87d11d0b326896a33194863ee /localkeymode.js
parentcc712c538070b90c83e11f5aefb1ee2954c318f6 (diff)
downloadvimperator-plugins-b3bd606ea321b3efc6337309192152cc1bb2431b.tar.bz2
小さな修正&文字列での関数生成を行わないように
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@23762 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'localkeymode.js')
-rw-r--r--localkeymode.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/localkeymode.js b/localkeymode.js
index bc93ac1..65b4c22 100644
--- a/localkeymode.js
+++ b/localkeymode.js
@@ -80,8 +80,8 @@ liberator.plugins.LocalKeyMode = (function() {
var _enableTabs = [];
var _names;
- var feedkeysfuncName = typeof liberator.modules != 'undefined' ?
- 'liberator.modules.events.feedkeys' : 'liberator.events';
+ var feedKeys = liberator.modules ? liberator.modules.events.feedkeys
+ : liberator.events.feedkeys;
// utility function
function cloneMap(org) {
return new Map(
@@ -174,13 +174,12 @@ liberator.plugins.LocalKeyMode = (function() {
if (!extra || !extra.rhs) extra.rhs = (item[1]+'').replace(rhsRegExp, ' ');
if (typeof command != 'function') {
+ let commandName = command;
if (command.charAt(0) == ':')
- command = new Function( extra.noremap ?
- 'commandline.open("", "'+command+'", modes.EX);' :
- 'liberator.execute("'+command+'");' );
+ command = extra.noremap ? function () commandline.open("", commandName, modes.EX)
+ : function () liberator.execute(commandName);
else
- command = new Function([ feedkeysfuncName, '("', command, '", ',
- (extra.noremap ? true : false), ', true)'].join('') );
+ command = function () feedKeys(command, extra.noremap, true);
}
keymaps.push(new Map([modes.NORMAL], key, 'localkeymap', command, extra) );
}